結果

問題 No.1935 Water Simulation
ユーザー KudeKude
提出日時 2022-05-13 21:41:15
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 278 ms
使用メモリ 75,800 KB
最終ジャッジ日時 2023-02-21 18:46:21
合計ジャッジ時間 4,688 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 86 ms
75,448 KB
testcase_01 AC 86 ms
75,736 KB
testcase_02 AC 86 ms
75,524 KB
testcase_03 AC 86 ms
75,484 KB
testcase_04 AC 86 ms
75,448 KB
testcase_05 AC 86 ms
75,720 KB
testcase_06 AC 87 ms
75,408 KB
testcase_07 AC 86 ms
75,396 KB
testcase_08 AC 86 ms
75,396 KB
testcase_09 AC 84 ms
75,672 KB
testcase_10 AC 84 ms
75,716 KB
testcase_11 AC 85 ms
75,756 KB
testcase_12 AC 85 ms
75,512 KB
testcase_13 AC 87 ms
75,424 KB
testcase_14 AC 84 ms
75,632 KB
testcase_15 AC 84 ms
75,460 KB
testcase_16 AC 86 ms
75,704 KB
testcase_17 AC 87 ms
75,388 KB
testcase_18 AC 87 ms
75,776 KB
testcase_19 AC 84 ms
75,512 KB
testcase_20 AC 86 ms
75,716 KB
testcase_21 AC 85 ms
75,720 KB
testcase_22 AC 86 ms
75,408 KB
testcase_23 AC 86 ms
75,700 KB
testcase_24 AC 86 ms
75,800 KB
testcase_25 AC 87 ms
75,712 KB
testcase_26 AC 86 ms
75,724 KB
testcase_27 AC 87 ms
75,792 KB
testcase_28 AC 87 ms
75,800 KB
testcase_29 AC 87 ms
75,616 KB
testcase_30 AC 88 ms
75,740 KB
testcase_31 AC 88 ms
75,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

*v, n = map(int, input().split())
d = [v[0], 0, 0, 0]
while n:
    pd = d[:]
    for i in range(4):
        if n <= 0:
            break
        t = min(d[i], v[(i+1) % 4] - d[(i+1) % 4])
        d[i] -= t
        d[(i+1) % 4] += t
        n -= 1
    if d == pd:
        n %= 4
print(*d)
0