#include <iostream>
using namespace std;
bool moze[10000001];
int brojac,n;
int main(){
cin>>n;
for(int i=0;i<n;i++){
int broj;
cin>>broj;
if(!moze[broj+i]){
brojac++;
moze[broj+i]=true;
}
}
cout<<brojac;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
3 |
Incorrect |
3 ms |
256 KB |
Output isn't correct |
4 |
Incorrect |
3 ms |
256 KB |
Output isn't correct |
5 |
Incorrect |
187 ms |
1060 KB |
Output isn't correct |
6 |
Incorrect |
186 ms |
1144 KB |
Output isn't correct |
7 |
Incorrect |
153 ms |
1052 KB |
Output isn't correct |
8 |
Incorrect |
151 ms |
1016 KB |
Output isn't correct |
9 |
Incorrect |
186 ms |
1084 KB |
Output isn't correct |
10 |
Incorrect |
165 ms |
1144 KB |
Output isn't correct |