/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 10ms 9.449 MiB
#2 Accepted 233ms 9.742 MiB
#3 Accepted 249ms 10.105 MiB
#4 Accepted 244ms 10.125 MiB
#5 Accepted 330ms 16.32 MiB
#6 Accepted 340ms 16.328 MiB

Code

#include<bits/stdc++.h>
using namespace std;
#define int long long

const int N = 3e5 + 9;
const int inf = 3e10 + 9;

int a[N], b[N];
int dp[1003][103];

string s[N];

vector<int> v[7];

std::map<string, int> mp;

int32_t main() {

    int tc = 1;
    // cin >> tc;
    while(tc--) {
        int n; cin >> n;
        set<pair<int,int> > st;
        for (int i = 0; i < n; ++i)
        {
            int x; cin >> x;
            st.insert({x, i + 1});
        }

        int q; cin >> q;
        while(q--)
        {
            int val; cin >> val;
            auto v = *st.begin();

            st.erase(v);

            st.insert({val, v.second});
            cout << v.second << endl;
        }
    }

    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:51:23
Judged At
2024-11-11 03:17:07
Judged By
Score
100
Total Time
340ms
Peak Memory
16.328 MiB