/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 25ms 552.0 KiB
#3 Accepted 30ms 920.0 KiB
#4 Accepted 30ms 724.0 KiB
#5 Accepted 73ms 5.488 MiB
#6 Accepted 76ms 5.488 MiB

Code

// I AM A MUSLIM

#include "bits/stdc++.h"

#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")

#define fastIO std::ios::sync_with_stdio(0);std::cin.tie(0)
#define ll long long int
#define flush fflush(stdout)
#define bl printf("\n")
#define yn(a, b) printf("%s\n", a >= b ? "Yes":"No")
// #define int ll

using pii = std::pair<int,int>;

const int MOD = 1000000007;
// const int MOD = 998244353;
const int mxN = 100100;

signed main() {
    // fastIO;
    int testCases=1;
    // scanf("%d",&testCases);
    // std::cin>>testCases;
    
    for (int TC = 1; TC <= testCases; TC++) {
        int N;
        scanf("%d",&N);
        std::map<int,int> at;
        for (int i = 1,x; i <= N; i++) {
            scanf("%d",&x);
            at[x] = i;
        }
        
        int q;
        scanf("%d",&q);
        for (int i = 0, x; i < q; i++) {
            scanf("%d",&x);
            int pos = at.begin()->second;
            printf("%d\n",pos);
            at.erase(at.begin());
            at[x] = pos;
        }
        
    }
    
    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:42:58
Judged At
2024-10-03 13:30:19
Judged By
Score
100
Total Time
76ms
Peak Memory
5.488 MiB