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