結果

問題 No.2521 Don't be Same
ユーザー GOTKAKOGOTKAKO
提出日時 2023-10-27 23:57:04
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,290 bytes
コンパイル時間 2,213 ms
コンパイル使用メモリ 202,236 KB
実行使用メモリ 24,636 KB
平均クエリ数 2.86
最終ジャッジ日時 2023-10-27 23:57:12
合計ジャッジ時間 6,530 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#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);}
        }
    }
}
0