# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1112423 |
2024-11-14T07:39:36 Z |
vjudge1 |
Baloni (COCI15_baloni) |
C++17 |
|
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 |
6 ms |
336 KB |
Output is correct |
4 |
Correct |
8 ms |
336 KB |
Output is correct |
5 |
Correct |
1080 ms |
3408 KB |
Output is correct |
6 |
Execution timed out |
2074 ms |
3664 KB |
Time limit exceeded |
7 |
Execution timed out |
2045 ms |
3152 KB |
Time limit exceeded |
8 |
Execution timed out |
2045 ms |
3152 KB |
Time limit exceeded |
9 |
Correct |
1660 ms |
3408 KB |
Output is correct |
10 |
Execution timed out |
2055 ms |
3408 KB |
Time limit exceeded |