Codeforces 231A. Team Solution
Solve in C++:
#include<iostream>
using namespace std;
int main(){
int t,i,j,v,p,a,p1=0,v1=0,t1=0,c=0,s=0;
while(cin>>a)
{
s=0;
for(i=1;i<=a;i++)
{
cin>>p>>v>>t;
if(((p==1&&v==1)||t==1)&&((v==1&&t==1)||p==1)&&((p==1&&t==1)||v==1))
{
c++;
}
}
cout<<c<<endl;
c=0;
}
}
#include<iostream>
using namespace std;
int main(){
int t,i,j,v,p,a,p1=0,v1=0,t1=0,c=0,s=0;
while(cin>>a)
{
s=0;
for(i=1;i<=a;i++)
{
cin>>p>>v>>t;
if(((p==1&&v==1)||t==1)&&((v==1&&t==1)||p==1)&&((p==1&&t==1)||v==1))
{
c++;
}
}
cout<<c<<endl;
c=0;
}
}
No comments