/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 328.0 KiB
#2 Wrong Answer 78ms 1.645 MiB
#3 Wrong Answer 334ms 1.621 MiB
#4 Wrong Answer 336ms 1.59 MiB
#5 Time Exceeded ≥1027ms ≥1.352 MiB
#6 Time Exceeded ≥1041ms ≥1.352 MiB

Code

#include <bits/stdc++.h>
using namespace std;

#define endl '\n'
#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define ll long long
#define vi vector<ll>
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main() {
    ll n; 
    cin>>n;

    vi arr(n);
    rep(i,0,n){
        cin>>arr[i];
    }

    ll q;
    cin>>q;

    rep(i,0,q) {
        ll x;
        cin>>x;
    }

    vi indices;
    rep(i,0,q) {
        auto minIt = std::min_element(arr.begin(), arr.end());
        int minIndex = std::distance(arr.begin(), minIt);
        indices.push_back(minIndex);
        *minIt = std::numeric_limits<int>::max();
    }

    for (int i:indices) {
        std::cout << i+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 17:33:49
Judged At
2024-10-03 13:21:32
Judged By
Score
10
Total Time
≥1041ms
Peak Memory
≥1.645 MiB