# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
86338 | 2018-11-26T07:31:59 Z | NurstanDuisengaliev | Telefoni (COCI17_telefoni) | C++14 | 111 ms | 800 KB |
#include <bits/stdc++.h> #define pb push_back using namespace std; vector <int> x; int main () { int n, m; cin >> n >> m; bool a[n]; for (int i = 0; i < n; i ++) { cin >> a[i]; } int sum = 0; int k = 0; for (int i = 0; i < n; i ++) { if (a[i] == 0) { k ++; } else { if (k != 0) { x.pb(k); } k = 0; } } if (k != 0) { x.pb(k); } for (int i = 0; i < x.size(); i ++) { sum += x[i] /m; } cout << sum; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 376 KB | Output is correct |
2 | Correct | 3 ms | 488 KB | Output is correct |
3 | Correct | 3 ms | 516 KB | Output is correct |
4 | Correct | 2 ms | 516 KB | Output is correct |
5 | Correct | 2 ms | 516 KB | Output is correct |
6 | Correct | 2 ms | 516 KB | Output is correct |
7 | Correct | 2 ms | 516 KB | Output is correct |
8 | Correct | 55 ms | 800 KB | Output is correct |
9 | Correct | 107 ms | 800 KB | Output is correct |
10 | Correct | 111 ms | 800 KB | Output is correct |