結果
| 問題 | No.3836 Draft Nim |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-11-29 20:44:56 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 1,346 bytes |
| 記録 | |
| コンパイル時間 | 2,587 ms |
| コンパイル使用メモリ | 339,692 KB |
| 実行使用メモリ | 9,908 KB |
| 最終ジャッジ日時 | 2026-11-29 20:45:02 |
| 合計ジャッジ時間 | 6,187 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 WA * 14 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = 1 << 30;
const ll INF = 1LL << 60;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
#define rep(i, s, t) for (ll i = (ll)s; i < (ll)(t); i++)
#define rrep(i, s, t) for (ll i = (ll)(t) - 1; i >= (ll)(s); i--)
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
template <class T1, class T2>
bool chmin(T1& x, T2 y) { return x > y ? (x = y, true) : false; }
template <class T1, class T2>
bool chmax(T1& x, T2 y) { return x < y ? (x = y, true) : false; }
template <class T>
using min_heap = priority_queue<T, vector<T>, greater<T>>;
template <class T>
using max_heap = priority_queue<T>;
void solve() {
ll N, K;
cin >> N >> K;
vector<ll> A(N);
rep(i, 0, N) cin >> A[i];
if (K % 2 == 1) {
rep(i, 0, N) {
if (A[i] % K == 0) {
cout << "Alice\n";
return;
}
}
cout << "Bob\n";
} else {
rep(i, 0, N) {
if (A[i] % (K + 1) != 0) {
cout << "Alice\n";
return;
}
}
cout << "Bob\n";
}
}
int main() {
cin.tie(0)->sync_with_stdio(0);
cout << fixed << setprecision(15);
srand(time(NULL));
int T;
cin >> T;
// T = 1;
while (T--) solve();
}