-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteam.java
57 lines (48 loc) · 1.33 KB
/
team.java
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
46
47
48
49
50
51
52
53
54
55
56
57
import java.io.*;
import java.util.*;
public class team {
public static void main(String[] args) {
FastScanner sc = new FastScanner();
PrintWriter pw = new PrintWriter(System.out);
int n=sc.ni();
int a[][]=new int[n][3];
int k=0,solved=0;
for(int i=0;i<n;i++)
{
a[i][0]=sc.ni();
a[i][1]=sc.ni();
a[i][2]=sc.ni();
if(a[i][0]==1)
k++;
if(a[i][1]==1)
k++;
if(a[i][2]==1)
k++;
if(k>=2)
solved++;
k=0;
}
pw.println(solved);
pw.close();
}
static class FastScanner {
BufferedReader br;
StringTokenizer st;
public FastScanner() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int ni() {
return Integer.parseInt(next());
}
}
}