# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
153854 | 2019-09-17T05:03:51 Z | Ruxandra985 | Baloni (COCI15_baloni) | C++14 | 105 ms | 1784 KB |
#include <cstdio> #include <algorithm> #include <deque> using namespace std; int f[1000010]; int main() { FILE *fin = stdin; FILE *fout = stdout; int n,i,x; int sol = 0; fscanf (fin,"%d",&n); for (i=1;i<=n;i++){ fscanf(fin,"%d",&x); if (!f[x+1]) sol++; else f[x+1]--; f[x]++; } fprintf (fout,"%d",sol); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 252 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 3 ms | 256 KB | Output is correct |
5 | Correct | 103 ms | 1656 KB | Output is correct |
6 | Correct | 105 ms | 1636 KB | Output is correct |
7 | Correct | 87 ms | 1740 KB | Output is correct |
8 | Correct | 84 ms | 1656 KB | Output is correct |
9 | Correct | 93 ms | 1784 KB | Output is correct |
10 | Correct | 94 ms | 1396 KB | Output is correct |