/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 332.0 KiB
#2 Accepted 173ms 736.0 KiB
#3 Accepted 495ms 1.133 MiB
#4 Accepted 486ms 924.0 KiB
#5 Time Exceeded ≥1013ms ≥940.0 KiB
#6 Time Exceeded ≥1027ms ≥948.0 KiB

Code

#include <iostream>
#include <vector>

using namespace std;

int main() {
    int N, Q;
    cin >> N;

    vector<int> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }

    cin >> Q;

    for (int i = 0; i < Q; i++) {
        int X;
        cin >> X;

        // Find the index of the minimum value
        int minIndex = 0;
        for (int j = 1; j < N; j++) {
            if (A[j] < A[minIndex]) {
                minIndex = j;
            }
        }

        // Print the position of the minimum value
        cout << minIndex + 1 << endl;

        // Replace the minimum value with X
        A[minIndex] = 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:59:02
Judged At
2024-10-03 13:24:41
Judged By
Score
60
Total Time
≥1027ms
Peak Memory
≥1.133 MiB