結果

問題 No.1716 Bonus Nim
ユーザー hotman78hotman78
提出日時 2021-11-11 14:56:19
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 372 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 2,107 ms
コンパイル使用メモリ 206,584 KB
実行使用メモリ 12,600 KB
最終ジャッジ日時 2023-08-14 20:20:58
合計ジャッジ時間 9,474 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 288 ms
7,028 KB
testcase_05 AC 299 ms
8,376 KB
testcase_06 AC 243 ms
6,504 KB
testcase_07 AC 269 ms
7,916 KB
testcase_08 AC 292 ms
7,892 KB
testcase_09 AC 192 ms
4,544 KB
testcase_10 AC 311 ms
7,976 KB
testcase_11 AC 313 ms
7,228 KB
testcase_12 AC 323 ms
7,364 KB
testcase_13 AC 362 ms
8,720 KB
testcase_14 AC 313 ms
6,040 KB
testcase_15 AC 355 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 372 ms
11,176 KB
testcase_23 AC 170 ms
4,380 KB
testcase_24 AC 279 ms
8,840 KB
testcase_25 AC 258 ms
10,548 KB
testcase_26 AC 312 ms
12,600 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