結果

問題 No.2239 Friday
ユーザー ohanaohana
提出日時 2023-11-06 17:08:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 304 bytes
コンパイル時間 403 ms
コンパイル使用メモリ 81,828 KB
実行使用メモリ 53,648 KB
最終ジャッジ日時 2023-11-06 17:08:28
合計ジャッジ時間 2,148 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,640 KB
testcase_01 AC 35 ms
53,640 KB
testcase_02 AC 36 ms
53,640 KB
testcase_03 AC 36 ms
53,640 KB
testcase_04 AC 36 ms
53,640 KB
testcase_05 AC 34 ms
53,640 KB
testcase_06 AC 35 ms
53,640 KB
testcase_07 AC 35 ms
53,640 KB
testcase_08 WA -
testcase_09 AC 35 ms
53,640 KB
testcase_10 AC 36 ms
53,640 KB
testcase_11 AC 35 ms
53,640 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 35 ms
53,640 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 35 ms
53,640 KB
testcase_18 WA -
testcase_19 AC 35 ms
53,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b = map(int, input().split())
t = min(a, b) * 2
f = a + b - t
cnt = min(a, b)
if t < f:
    print(abs(t - f))
else:
    tmp = abs(t - f)
    while abs((t - 1) - (f + 1)) < tmp and 0 <= t - 1 and 0 < cnt:
        cnt -= 1
        t, f = t - 1, f + 1
        tmp = abs((t - 1) - (f + 1))
    print(tmp)
0