Time Exceeded
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