/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 540.0 KiB
#2 Accepted 167ms 1016.0 KiB
#3 Accepted 330ms 1.285 MiB
#4 Accepted 307ms 1.215 MiB
#5 Time Exceeded ≥1030ms ≥1.32 MiB
#6 Time Exceeded ≥1035ms ≥1.32 MiB

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