Codeforces Round #648 (Div. 2) A - Matrix Game

Posted qingyuyyyyy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Codeforces Round #648 (Div. 2) A - Matrix Game相关的知识,希望对你有一定的参考价值。

#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的主要内容,如果未能解决你的问题,请参考以下文章

Codeforces Round #648 (Div. 2) A-F题解

Codeforces Round #648 (Div. 2)ABCDEF(题解)

Codeforces Round #648 (Div. 2)ABCDEF(题解)

Codeforces Round #648 (Div. 2) (A-F)

Codeforces Round #648 (Div. 2).D Solve The Maze

Codeforces Round #648 (Div. 2) A - Matrix Game