Submission #1112359

# Submission time Handle Problem Language Result Execution time Memory
1112359 2024-11-14T06:31:11 Z vjudge1 Baloni (COCI15_baloni) C++17
0 / 100
2000 ms 7420 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;


int32_t main(){  
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin>>n;
int a[n];
vector<bool> b(n);
fill(b.begin(),b.end(),false);
int yukseklik=-1;
int idx=-1;
int cnt=0;
for(int i=0;i<n;i++)cin>>a[i];
while(find(b.begin(),b.end(),false)!=b.end()){
	for(int i=0;i<n;i++){
		if(b[i]==false){
			idx=i;
			yukseklik=a[i];
			cnt++;
			break;
			}
		}
	for(int i=idx;i<n;i++){
		if(a[i]==yukseklik){
			b[i]=true;
			yukseklik--;
			}
		}
	
	}

cout<<cnt;
 return 0;  
}  
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 336 KB Output isn't correct
2 Incorrect 3 ms 336 KB Output isn't correct
3 Incorrect 8 ms 504 KB Output isn't correct
4 Incorrect 12 ms 336 KB Output isn't correct
5 Execution timed out 2075 ms 6736 KB Time limit exceeded
6 Execution timed out 2061 ms 7420 KB Time limit exceeded
7 Execution timed out 2037 ms 6224 KB Time limit exceeded
8 Execution timed out 2050 ms 5968 KB Time limit exceeded
9 Execution timed out 2048 ms 6480 KB Time limit exceeded
10 Execution timed out 2064 ms 6736 KB Time limit exceeded