/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 324.0 KiB
#2 Accepted 212ms 736.0 KiB
#3 Accepted 476ms 912.0 KiB
#4 Accepted 476ms 760.0 KiB
#5 Time Exceeded ≥1081ms ≥944.0 KiB
#6 Time Exceeded ≥1096ms ≥944.0 KiB

Code

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

int main()
{
    int n, q;
    cin >> n;
    vector<int> v(n);

    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
    }

    int ind = min_element(v.begin(), v.end()) - v.begin();
    cin >> q;
    while ( q-- )
    {
        int x ; cin>> x ;
        cout << ind + 1 << '\n';
        v[ind] = x ;
        ind = min_element(v.begin(), v.end()) - v.begin();
    }


    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:48:21
Judged At
2024-11-11 03:17:15
Judged By
Score
60
Total Time
≥1096ms
Peak Memory
≥944.0 KiB