/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 324.0 KiB
#2 Accepted 207ms 688.0 KiB
#3 Accepted 285ms 728.0 KiB
#4 Accepted 278ms 892.0 KiB
#5 Time Exceeded ≥1088ms ≥1.336 MiB
#6 Time Exceeded ≥1093ms ≥1.344 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-10-03 13:29:24
Judged By
Score
60
Total Time
≥1093ms
Peak Memory
≥1.344 MiB