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-10-03 13:30:46
- Judged By
- Score
- 100
- Total Time
- 73ms
- Peak Memory
- 5.668 MiB