Accepted
Code
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n; cin >> n;
map<int,int>mp;
for (int i = 1; i <= n; i++) {
int x; cin >> x;
mp[x] = i;
}
int q; cin >> q;
while(q--) {
int a; cin >> a;
auto it = mp.begin();
int value = (*it).first;
int indx = (*it).second;
int store = indx;
cout << indx << endl;
mp.erase(value);
mp[a] = store;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1086 KuZ the Position
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2024-08-19 22:05:05
- Judged At
- 2024-11-11 03:07:02
- Judged By
- Score
- 100
- Total Time
- 127ms
- Peak Memory
- 5.852 MiB