L1-093 猜帽子游戲 分數 15

Frodnx發表於2024-08-23
// 6'11"
#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int a[N];
int main()
{
    int n;
    cin >> n;
    for(int i = 1; i <= n; ++ i)
        cin >> a[i];
    int k;
    cin >> k;
    for(int i = 1; i <= k; ++ i)
    {
        int caidui = false, caicuo = false;
        for(int j = 1; j <= n; ++ j)
        {
            int tmp;
            cin >> tmp;
            if(tmp == a[j]) caidui = true;
            else if(tmp != 0) caicuo = true;
        }
        if(caicuo == false && caidui == true) cout << "Da Jiang!!!\n";
        else cout << "Ai Ya\n";
    }
    return 0;
}

相關文章