-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProblem231A.java
More file actions
38 lines (35 loc) · 761 Bytes
/
Copy pathProblem231A.java
File metadata and controls
38 lines (35 loc) · 761 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
package CodeForces;
import java.util.*;
public class Problem231A
{
public static int findSolutions(int[][] input)
{
int count = 0;
for (int i = 0; i < input.length; i++)
{
if (input[i][0] == 1 && input[i][1] == 1)
count++;
else if (input[i][0] == 1 && input[i][2] == 1)
count++;
else if (input[i][1] == 1 && input[i][2] == 1)
count++;
else
{}
}
return count;
}
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int[][] results = new int[n][3];
for (int i = 0; i < n; i++)
{
results[i][0] = scan.nextInt();
results[i][1] = scan.nextInt();
results[i][2] = scan.nextInt();
}
scan.close();
System.out.println(findSolutions(results));
}
}