結果
| 問題 | No.2521 Don't be Same |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-27 23:57:04 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,290 bytes |
| 記録 | |
| コンパイル時間 | 1,876 ms |
| コンパイル使用メモリ | 193,248 KB |
| 最終ジャッジ日時 | 2025-02-17 16:17:01 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 12 WA * 15 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int X,Y; cin >> X >> Y;
if(abs(X-Y) != 1 || min(X,Y)%2){
cout << "First" << endl;
while(true){
if(X == Y) cout << "B" << endl;
else if(Y == 0) cout << "A 1 " << X << endl;
else if(X == 0) cout << "A 2 " << Y << endl;
else if(X > Y){cout << "A 1 " << X-(Y+1) << endl; X -= X-(Y+1);}
else{cout << "A 2 " << Y-(X+1) << endl; Y -= Y-(X+1);}
char c; cin >> c;
if(c == 'C' || c == 'D') return 0;
int w,n; cin >> w >> n;
if(w == 1) X -= n;
else Y -= n;
}
}
else{
cout << "Second" << endl;
while(true){
char c; cin >> c;
if(c == 'C' || c == 'D') return 0;
int w,n; cin >> w >> n;
if(w == 1) X -= n;
else Y -= n;
if(X == Y) cout << "B" << endl;
else if(Y == 0) cout << "A 1 " << X << endl;
else if(X == 0) cout << "A 2 " << Y << endl;
else if(X > Y){cout << "A 1 " << X-(Y+1) << endl; X -= X-(Y+1);}
else{cout << "A 2 " << Y-(X+1) << endl; Y -= Y-(X+1);}
}
}
}