/ SeriousOJ /

Record Detail

Compile Error

Traceback (most recent call last):
  File "/usr/lib/python3.12/py_compile.py", line 144, in compile
    code = loader.source_to_code(source_bytes, dfile or file,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 1059, in source_to_code
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "foo.py", line 1
    // #include <bits/stdc++.h>
    ^^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.12/py_compile.py", line 150, in compile
    raise py_exc
py_compile.PyCompileError:   File "foo.py", line 1
    // #include <bits/stdc++.h>
    ^^
SyntaxError: invalid syntax

Code

// #include <bits/stdc++.h>
// #define int long long
// #define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
// #define YN(ans) ans?cout<<"YES"<<endl:cout<<"NO"<<endl;
// #define vin(a,n) vector<int>a(n);for(auto &x:a)cin>>x;
// #define st(v,x) x==0?sort(v.begin(),v.end()):sort(v.rbegin() , v.rend());
// #define vout(a) for(auto x:a){cout<<x<<' ';}cout<<"\n";
// using namespace std;
// const int mod=1e9+7;
// struct node{
//     int b,r,g,y;
// };

// void solved_by_RAFIQ(){
//     int n,m;cin>>n>>m;
//     vector<node>vs(n+1);
//     vector<string>vss(n+1);
//     vs[0].b=vs[0].r=vs[0].g=vs[0].y=0;
//     map<pair<char,int>,int>mpb;
//     vector<vector<int>>vv(n+1);
//     for(int i=0;i<n;i++){
//         string s;cin>>s;vss[i+1]=s;
//         vs[i+1].b=vs[i].b+s.find("B")?1:0;
//         vs[i+1].r=vs[i].r+s.find("R")?1:0;
//         vs[i+1].g=vs[i].g+s.find("G")?1:0;
//         vs[i+1].y=vs[i].y+s.find("Y")?1:0;
//         // vv[i+1][s[0]]=vv[i][s[0]]+
//         if(vs[i+1].b>vs[i].b)mpb[{'B',vs[i+1].b}]=i;
//         if(vs[i+1].r>vs[i].r)mpb[{'R',vs[i+1].r}]=i;
//         if(vs[i+1].g>vs[i].g)mpb[{'G',vs[i+1].g}]=i;
//         if(vs[i+1].y>vs[i].y)mpb[{'Y',vs[i+1].y}]=i;
//     }
//     while(m--){
//         int x,y;cin>>x>>y;
//         int ans=-1;
//         for(int i=1;i<3;i++){
//             if(mpb[{vss[x][i-1],}])
//         }
//     }

// }


// signed main(){
//     fastio
//     int test_case=1,n=1;cin>>test_case;
//     while (test_case--){
//         //cout<< "Case "<<n<<": ";n++;
//         solved_by_RAFIQ();
//     }
// }

#include <bits/stdc++.h>
#define int long long
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define YN(ans) ans?cout<<"YES"<<endl:cout<<"NO"<<endl;
#define vin(a,n) vector<int>a(n);for(auto &x:a)cin>>x;
#define st(v,x) x==0?sort(v.begin(),v.end()):sort(v.rbegin() , v.rend());
#define vout(a) for(auto x:a){cout<<x<<' ';}cout<<"\n";
using namespace std;
const int mod=1e9+7;

void solved_by_RAFIQ(){
    int n;cin>>n;
    set<pair<int,int>>sp;
    for(int i=1;i<=n;i++){
        int x;cin>>x;sp.insert({x,i});
    }
    int q;cin>>q;
    while(q--){
        int x;cin>>x;
        int e,a;
        for(auto it:sp){
            e=it.second;a=it.first;
            cout << it.second <<endl;break;
        }
        sp.erase({a,e});
        sp.insert({x,e});
    }
}


signed main(){
    fastio
    int test_case=1,n=1;//cin>>test_case;
    while (test_case--){
        //cout<< "Case "<<n<<": ";n++;
        solved_by_RAFIQ();
    }
}

Information

Submit By
Type
Submission
Problem
P1086 KuZ the Position
Contest
Bangladesh 2.0
Language
Python 3 (Python 3.12.3)
Submit At
2024-08-16 17:32:36
Judged At
2024-11-11 03:11:27
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes