/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 536.0 KiB
#2 Accepted 19ms 536.0 KiB
#3 Accepted 113ms 888.0 KiB
#4 Accepted 123ms 864.0 KiB
#5 Time Exceeded ≥1088ms ≥1.355 MiB
#6 Time Exceeded ≥1090ms ≥1.336 MiB

Code

#include <bits/stdc++.h>
#include <limits.h> 
using namespace std;

#define endl '\n'
#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define ll long long
#define vi vector<ll>
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main(){
    fast
    ll n;cin>>n;
    vi a(n);
    ll mn= INT_MAX;
    ll index=0;

    rep(i,0,n){
        cin>>a[i];
        if(a[i]<mn){
            mn=a[i];
            index=i;
        }
    }
    ll q;
    cin>>q;
    while (q--)
    {
        ll x;
        cin>>x;
        cout<<index+1<<endl;
        a[index]=x;

        mn=x;
        rep(i,0,n){
            if(a[i]<mn){
                mn=a[i];
                index=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 17:02:38
Judged At
2024-10-03 13:24:32
Judged By
Score
60
Total Time
≥1090ms
Peak Memory
≥1.355 MiB