結果

問題 No.1935 Water Simulation
ユーザー hir355hir355
提出日時 2022-05-13 21:31:52
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 202 bytes
コンパイル時間 729 ms
使用メモリ 80,848 KB
最終ジャッジ日時 2023-02-21 18:45:03
合計ジャッジ時間 5,087 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 90 ms
75,724 KB
testcase_01 AC 96 ms
80,364 KB
testcase_02 AC 95 ms
80,668 KB
testcase_03 AC 96 ms
80,848 KB
testcase_04 AC 98 ms
80,804 KB
testcase_05 AC 97 ms
80,492 KB
testcase_06 AC 96 ms
80,284 KB
testcase_07 AC 94 ms
80,648 KB
testcase_08 AC 96 ms
80,540 KB
testcase_09 AC 95 ms
80,340 KB
testcase_10 AC 98 ms
80,300 KB
testcase_11 AC 97 ms
80,444 KB
testcase_12 AC 93 ms
80,388 KB
testcase_13 AC 94 ms
80,240 KB
testcase_14 AC 96 ms
80,512 KB
testcase_15 AC 98 ms
80,572 KB
testcase_16 AC 97 ms
80,308 KB
testcase_17 AC 96 ms
80,484 KB
testcase_18 AC 95 ms
80,260 KB
testcase_19 AC 95 ms
80,728 KB
testcase_20 AC 92 ms
80,416 KB
testcase_21 AC 93 ms
80,256 KB
testcase_22 AC 97 ms
80,344 KB
testcase_23 AC 95 ms
80,752 KB
testcase_24 AC 97 ms
80,380 KB
testcase_25 AC 98 ms
80,780 KB
testcase_26 AC 96 ms
80,360 KB
testcase_27 AC 98 ms
80,368 KB
testcase_28 AC 97 ms
80,604 KB
testcase_29 AC 90 ms
75,680 KB
testcase_30 AC 90 ms
75,712 KB
testcase_31 AC 96 ms
80,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

*a, n = map(int, input().split())
x = [0] * 4
x[0] = a[0]
for i in range(min(n, 4000 + n % 4)):
    t = min(x[i % 4], a[(i + 1) % 4] - x[(i + 1) % 4])
    x[i % 4] -= t
    x[(i + 1) % 4] += t
print(*x)
0