CodeForces 231 A.Team(水~)
2017-09-01 23:20
399 查看
Description
给出三个人做n道题的结果,0表示错1表示对,只要有两个人做对就算做对,问做对了几题
Input
第一行一整数n表示题数,之后n行每行三个01值表示三个人做这道题的结果(1≤n≤1000)
Output
输出做对的题数
Sample Input
3
1 1 0
1 1 1
1 0 0
Sample Output
2
Solution
水题
Code
给出三个人做n道题的结果,0表示错1表示对,只要有两个人做对就算做对,问做对了几题
Input
第一行一整数n表示题数,之后n行每行三个01值表示三个人做这道题的结果(1≤n≤1000)
Output
输出做对的题数
Sample Input
3
1 1 0
1 1 1
1 0 0
Sample Output
2
Solution
水题
Code
#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("%d\n",ans); } return 0; }
相关文章推荐
- codeforces 231 A Team(水题)
- 【CodeForces】932 E. Team Work
- codeforces 519C A and B and Team Training 解题报告 贪心
- codeforces 231A - Team
- 【Codeforces】School Regional Team Contest, Saratov, 2011
- codeforces 231 C To Add or Not to Add 贪心
- Problem--231A--Codeforces--Team
- codeforces 107B(Basketball Team) 组合+概率 Java
- Codeforces 401C Team 贪心法
- codeforces 231A Team
- CodeForces 490A Team Olympiad
- Codeforces 490A Team Olympiad(水)
- 【CODEFORCES】 A. Team Olympiad
- Team_Codeforces_231A
- CodeForces 107 B.Basketball Team(水~)
- codeforces 578 B. Finding Team Member( Codeforces Round #320 (Div. 2) )
- Codeforces-519C-A and B and Team Training
- Codeforces 401C Team(贪心+暴力)
- Codeforces-401C-Team
- codeforces 401C - Team