結果

問題 No.2239 Friday
ユーザー n_na
提出日時 2023-03-11 18:23:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 284 bytes
コンパイル時間 756 ms
コンパイル使用メモリ 82,084 KB
実行使用メモリ 53,532 KB
最終ジャッジ日時 2024-09-18 06:40:21
合計ジャッジ時間 1,708 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B = map(int,input().split())

ok = 0
ng = 0
while (A > 0) and (B > 0):
    ng += 2
    A -= 1
    B -= 1
    if A+B < 2:
        break
    if A > B:
        A -= 2
    elif B > A:
        B -= 2
    else:
        A -= 1
        B -= 1
    ok += 2
ok += A
ok += B

print(abs(ok-ng))
0