/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 324.0 KiB
#2 Accepted 208ms 656.0 KiB
#3 Accepted 288ms 852.0 KiB
#4 Accepted 288ms 916.0 KiB
#5 Time Exceeded ≥1082ms ≥1.332 MiB
#6 Time Exceeded ≥1096ms ≥1.348 MiB

Code

// Online C++ compiler to run C++ program online
#include <bits/stdc++.h>
using namespace std;

int main() {
   
        int n;
        cin>>n;
        long long arr[n];
        for(long long i=0;i<n;i++){
            cin>>arr[i];
        }
        int m;
        cin>>m;
        for(int i=0;i<m;i++){
            long long temp;
            cin>>temp;
             long long min=10e9,pos=0;
            for(int i=0;i<n;i++){
                if(arr[i]<min){
                   min=arr[i];
                   pos=i+1;
                }
            }
            cout<<pos<<endl;
            arr[pos-1]=temp;
            
        }
    return 0;
   

}

Information

Submit By
Type
Submission
Problem
P1086 KuZ the Position
Contest
Bangladesh 2.0
Language
C++17 (G++ 13.2.0)
Submit At
2024-08-16 15:56:00
Judged At
2024-11-11 03:16:50
Judged By
Score
60
Total Time
≥1096ms
Peak Memory
≥1.348 MiB