Advertisement
Anik_Akash

try

Oct 26th, 2020
2,377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.21 KB | None | 0 0
  1. //thanks God For Every Thing!
  2. //contest link:
  3.  
  4. #include<bits/stdc++.h>
  5. #include <iostream>
  6. #include <fstream>
  7. #include <string>
  8. #include <algorithm>
  9. #include <cmath>
  10. #include <cstdio>
  11.  
  12. /*
  13.  
  14.  
  15.  
  16. */
  17. #define pi           acose(-1)
  18. #define flush        cin.ignore(numeric_limits<streamsize>::max(),'\n');
  19. #define wow          ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  20. #define NL           printf("\n")
  21. #define fin          freopen("int.txt","r",stdin);
  22. #define fout         freopen("out.txt","w",stdout);
  23.  
  24.  
  25. using namespace std;
  26.  
  27. typedef long long int ll;
  28. typedef double dl;
  29.  
  30. // ---------------------- slove---------------------------//
  31.  
  32.  
  33. int main()
  34. {
  35.     //fin
  36.     //fout
  37.  
  38.     int n;
  39.     cin>>n;
  40.     int arr[1005][1005];
  41.     for(int i=0; i<n; i++)
  42.     {
  43.         for(int j=0; j<n; j++)
  44.         {
  45.             cin>>arr[i][j];
  46.         }
  47.     }
  48.     int cnt=0, ans=0;
  49.     for(int i=0; i<n; i++)
  50.     {
  51.         cnt=0;
  52.         for(int j=0; j<n; j++)
  53.         {
  54.             if(arr[i][j]==1)
  55.             {
  56.                 cnt++;
  57.             }
  58.         }
  59.         if(cnt>=2)
  60.         {
  61.             ans++;
  62.         }
  63.     }
  64.  
  65.     cout<<ans<<endl;
  66.  
  67.     return 0;
  68. }
  69. //author anikaksh;
  70.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement