/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 540.0 KiB
#2 Accepted 179ms 552.0 KiB
#3 Accepted 424ms 900.0 KiB
#4 Accepted 421ms 892.0 KiB
#5 Time Exceeded ≥1012ms ≥948.0 KiB
#6 Time Exceeded ≥1064ms ≥952.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-10-03 13:29:50
Judged By
Score
60
Total Time
≥1064ms
Peak Memory
≥952.0 KiB