-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbee1486.cpp
More file actions
45 lines (37 loc) · 819 Bytes
/
Copy pathbee1486.cpp
File metadata and controls
45 lines (37 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* Contest : Beecrowd
* Problem : 1486 - Circuito Bioquímico Digital
* Link : https://judge.beecrowd.com/pt/problems/view/1486
* Time : O(N * P)
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fastio ios::sync_with_stdio(0); cin.tie(0);
int main() {
fastio
int p, n, c;
while (cin >> p >> n >> c && p && n && c) {
vector<int> tam(p);
int cnt = 0;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < p; ++j) {
int x; cin >> x;
if (i >= n-1) {
tam[j] += x;
cnt += (tam[j] >= c);
}
else {
if (x == 0) {
cnt += (tam[j] >= c);
tam[j] = 0;
}
else
tam[j]++;
}
}
}
cout << cnt << '\n';
}
return 0;
}