/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 324.0 KiB
#2 Accepted 186ms 760.0 KiB
#3 Accepted 256ms 924.0 KiB
#4 Accepted 261ms 888.0 KiB
#5 Time Exceeded ≥1092ms ≥1.324 MiB
#6 Time Exceeded ≥1087ms ≥1.375 MiB

Code

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define sp " "
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl
#define no cout << "no" << endl

void messi()
{
    ll n;
    cin >> n;
    vector<ll> v(n);
    for (ll &x : v)
        cin >> x;
    ll q;
    cin >> q;
    while (q--)
    {
        ll a;
        cin >> a;
        ll mn = INT_MAX;
        ll index = 0;
        for (ll i = 0; i < n; i++)
        {
            if (v[i] < mn)
            {
                mn = v[i];
                index = i;
            }
        }
        v[index] = a;
        cout << index + 1 << endl;
    }
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    ll tc = 1; // cin>>tc;
    while (tc--)
    {
        messi();
    }
    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:03:01
Judged At
2024-11-11 03:16:20
Judged By
Score
60
Total Time
≥1092ms
Peak Memory
≥1.375 MiB