結果
問題 |
No.1506 Unbalanced Pocky Game
|
ユーザー |
|
提出日時 | 2022-11-10 01:56:28 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 21 ms / 2,000 ms |
コード長 | 341 bytes |
コンパイル時間 | 1,727 ms |
コンパイル使用メモリ | 192,736 KB |
最終ジャッジ日時 | 2025-02-08 19:29:14 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 63 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin>>N; vector<int>A(N); for(int &i:A)cin>>i; int ans[2]={1,0}; for(int i=1;i<N;i++){ if(A[i]==1){ swap(ans[0],ans[1]); }else{ ans[0]=1,ans[1]=0; } } cout<<(ans[0]?"Alice\n":"Bob\n"); }