結果

問題 No.1446 ハンバーグと納豆ごはん
ユーザー lemonlemon
提出日時 2021-03-31 14:28:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 367 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 87,028 KB
実行使用メモリ 71,492 KB
最終ジャッジ日時 2023-08-21 09:03:23
合計ジャッジ時間 4,306 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 72 ms
71,464 KB
testcase_02 AC 73 ms
71,488 KB
testcase_03 WA -
testcase_04 AC 78 ms
71,336 KB
testcase_05 AC 75 ms
71,344 KB
testcase_06 AC 75 ms
71,280 KB
testcase_07 AC 73 ms
71,480 KB
testcase_08 AC 73 ms
71,004 KB
testcase_09 AC 73 ms
71,088 KB
testcase_10 WA -
testcase_11 AC 73 ms
71,088 KB
testcase_12 AC 73 ms
71,476 KB
testcase_13 AC 73 ms
71,232 KB
testcase_14 AC 72 ms
71,232 KB
testcase_15 AC 72 ms
71,164 KB
testcase_16 AC 72 ms
71,020 KB
testcase_17 AC 74 ms
71,340 KB
testcase_18 AC 72 ms
71,376 KB
testcase_19 AC 72 ms
71,452 KB
testcase_20 AC 72 ms
71,120 KB
testcase_21 AC 73 ms
71,024 KB
testcase_22 AC 73 ms
71,280 KB
testcase_23 AC 74 ms
71,288 KB
testcase_24 AC 74 ms
71,000 KB
testcase_25 AC 75 ms
71,284 KB
testcase_26 AC 74 ms
71,216 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 74 ms
71,068 KB
testcase_30 AC 73 ms
71,092 KB
testcase_31 AC 73 ms
71,004 KB
testcase_32 AC 73 ms
71,372 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 74 ms
71,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, itertools
 
sys.setrecursionlimit(500005)
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

a, b, n, m = na()

ans = 0

if a < b:
    c = (b-a) // m
    a += c
    b -= m * (c + 1)
        
elif a > b:
    c = (a-b) // n
    a -= n * (c + 1)
    b += c

print(max(a, b))
0