/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 180ms 608.0 KiB
#3 Accepted 278ms 948.0 KiB
#4 Accepted 304ms 940.0 KiB
#5 Time Exceeded ≥1093ms ≥1.348 MiB
#6 Time Exceeded ≥1094ms ≥1.352 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-11-11 03:16:27
Judged By
Score
60
Total Time
≥1094ms
Peak Memory
≥1.352 MiB