/ SeriousOJ /

Record Detail

Compile Error

foo.cc: In function 'int main()':
foo.cc:42:2: error: expected '}' at end of input
   42 | }
      |  ^
foo.cc:9:12: note: to match this '{'
    9 | int main() {
      |            ^

Code

#include<bits/stdc++.h>
#define ll long long
#define el '\n'
#define pb push_back
#define fast ios_base::sync_with_stdio(0); cin.tie(nullptr);
using namespace std;


int main() {

    fast;
    ll t=1;
    cin>>t;
    while(t--) {
        ll n;
        cin>>n;
        vector<ll>v(n);
        for(ll i=0;i<n;i++) {
        cin>>v[i];
        }
        ll q;
        cin>>q;
        ll a=0;
        for(ll i=1;i<n;i++) {
                if(v[i]<v[a]) {
                    a=i;
                }
            }
        while(q--) {
            ll x;
            cin>>x;
            cout<<a+1<<el;
            v[a]=x;
            a=0;
            for(ll i=1;i<n;i++) {
                 if(v[i]<v[a]) {
                    a=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 16:18:19
Judged At
2024-11-11 03:15:13
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes