# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
469496 | 2021-09-01T07:58:17 Z | Karabasan | Baloni (COCI15_baloni) | C++17 | 90 ms | 6040 KB |
#include <bits/stdc++.h> using namespace std; int dizi[1000005]; int ind[1000005]; int n; int main() { scanf("%d",&n); for(int i=0;i<n;i++) scanf("%d",&dizi[i]); int cevap=n; for(int i=0;i<n;i++) { if(ind[dizi[i]+1]>0) { cevap--; ind[dizi[i]+1]--; } ind[dizi[i]]++; } printf("%d",cevap); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 332 KB | Output is correct |
4 | Correct | 2 ms | 332 KB | Output is correct |
5 | Correct | 87 ms | 5728 KB | Output is correct |
6 | Correct | 90 ms | 6040 KB | Output is correct |
7 | Correct | 75 ms | 5444 KB | Output is correct |
8 | Correct | 73 ms | 5464 KB | Output is correct |
9 | Correct | 81 ms | 5572 KB | Output is correct |
10 | Correct | 80 ms | 5708 KB | Output is correct |