結果

問題 No.2521 Don't be Same
ユーザー ShirotsumeShirotsume
提出日時 2023-10-21 02:23:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 714 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 81,732 KB
実行使用メモリ 82,900 KB
平均クエリ数 2.00
最終ジャッジ日時 2023-10-21 02:24:14
合計ジャッジ時間 5,986 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

X, Y = map(int,input().split())
if max(X, Y) - min(X, Y) == 1 and min(X, Y) % 2 == 1:
    print('Second', flush=True)
    i = 1
else:
    print('First', flush=True)
    i = 0
    
import random
for itr in range(10 ** 6):
    if X == Y == 0:
        exit()
    if itr % 2 == i:
        if random.random() < 0.5:
            x = random.randint(1, X)
            print('A', 1, x)
            X -= x
        else:
            x = random.randint(1, Y)
            print('A', 1, x)
            Y -= x


    else:
        Op = input().split()
        if Op[0] == 'A':
            if Op[1] == '1':
                X -= int(Op[2])
            else:
                Y -= int(Op[2])
        else:
            exit()

        
0