Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //thanks God For Every Thing!
- //contest link:
- #include<bits/stdc++.h>
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <algorithm>
- #include <cmath>
- #include <cstdio>
- /*
- */
- #define pi acose(-1)
- #define flush cin.ignore(numeric_limits<streamsize>::max(),'\n');
- #define wow ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
- #define NL printf("\n")
- #define fin freopen("int.txt","r",stdin);
- #define fout freopen("out.txt","w",stdout);
- using namespace std;
- typedef long long int ll;
- typedef double dl;
- // ---------------------- slove---------------------------//
- int main()
- {
- //fin
- //fout
- int n;
- cin>>n;
- int arr[1005][1005];
- for(int i=0; i<n; i++)
- {
- for(int j=0; j<n; j++)
- {
- cin>>arr[i][j];
- }
- }
- int cnt=0, ans=0;
- for(int i=0; i<n; i++)
- {
- cnt=0;
- for(int j=0; j<n; j++)
- {
- if(arr[i][j]==1)
- {
- cnt++;
- }
- }
- if(cnt>=2)
- {
- ans++;
- }
- }
- cout<<ans<<endl;
- return 0;
- }
- //author anikaksh;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement