1 条题解

  • 0
    @ 2025-1-25 7:35:49

    显然当 nn 为奇数时 Alice 胜,nn 为偶数时平局。所以我们需要判断 nn 的奇偶性。

    因为 nn 很大,所以我们直接读入字符串,取它的最后一位,判断它的奇偶性即可。

    // std 100pts
    
    #include<bits/stdc++.h>
    using namespace std;
    
    #define endl '\n' 
    
    void solve()
    {
        string s;
        cin >> s;
        int back_num = s.back() - '0';
        if (back_num % 2 == 1) cout << "Alice" << endl;
        else cout << "Draw" << endl;
    }
    
    int main()
    {
        freopen("game.in","r",stdin);
        freopen("game.out","w",stdout);
        
        ios::sync_with_stdio(0);
        cin.tie(0), cout.tie(0);
        int T;
        cin >> T;
        while (T--) solve();
        return 0;
    }
    
    • 1

    信息

    ID
    513
    时间
    1000ms
    内存
    512MiB
    难度
    6
    标签
    (无)
    递交数
    43
    已通过
    14
    上传者