# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
463799 | 2021-08-11T19:01:32 Z | rainboy | Telefoni (COCI17_telefoni) | C | 32 ms | 2008 KB |
#include <stdio.h> #define N 300000 int main() { static int aa[N]; int n, d, i, j, ans; scanf("%d%d", &n, &d); for (i = 0; i < n; i++) scanf("%d", &aa[i]); ans = 0; for (i = 0, j = 1; j < n; j++) if (aa[j]) ans += (j - i - 1) / d, i = j; printf("%d\n", ans); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 0 ms | 204 KB | Output is correct |
5 | Correct | 0 ms | 204 KB | Output is correct |
6 | Correct | 0 ms | 204 KB | Output is correct |
7 | Correct | 1 ms | 284 KB | Output is correct |
8 | Correct | 32 ms | 2008 KB | Output is correct |
9 | Correct | 30 ms | 1928 KB | Output is correct |
10 | Correct | 30 ms | 1920 KB | Output is correct |