/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 205ms 784.0 KiB
#3 Accepted 315ms 932.0 KiB
#4 Accepted 315ms 844.0 KiB
#5 Time Exceeded ≥1075ms ≥1.074 MiB
#6 Time Exceeded ≥1092ms ≥1.062 MiB

Code

#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
    int t;
    cin >> t;
    vector<int> arr;
    while (t--)
    {
        int n;
        cin >> n;
        arr.push_back(n);
    }
    int q;
    cin >> q;
    while (q--)
    {
        int x;
        cin >> x;
        int p = 0;
        int minx = arr[p];

        for (int i = 1; i < arr.size(); i++)
        {
            if (minx > arr[i])
            {
                minx = arr[i];
                p = i;
            }
        }
        arr[p] = x;
        cout << p + 1 << endl;
    }

    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:55:08
Judged At
2024-11-11 03:16:56
Judged By
Score
60
Total Time
≥1092ms
Peak Memory
≥1.074 MiB