結果
| 問題 | No.3845 eval("G4M3") |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-11 13:17:38 |
| 結果 |
AC
不安定
|
| 実行時間 | 15 ms / 2,000 ms |
| + 635µs | |
| コード長 | 701 bytes |
| 記録 | |
| コンパイル時間 | 1,492 ms |
| コンパイル使用メモリ | 216,184 KB |
| 実行使用メモリ | 9,920 KB |
| 最終ジャッジ日時 | 2026-12-02 23:30:43 |
| 合計ジャッジ時間 | 4,379 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 49 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin >> T;
while (T--) {
int N;
string S;
cin >> N >> S;
vector<int> A;
for (auto c : S) A.push_back((c - '0') & 1);
bool adj = false;
for (int i = 0; i + 1 < N; ++i) {
if (A[i] && A[i + 1]) {
adj = true;
break;
}
}
bool win;
if (N & 1) {
win = !adj && (A[0] ^ A.back());
} else {
win = adj || A[0] || A.back();
}
cout << (win ? "Alice" : "Bob") << '\n';
}
return 0;
}