結果

問題 No.2239 Friday
ユーザー ohanaohana
提出日時 2023-11-06 17:13:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 288 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 81,844 KB
実行使用メモリ 53,656 KB
最終ジャッジ日時 2023-11-06 17:13:42
合計ジャッジ時間 2,108 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

a, b = map(int, input().split())
t = min(a, b) * 2
f = a + b - t
cnt = f
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) - (f))
    print(tmp)
0