結果
問題 | No.1716 Bonus Nim |
ユーザー |
![]() |
提出日時 | 2021-06-04 23:34:10 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 370 ms / 2,000 ms |
コード長 | 409 bytes |
コンパイル時間 | 2,231 ms |
コンパイル使用メモリ | 197,808 KB |
最終ジャッジ日時 | 2025-01-22 03:19:49 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 26 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main() {int t;cin >> t;while(t--) {int n;cin >> n;vector<int> a(n);for(auto &v : a) cin >> v;sort(a.begin(), a.end());if(n & 1) {cout << "Alice\n";} else {bool notpair = 0;for(int i = 0; i < n / 2; i++) {if(a[i * 2] != a[i * 2 + 1]) notpair = 1;}cout << (notpair ? "Alice\n" : "Bob\n");}}return 0;}