結果

問題 No.601 Midpoint Erase
ユーザー GBGB
提出日時 2018-12-20 13:18:10
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 590 bytes
コンパイル時間 661 ms
コンパイル使用メモリ 68,236 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-26 00:53:44
合計ジャッジ時間 2,735 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 51 ms
4,348 KB
testcase_04 AC 58 ms
4,348 KB
testcase_05 AC 42 ms
4,348 KB
testcase_06 AC 24 ms
4,348 KB
testcase_07 AC 55 ms
4,348 KB
testcase_08 AC 47 ms
4,348 KB
testcase_09 AC 57 ms
4,348 KB
testcase_10 AC 14 ms
4,348 KB
testcase_11 AC 80 ms
4,348 KB
testcase_12 AC 37 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 1 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>

using namespace std;

struct  Point
{
	int x, y;
};

int main() {

	int n = 0;
	int bunrui[4] = {0,0,0,0};
	cin >> n;
	for (int i = 0;i < n;i++) {
		int x, y;
		cin >> x >> y;
		if (x % 2 != 0 && y % 2 != 0) bunrui[0]++;
		else if (x % 2 == 0 && y % 2 != 0)bunrui[1]++;
		else if (x % 2 == 0 && y % 2 == 0)bunrui[2]++;
		else bunrui[3]++;
	}
	
	int sum = 0;
	for (int i = 0;i < 4;i++) {
		if (bunrui[i] >= 2)bunrui[i] /=2;
		else bunrui[i] = 0;
		sum += bunrui[i];
	}
	if (sum % 2 != 0)cout << "Alice" << endl;
	else cout << "Bob" << endl;

	return 0;
}
0