Sunday, May 1, 2016

UVA 12798 - Handball

#include<bits/stdc++.h>
#define i64 long long
#define mx(a,b,c) max(a,max(b,c))
#define mn(a,b,c) min(a,min(b,c))
#define eef else if
#define ff(i,s,e) for(int i=(s); i<e; i++)
#define ff2(i,s,e) for(int i=(s); i>=e; i--)
#define sf scanf
#define pf printf
#define dbug(x) cout<<"x = "<<x<<endl
#define newl cout<<"\n"
#define putcase cout<<"Case "<<++cse<<":"
#define putcase2 cout<<"Case #"<<++cse<<":"
using namespace std;
int main()
{
    int player , match;
    while(cin>>player>>match){
        int goals;
        int cnt=0;
        ff(i,0,player){
            int flg=0;
            ff(j,0,match){
                cin>>goals;
                if(goals==0)
                    flg=1;
            }
            if(flg==0)
                cnt++;
        }
        cout<<cnt<<endl;
    }
    return 0;
}

No comments:

Post a Comment