Submission #1112486

# Submission time Handle Problem Language Result Execution time Memory
1112486 2024-11-14T08:47:35 Z vjudge1 Baloni (COCI15_baloni) C++17
60 / 100
2000 ms 3664 KB
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int say=0;
	int a[n];
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	for(int x=0;x<n;x++){
		int mx=a[x];
		if(mx==-1)continue;
		else say++;
		int i=0;
		for(i=x+i;i<n;i++){
			if(mx-1==a[i]){
				a[i]=-1;
				mx--;
			}
	}}
	cout<<say;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 2 ms 336 KB Output is correct
3 Correct 5 ms 508 KB Output is correct
4 Correct 8 ms 336 KB Output is correct
5 Correct 1073 ms 3408 KB Output is correct
6 Execution timed out 2063 ms 3664 KB Time limit exceeded
7 Execution timed out 2064 ms 3152 KB Time limit exceeded
8 Execution timed out 2045 ms 3152 KB Time limit exceeded
9 Correct 1646 ms 3408 KB Output is correct
10 Execution timed out 2044 ms 3512 KB Time limit exceeded