/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 432.0 KiB
#2 Wrong Answer 179ms 752.0 KiB
#3 Wrong Answer 255ms 940.0 KiB
#4 Wrong Answer 258ms 952.0 KiB
#5 Time Exceeded ≥1097ms ≥964.0 KiB
#6 Time Exceeded ≥1093ms ≥964.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
#define el "\n"
#define ll long long int
#define loop(n) for (int i = 0; i < n; i++)

void solve()
{
    int n;
    cin >> n;
    vector<int> arr(n);
    for (int i = 0; i < n; i++)
    {
        cin >> arr[i];
    }
    int q;
    cin >> q;
    while (q--)
    {
        int x;
        cin >> x;
        int minPos = 1;
        for (int i = 0; i < n - 1; i++)
        {
            if (arr[i + 1] < arr[i])
            {
                minPos = i + 1;
            }
        }
        arr[minPos] = x;
        cout << minPos + 1 << endl;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    solve();
    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:14:12
Judged At
2024-10-03 13:28:04
Judged By
Score
10
Total Time
≥1097ms
Peak Memory
≥964.0 KiB