結果

問題 No.1716 Bonus Nim
ユーザー hotman78hotman78
提出日時 2021-11-11 14:56:19
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 421 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 2,287 ms
コンパイル使用メモリ 209,424 KB
実行使用メモリ 12,592 KB
最終ジャッジ日時 2024-05-02 08:23:43
合計ジャッジ時間 10,246 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 3 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 318 ms
7,284 KB
testcase_05 AC 342 ms
8,624 KB
testcase_06 AC 281 ms
6,940 KB
testcase_07 AC 308 ms
7,896 KB
testcase_08 AC 332 ms
7,964 KB
testcase_09 AC 219 ms
6,944 KB
testcase_10 AC 358 ms
8,064 KB
testcase_11 AC 347 ms
7,552 KB
testcase_12 AC 360 ms
7,744 KB
testcase_13 AC 405 ms
8,856 KB
testcase_14 AC 348 ms
6,940 KB
testcase_15 AC 365 ms
6,940 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 2 ms
6,940 KB
testcase_20 AC 2 ms
6,940 KB
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 421 ms
11,392 KB
testcase_23 AC 206 ms
6,944 KB
testcase_24 AC 312 ms
9,056 KB
testcase_25 AC 298 ms
10,832 KB
testcase_26 AC 365 ms
12,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        vector<int>v(n);
        for(int i=0;i<n;++i)cin>>v[i];
        bool ok=0;
        if(n%2)ok=1;
        else{
            map<int,int>m;
            for(auto e:v)m[e]++;
            for(auto [s,t]:m)if(t%2){
                ok=1;
                break;
            }
        }
        cout<<(ok?"Alice":"Bob")<<endl;
    }
}
0