結果
問題 | No.2666 Decreasing Modulo Nim |
ユーザー |
|
提出日時 | 2024-03-08 21:32:35 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 128 ms / 2,000 ms |
コード長 | 686 bytes |
コンパイル時間 | 653 ms |
コンパイル使用メモリ | 66,820 KB |
最終ジャッジ日時 | 2025-02-20 02:12:04 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 55 |
ソースコード
#include <iostream> using namespace std; int main() { int n, m; cin >> n >> m; int a[200005]; for (int i = 0; i < n; i++) { cin >> a[i]; } int x = 0; for (int i = 0; i < n; i++) { x ^= a[i] / m; } if (x) { cout << "Alice" << endl; return 0; } for (int i = 0; i < n; i++) { a[i] %= m; } for(int k = 0; k <= 30; k++) { int c = 0; for(int i = 0; i < n; i++) { c += a[i] % 2; a[i] /= 2; } if(c % 2) { cout << "Alice" << endl; return 0; } } cout << "Bob" << endl; }