/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 332.0 KiB
#2 Accepted 173ms 724.0 KiB
#3 Accepted 349ms 908.0 KiB
#4 Accepted 362ms 924.0 KiB
#5 Time Exceeded ≥1004ms ≥1.098 MiB
#6 Time Exceeded ≥1054ms ≥1.094 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-10-03 13:29:30
Judged By
Score
60
Total Time
≥1054ms
Peak Memory
≥1.098 MiB