# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
315158 | 2020-10-22T03:35:28 Z | Kesatria_Komodo | Baloni (COCI15_baloni) | C++17 | 121 ms | 7448 KB |
#include <cstdio> int frek[1000001]; int main(){ int N; scanf("%d" , &N); int arr[N] , ans = 0; for (int i = 0 ; i < N ; i++) scanf("%d" , arr + i); for (int i = N - 1 ; i >= 0 ; i--){ if (!frek[arr[i] - 1]) ++ans; else --frek[arr[i] - 1]; ++frek[arr[i]]; } printf("%d\n" , ans); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 1 ms | 256 KB | Output is correct |
3 | Correct | 1 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 109 ms | 7052 KB | Output is correct |
6 | Correct | 121 ms | 7448 KB | Output is correct |
7 | Correct | 93 ms | 6136 KB | Output is correct |
8 | Correct | 98 ms | 6008 KB | Output is correct |
9 | Correct | 102 ms | 6580 KB | Output is correct |
10 | Correct | 102 ms | 6520 KB | Output is correct |