/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 324.0 KiB
#2 Accepted 218ms 736.0 KiB
#3 Accepted 323ms 896.0 KiB
#4 Accepted 349ms 900.0 KiB
#5 Time Exceeded ≥1079ms ≥1.328 MiB
#6 Time Exceeded ≥1088ms ≥1.324 MiB

Code

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

signed main() {
    int n, q;
    cin >> n;
    
    vector<int> vl(n);
    for (auto &u:vl) {
        cin >> u;
    }
    
    cin >> q;
    while (q--) {
        int x;
        cin >> x;
        int mn = vl[0];
        int ind = 0;
        for (int i = 1; i < n; i++) {
            if (vl[i] < mn) {
                mn = vl[i];
                ind = i;
            }
        }
        
        cout << (ind + 1) << endl;
        vl[ind] = 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:41:50
Judged At
2024-11-11 03:17:58
Judged By
Score
60
Total Time
≥1088ms
Peak Memory
≥1.328 MiB