标签:iostream -- type col while efi codeforce matrix map
#include<iostream> #include<algorithm> #include<cstdio> #include<cstring> #include<cmath> #include<map> #include<vector> #include<queue> #include<set> #define IL inline #define x first #define y second typedef long long ll; using namespace std; const int N=500; int a[N][N]; int ans1; int ans2; int ans3; int main() { int t; cin>>t; while(t--) { int n,m; cin>>n>>m; for(int i=1; i<=n; i++) for(int j=1; j<=m; j++) cin>>a[i][j]; bool flag1=false,flag2=false; int cnt1=0,cnt2=0; for(int i=1; i<=n; i++) { flag1=true; for(int j=1; j<=m; j++) if(a[i][j]) { flag1=false; break; } if(flag1) cnt1++; } for(int i=1; i<=m; i++) { flag2=true; for(int j=1; j<=n; j++) if(a[j][i]) { flag2=false; break; } if(flag2) cnt2++; } int res=min(cnt1,cnt2); if(res%2) cout<<"Ashish"<<endl; else cout<<"Vivek"<<endl; } return 0; }
Codeforces Round #648 (Div. 2) A - Matrix Game
标签:iostream -- type col while efi codeforce matrix map
原文地址:https://www.cnblogs.com/QingyuYYYYY/p/13110483.html