#include <fstream>
using namespace std;
ifstream fin("baloni.in");
ofstream fout("baloni.out");
int n,i,sol,v[1000010],f[1000010];
int main() {
fin>>n;
for (i=1;i<=n;i++)
fin>>v[i];
for (i=1;i<=n;i++) {
if (f[v[i]]==0) {
sol++;
f[v[i]-1]++;
}
else {
f[v[i]]--;
f[v[i]-1]++;
}
}
fout<<sol;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
5 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
6 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |