結果
問題 | No.601 Midpoint Erase |
ユーザー |
|
提出日時 | 2018-05-16 20:38:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 82 ms / 2,000 ms |
コード長 | 658 bytes |
コンパイル時間 | 617 ms |
コンパイル使用メモリ | 69,876 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 13:20:52 |
合計ジャッジ時間 | 2,063 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
#include <iostream> #include <vector> using namespace std; int main(int argc, char* argv[]) { int N; cin>>N; vector<int> x(N),y(N); vector<int> flag(N,false); int i,j; for (i=0;i<N;i++){ cin>>x[i]>>y[i]; } bool bAliceOK=false; bool loop=true; while(loop){ loop=false; for (i=0;i<N;i++){ if (flag[i]){ continue; } for (j=i+1;j<N;j++){ if (flag[j]){ continue; } if ((x[i]+x[j])%2==0 && (y[i]+y[j])%2==0){ flag[i]=true; flag[j]=true; bAliceOK=bAliceOK==true?false:true; loop=true; break; } } } } if (bAliceOK){ cout<<"Alice"<<endl; }else{ cout<<"Bob"<<endl; } return 0; }