forked from anubhab91/CodeForces-5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTeam.py
More file actions
29 lines (24 loc) · 827 Bytes
/
Team.py
File metadata and controls
29 lines (24 loc) · 827 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
'''
http://codeforces.com/problemset/problem/231/A
Solution: The idea is to parse each line of inputs (strings of 0 and 1) and take a count of 1s in it.
It can be done using Counter from collections package. If its >=2, then its a majority in 3 friends.
Bingo => consider the current problem as solvable. Repeat this for all inputs.
'''
from collections import Counter
class Team:
def solve(self,n,friendViews):
solvable = 0
for friendView in friendViews:
if(Counter(friendView)['1']>=2):
solvable+=1
return solvable
if __name__ == "__main__":
#take inputs
friendViews = list()
n = int(raw_input())
_n = 0
while(_n<n):
friendViews.append(raw_input())
_n+=1
t = Team()
print t.solve(n,friendViews)