/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 328.0 KiB
#2 Accepted 29ms 732.0 KiB
#3 Accepted 269ms 936.0 KiB
#4 Accepted 270ms 936.0 KiB
#5 Time Exceeded ≥1082ms ≥1.324 MiB
#6 Time Exceeded ≥1075ms ≥1.32 MiB

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;
        while(q--) {
            ll x,a=0;
            cin>>x;
            for(ll i=1;i<n;i++) {
                if(v[i]<v[a]) {
                    a=i;
                }
            }
            cout<<a+1<<el;
            v[a]=x;
        }
    }
    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:57:15
Judged At
2024-10-03 13:29:18
Judged By
Score
60
Total Time
≥1082ms
Peak Memory
≥1.324 MiB