結果

問題 No.2521 Don't be Same
ユーザー Carpenters-Cat
提出日時 2023-10-28 00:38:27
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 780 bytes
コンパイル時間 1,827 ms
コンパイル使用メモリ 194,340 KB
最終ジャッジ日時 2025-02-17 16:24:59
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other TLE * 1 -- * 26
権限があれば一括ダウンロードができます

ソースコード

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 0;
		} else if (c == 'B') {
			return 0;
		} else {
			assert(c == 'A');
			int id, d;
			cin >> id >> d;
			((id - 1) ? Y : X) -= d;
		}
		printQ(X, Y);
	}
}
0