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;
}
else continue;
}
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[n];
}
}
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:19:57
- Judged At
- 2024-10-03 13:27:28
- Judged By
- Score
- 10
- Total Time
- ≥1093ms
- Peak Memory
- ≥1.316 MiB