結果

問題 No.1716 Bonus Nim
ユーザー pockynypockyny
提出日時 2021-10-22 23:32:10
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 469 ms / 2,000 ms
コード長 488 bytes
コンパイル時間 869 ms
コンパイル使用メモリ 80,448 KB
実行使用メモリ 12,112 KB
最終ジャッジ日時 2023-10-24 15:42:07
合計ジャッジ時間 9,266 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,368 KB
testcase_01 AC 2 ms
4,368 KB
testcase_02 AC 2 ms
4,368 KB
testcase_03 AC 2 ms
4,368 KB
testcase_04 AC 354 ms
7,020 KB
testcase_05 AC 360 ms
8,132 KB
testcase_06 AC 355 ms
7,712 KB
testcase_07 AC 361 ms
7,476 KB
testcase_08 AC 369 ms
7,716 KB
testcase_09 AC 371 ms
7,956 KB
testcase_10 AC 369 ms
7,840 KB
testcase_11 AC 354 ms
7,244 KB
testcase_12 AC 366 ms
7,428 KB
testcase_13 AC 408 ms
8,320 KB
testcase_14 AC 361 ms
5,976 KB
testcase_15 AC 364 ms
4,368 KB
testcase_16 AC 2 ms
4,368 KB
testcase_17 AC 3 ms
4,368 KB
testcase_18 AC 2 ms
4,368 KB
testcase_19 AC 2 ms
4,368 KB
testcase_20 AC 2 ms
4,368 KB
testcase_21 AC 2 ms
4,368 KB
testcase_22 AC 461 ms
11,152 KB
testcase_23 AC 451 ms
11,532 KB
testcase_24 AC 442 ms
11,900 KB
testcase_25 AC 469 ms
12,112 KB
testcase_26 AC 441 ms
12,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>

using namespace std;
int main(){
    int t; cin >> t;
    while(t){
        t--;
        int i,n; cin >> n;
        map<int,int> mp;
        for(i=0;i<n;i++){
            int a; cin >> a; mp[a]++;
        }
        if(n&1){
            cout << "Alice\n";
            continue;
        }
        bool f = true;
        for(auto x:mp){
            if(x.second&1) f = false;
        }
        if(f) cout << "Bob\n";
        else cout << "Alice\n";
    }
}
0