結果

問題 No.1935 Water Simulation
ユーザー sotanishysotanishy
提出日時 2022-05-13 21:33:23
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 265 bytes
コンパイル時間 280 ms
使用メモリ 75,924 KB
最終ジャッジ日時 2023-02-21 18:45:08
合計ジャッジ時間 4,606 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 88 ms
75,680 KB
testcase_01 AC 88 ms
75,716 KB
testcase_02 AC 88 ms
75,688 KB
testcase_03 AC 89 ms
75,692 KB
testcase_04 AC 90 ms
75,684 KB
testcase_05 AC 89 ms
75,768 KB
testcase_06 AC 88 ms
75,720 KB
testcase_07 AC 87 ms
75,924 KB
testcase_08 AC 87 ms
75,652 KB
testcase_09 AC 89 ms
75,612 KB
testcase_10 AC 87 ms
75,500 KB
testcase_11 AC 88 ms
75,724 KB
testcase_12 AC 88 ms
75,504 KB
testcase_13 AC 89 ms
75,788 KB
testcase_14 AC 90 ms
75,512 KB
testcase_15 AC 89 ms
75,612 KB
testcase_16 AC 89 ms
75,656 KB
testcase_17 AC 88 ms
75,660 KB
testcase_18 AC 90 ms
75,820 KB
testcase_19 AC 89 ms
75,780 KB
testcase_20 AC 90 ms
75,760 KB
testcase_21 AC 88 ms
75,732 KB
testcase_22 AC 90 ms
75,792 KB
testcase_23 AC 90 ms
75,808 KB
testcase_24 AC 88 ms
75,652 KB
testcase_25 AC 87 ms
75,764 KB
testcase_26 AC 87 ms
75,764 KB
testcase_27 AC 88 ms
75,764 KB
testcase_28 AC 89 ms
75,720 KB
testcase_29 AC 86 ms
75,720 KB
testcase_30 AC 87 ms
75,540 KB
testcase_31 AC 89 ms
75,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

V = list(map(int, input().split()))
N = V.pop()
m = min(V)
ans = [0] * 4
for i in range(4):
    V[i] -= m
ans[0] = V[0]
for i in range(min(N, 1000)):
    d = min(V[(i+1)%4] - ans[(i+1)%4], ans[i%4])
    ans[i%4] -= d
    ans[(i+1)%4] += d
ans[N%4] += m
print(*ans)
0