結果
問題 | No.1506 Unbalanced Pocky Game |
ユーザー |
👑 ![]() |
提出日時 | 2021-05-14 22:09:36 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 21 ms / 2,000 ms |
コード長 | 590 bytes |
コンパイル時間 | 901 ms |
コンパイル使用メモリ | 76,184 KB |
最終ジャッジ日時 | 2025-01-21 11:14:33 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 63 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; using ll = long long; using ull = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) int main(){ string ansbuf[2] = {"Alice\n","Bob\n"}; int N; cin >> N; vector<int> A(N); rep(i,N) cin >> A[i]; while(A.size()){ if(A.back() >= 2){ cout << ansbuf[0]; return 0; } A.pop_back(); swap(ansbuf[0],ansbuf[1]); } cout << ansbuf[1]; return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_instance;