Time Exceeded
Code
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int arr[n];
for(int i=0; i<n; i++){
cin >> arr[i];
}
int q;
cin >> q;
int qrr[q];
for(int i =0 ; i<q; i++){
cin >> qrr[i];
}
int k = 0;
while(k<q){
int min = arr[0];
int index = 0;
for(int i=0; i<n ; i++){
if(arr[i]<min){
min = arr[i];
index = i;
}
}
cout << index+1;
arr[index] = qrr[k];
cout << endl;
k++;
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1086 KuZ the Position
- Language
- C++11 (G++ 13.2.0)
- Submit At
- 2024-08-17 05:07:53
- Judged At
- 2024-11-11 03:09:44
- Judged By
- Score
- 60
- Total Time
- ≥1035ms
- Peak Memory
- ≥1.32 MiB