/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 183ms 688.0 KiB
#3 Accepted 291ms 896.0 KiB
#4 Accepted 321ms 944.0 KiB
#5 Time Exceeded ≥1084ms ≥1.352 MiB
#6 Time Exceeded ≥1093ms ≥1.348 MiB

Code

#include <bits/stdc++.h>
#define fast() ios::sync_with_stdio(false); cin.tie(0);

using namespace std;
#define ll long long int
#define ft first
#define se second
int main() {
    fast()
    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;
        cin >> X;
        ll min_val = 1e9;
        ll min_index = -1;

        for (ll i = 0; i < N; i++) {
            if (v[i] < min_val) {
                min_val = v[i];
                min_index = i;
            }
        }
        cout << min_index + 1 << endl;
        v[min_index] = 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 16:01:43
Judged At
2024-10-03 13:29:03
Judged By
Score
60
Total Time
≥1093ms
Peak Memory
≥1.352 MiB