-
Notifications
You must be signed in to change notification settings - Fork 6
/
1486.c
32 lines (27 loc) · 774 Bytes
/
1486.c
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
#include <stdio.h>
int main() {
int p, n, c;
while(scanf("%d %d %d", &p, &n, &c) != EOF && p != 0 && n != 0 && c != 0){
int vetor[p], i;
for(i = 0; i < p; i++) vetor[i] = 0;
int j, entrada, count = 0;
for(i = 0; i < n; i++){
for(j = 0; j < p; j++){
scanf("%d", &entrada);
if(entrada == 1){
vetor[j]++;
} else {
if(vetor[j] >= c){
count++;
}
vetor[j] = 0;
}
}
} for (i = 0; i < p; i++){
if(vetor[i] >= c){
count++;
}
} printf("%d\n", count);
}
return 0;
}