/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 17ms 664.0 KiB
#3 Accepted 112ms 940.0 KiB
#4 Accepted 127ms 880.0 KiB
#5 Time Exceeded ≥1093ms ≥1.355 MiB
#6 Time Exceeded ≥1089ms ≥1.355 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-11-11 03:13:03
Judged By
Score
60
Total Time
≥1093ms
Peak Memory
≥1.355 MiB