Accepted
Code
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
void solve()
{
int n ; cin>> n ;
int aa[n+5];
set<pair<int,int>> s ;
for(int i=1 ; i<=n ; i++){
int x ; cin>> x ;
pair<int,int> xx ;
xx = {x , i};
s.insert(xx);
}
int q ; cin>> q ;
while(q--){
int x ; cin>> x ;
auto it = s.begin();
int temp = it->second;
cout<< it->second << nl;
pair<int,int> xx ;
xx = {x,temp};
s.erase(it);
s.insert(xx);
}
}
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
solve() ;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1086 KuZ the Position
- Contest
- Bangladesh 2.0
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2024-08-16 15:46:33
- Judged At
- 2024-11-11 03:17:27
- Judged By
- Score
- 100
- Total Time
- 113ms
- Peak Memory
- 5.695 MiB