-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTeam.cpp
50 lines (46 loc) · 1.14 KB
/
Team.cpp
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
#include <iostream>
using namespace std;
/*
* One day three best friends Petya, Vasya and Tonya decided to form a team and
* take part in programming contests. Participants are usually offered several
* problems during programming contests. Long before the start the friends
* decided that they will implement a problem if at least two of them are sure
* about the solution. Otherwise, the friends won't write the problem's
* solution.
*
* This contest offers n problems to the participants. For each problem we know,
* which friend is sure about the solution. Help the friends find the number of
* problems for which they will write a solution.
*
*
*/
int main()
{
int N;
cin >> N;
int ar[N][3];
for (int i = 0; i < N; i++)
{
for (int j = 0; j < 3; j++)
{
cin >> ar[i][j];
}
}
int count = 0;
for (int i = 0; i < N; i++)
{
int count1 = 0;
for (int j = 0; j < 3; j++)
{
if (ar[i][j] == 1)
{
count1++;
}
}
if (count1 > 1)
{
count++;
}
}
cout << count;
}