/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 214ms 1.086 MiB
#3 Accepted 298ms 1.109 MiB
#4 Accepted 298ms 1.258 MiB
#5 Time Exceeded ≥1086ms ≥1.348 MiB
#6 Time Exceeded ≥1094ms ≥1.316 MiB

Code

#include <bits/stdc++.h>
using namespace std;
int min(int arr[],int n){
    long long t=999999999;
    int k;
    for(int i=0;i<n;i++){
        if(t>arr[i]){
            t=arr[i];
            k=i;
        }
        
    }
    return k;
}
int main()
{
   int n;
   cin>>n;
   int arr[n];
   for(int i=0;i<n;i++){
    cin>>arr[i];

   }
   int ans=0;
   int q;
   cin>>q;
   int quer[q];
   for(int i=0;i<q;i++){
    cin>>quer[i];
    ans=min(arr,n);
    cout<<ans+1<<endl;
     arr[ans]=quer[i];
   
   


   }
}

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:23:47
Judged At
2024-11-11 03:14:55
Judged By
Score
60
Total Time
≥1094ms
Peak Memory
≥1.348 MiB