結果

問題 No.601 Midpoint Erase
ユーザー ohreitetsuohreitetsu
提出日時 2018-05-16 20:35:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 658 bytes
コンパイル時間 546 ms
コンパイル使用メモリ 69,304 KB
実行使用メモリ 4,568 KB
最終ジャッジ日時 2023-09-10 22:22:10
合計ジャッジ時間 2,483 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 53 ms
4,376 KB
testcase_05 AC 38 ms
4,376 KB
testcase_06 AC 22 ms
4,376 KB
testcase_07 AC 51 ms
4,380 KB
testcase_08 AC 43 ms
4,376 KB
testcase_09 WA -
testcase_10 AC 12 ms
4,380 KB
testcase_11 AC 72 ms
4,380 KB
testcase_12 WA -
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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 && (x[i]+x[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;
}
0