/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 328.0 KiB
#2 Wrong Answer 72ms 1.641 MiB
#3 Wrong Answer 308ms 1.621 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-11-11 03:11:23
Judged By
Score
10
Total Time
308ms
Peak Memory
1.641 MiB