Accepted
Code
// @sagorahmedmunna
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0), cin.tie(0);
int n;
cin >> n;
set<array<int, 2>> st;
for (int i = 1; i <= n; i++) {
int ai;
cin >> ai;
st.insert({ai, i});
}
int q;
cin >> q;
while (q--) {
int val;
cin >> val;
auto [v, i] = *st.begin();
cout << i << '\n';
st.erase(st.begin());
st.insert({val, i});
}
return 0;
}
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:38:58
- Judged At
- 2024-11-11 03:18:16
- Judged By
- Score
- 100
- Total Time
- 75ms
- Peak Memory
- 5.598 MiB