我是靠谱客的博主 顺利裙子,这篇文章主要介绍CodeForces 231 A.Team(水~),现在分享给大家,希望可以做个参考。

Description

给出三个人做 n 道题的结果,0表示错1表示对,只要有两个人做对就算做对,问做对了几题

Input

第一行一整数n表示题数,之后 n 行每行三个01值表示三个人做这道题的结果(1n1000)

Output

输出做对的题数

Sample Input

3
1 1 0
1 1 1
1 0 0

Sample Output

2

Solution

水题

Code

复制代码
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
#include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<queue> #include<map> #include<set> #include<ctime> using namespace std; typedef long long ll; typedef pair<int,int>P; const int INF=0x3f3f3f3f,maxn=100001; char a[maxn][3]; int n; int main() { while(~scanf("%d",&n)) { for(int i=0;i<n;i++) for(int j=0;j<3;j++) scanf("%d",&a[i][j]); int ans=0; for(int i=0;i<n;i++) if(a[i][0]+a[i][1]+a[i][2]>=2)ans++; printf("%dn",ans); } return 0; }

最后

以上就是顺利裙子最近收集整理的关于CodeForces 231 A.Team(水~)的全部内容,更多相关CodeForces内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(47)

评论列表共有 0 条评论

立即
投稿
返回
顶部