結果

問題 No.601 Midpoint Erase
ユーザー aaaaaa
提出日時 2018-09-15 10:19:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,454 bytes
コンパイル時間 1,672 ms
コンパイル使用メモリ 102,144 KB
実行使用メモリ 10,908 KB
最終ジャッジ日時 2023-09-22 22:07:15
合計ジャッジ時間 6,091 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>

using namespace std;

int main() {
	int i, j, k;
	int n;
	vector<vector<long>>xy(0, vector<long>(2));

	cin >> n;

	for (i = 0; i < n; i++) {
		long num1, num2;
		cin >> num1 >> num2;
		xy.push_back({ num1,num2 });
	}

	bool flag = false; //falseはアリス
	int cnt = 0;

	while (true)
	{
		bool flag2 = false;


		for (i = 0; i < xy.size(); i++) {
			long numx = xy[i][0];
			long numy = xy[i][1];
			for (j = i+1; j < xy.size(); j++) {
				if (i == j)continue;
				if (abs(xy[j][0] - numx) >= 1 && abs(xy[j][1] - numy) >= 1 && abs(xy[j][0] - numx) % 2 == 0 && abs(xy[j][1] - numy) % 2 == 0) {
					if (flag == false) { flag = true; }
					else if (flag == true) { flag = false; }

					flag2 = true;
					cnt++;

					if (i > j) {
						xy.erase(xy.begin() + i);
						xy.erase(xy.begin() + j);
					}
					else {
						xy.erase(xy.begin() + j);
						xy.erase(xy.begin() + i);
					}
					break;
				}
			}
			//break;
		}

		if (flag2 == false) break;
	}

	if (cnt == 0) {
		cout << "Bob" << endl;
	}
	else if (flag == true) {
		cout << "Alice" << endl;
	}
	else {
		cout << "Bob" << endl;
	}







	getchar();
	getchar();
	return 0;
}
0