# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
75048 | 2018-09-08T06:44:00 Z | charlies_moo | Telefoni (COCI17_telefoni) | C++17 | 60 ms | 672 KB |
#include <iostream> using namespace std; int main() { int n, d; cin >> n >> d; int lt; int c = 0; for (int i = 0; i < n; i++) { int a; cin >> a; if (a == 1) { lt = i; } else if (i - lt == d) { lt = i; c++; } } cout << c << endl; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 380 KB | Output is correct |
3 | Correct | 2 ms | 552 KB | Output is correct |
4 | Correct | 2 ms | 552 KB | Output is correct |
5 | Correct | 2 ms | 552 KB | Output is correct |
6 | Correct | 2 ms | 672 KB | Output is correct |
7 | Correct | 2 ms | 672 KB | Output is correct |
8 | Correct | 57 ms | 672 KB | Output is correct |
9 | Correct | 57 ms | 672 KB | Output is correct |
10 | Correct | 60 ms | 672 KB | Output is correct |