結果

問題 No.2521 Don't be Same
ユーザー Carpenters-CatCarpenters-Cat
提出日時 2023-10-28 00:37:07
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 763 bytes
コンパイル時間 3,631 ms
コンパイル使用メモリ 201,860 KB
実行使用メモリ 66,612 KB
平均クエリ数 0.07
最終ジャッジ日時 2023-10-28 00:37:16
合計ジャッジ時間 6,971 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
24,636 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
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 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
void printQ(int x, int y) {
	if (x == y) {
		cout << "B" << endl;
		return;
	}
	int id = 1;
	if (x < y) {
		id ++;
		swap(x, y);
	}
	if (y == 0) {
		cout << "A " << id << " " << x << endl;
		return;
	}
	int d = x - y;
	if (y & 1) {
		d --;
	} else {
		d ++;
	}
	cout << "A " << id << " " << d << endl;
}
int main() {
	int X, Y;
	cin >> X >> Y;
	if (abs(X - Y) == 1 && (X + Y) & 3 == 3) {
		cout << "Second" << endl;
	} else {
		cout << "First" << endl;
		printQ(X, Y);
	}
	while (true) {
		char c;
		cin >> c;
		if (c == 'C') {
			return 0;
		} else if (c == 'D') {
			return 139;
		} else if (c == 'B') {
			return 139;
		} else {
			int id, d;
			cin >> id >> d;
			((id - 1) ? Y : X) -= d;
		}
		printQ(X, Y);
	}
}
0