結果
問題 | No.2278 Time Bomb Game 2 |
ユーザー |
|
提出日時 | 2023-04-21 23:01:14 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,169 bytes |
コンパイル時間 | 2,935 ms |
コンパイル使用メモリ | 219,232 KB |
最終ジャッジ日時 | 2025-02-12 12:25:20 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 69 WA * 1 |
ソースコード
#ifdef LOCAL#include <local.hpp>#else#pragma GCC optimize("O3,unroll-loops")#pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2")#include <bits/stdc++.h>#define debug(...) ((void)0)#define postprocess(...) ((void)0)#endifusing namespace std;using ll = long long;using ld = long double;void solve([[maybe_unused]] int test) {int N, K, T;cin >> N >> K >> T;K--;char c[N];for (int i = 0; i < N; i++) {cin >> c[i];}bool A[N];for (int i = 0; i < N; i++) {A[i] = c[i] == 'A';}int l = K;while (0 < l && A[l - 1] == A[l]) l--;int r = K;while (r < N - 1 && A[r + 1] == A[r]) r++;bool win = false;if (l != 0) {int t = T - abs(K - l);if (t > 0 && t % 2 == 1) win = true;}if (r != N - 1) {int t = T - abs(K - r);if (t > 0 && t % 2 == 1) win = true;}cout << (win ? (A[K] ? "Alice" : "Bob") : (A[K] ? "Bob" : "Alice")) << endl;}int main() {ios::sync_with_stdio(false);cin.tie(nullptr);int t = 1;// cin >> t;for (int i = 1; i <= t; i++) {solve(i);}postprocess();}