結果

問題 No.1935 Water Simulation
ユーザー Akijin_007Akijin_007
提出日時 2022-05-13 21:37:43
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 632 bytes
コンパイル時間 587 ms
コンパイル使用メモリ 87,260 KB
実行使用メモリ 71,576 KB
最終ジャッジ日時 2023-09-29 09:54:16
合計ジャッジ時間 4,652 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 74 ms
71,260 KB
testcase_02 AC 74 ms
71,420 KB
testcase_03 AC 73 ms
71,232 KB
testcase_04 AC 74 ms
71,472 KB
testcase_05 AC 72 ms
71,296 KB
testcase_06 AC 74 ms
71,300 KB
testcase_07 AC 73 ms
71,408 KB
testcase_08 AC 73 ms
71,372 KB
testcase_09 AC 74 ms
71,472 KB
testcase_10 AC 73 ms
71,248 KB
testcase_11 AC 73 ms
71,168 KB
testcase_12 AC 73 ms
71,184 KB
testcase_13 AC 73 ms
71,212 KB
testcase_14 AC 72 ms
71,576 KB
testcase_15 AC 73 ms
71,172 KB
testcase_16 AC 71 ms
71,312 KB
testcase_17 AC 72 ms
71,344 KB
testcase_18 AC 71 ms
71,224 KB
testcase_19 AC 73 ms
71,180 KB
testcase_20 AC 72 ms
71,376 KB
testcase_21 AC 72 ms
71,180 KB
testcase_22 AC 72 ms
71,332 KB
testcase_23 AC 73 ms
71,180 KB
testcase_24 AC 73 ms
71,216 KB
testcase_25 AC 72 ms
71,312 KB
testcase_26 AC 72 ms
71,344 KB
testcase_27 AC 72 ms
71,292 KB
testcase_28 AC 72 ms
71,444 KB
testcase_29 AC 73 ms
71,316 KB
testcase_30 AC 73 ms
71,380 KB
testcase_31 AC 73 ms
71,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

v = list(map(int, input().split()))

n = v.pop()

a, b = divmod(n, 4)

ans = [0] * 4

t = 0

w = [v[0]] + [0] * 3

# n = 2

while t < n:
    nv = list(w)
    for i in range(4):
        s = min(v[(i+1)%4] - nv[(i+1)%4], nv[i])
        nv[i] -= s
        nv[(i+1)%4] += s
        # print(nv)

    t += 1

    if nv == w:
        break
    w = list(nv)

if t == n:
    ans = list(w)
else:
    for i in range(b):
        s = min(v[(i+1)%4] - w[(i+1)%4], w[i])
        w[i] -= s
        w[(i+1)%4] += s
    ans = list(w)

print(" ".join(str(x) for x in ans))



0