# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
229420 | 2020-05-04T12:28:00 Z | DodgeBallMan | Baloni (COCI15_baloni) | C++14 | 122 ms | 7332 KB |
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 10; int n, h[N], arrow[N], tot = 0; int main() { scanf("%d",&n); for ( int i = 1 ; i <= n ; i++ ){ scanf("%d",&h[i]); if( !arrow[h[i]] ) { tot++; arrow[h[i]-1]++; } else { arrow[h[i]]--; arrow[h[i]-1]++; } } printf("%d",tot); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Correct | 7 ms | 384 KB | Output is correct |
4 | Correct | 6 ms | 384 KB | Output is correct |
5 | Correct | 122 ms | 6956 KB | Output is correct |
6 | Correct | 121 ms | 7332 KB | Output is correct |
7 | Correct | 91 ms | 5984 KB | Output is correct |
8 | Correct | 88 ms | 6016 KB | Output is correct |
9 | Correct | 102 ms | 6520 KB | Output is correct |
10 | Correct | 110 ms | 6624 KB | Output is correct |