結果

問題 No.1935 Water Simulation
ユーザー Issei MoriIssei Mori
提出日時 2022-05-13 21:51:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 534 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 86,536 KB
実行使用メモリ 71,260 KB
最終ジャッジ日時 2023-09-29 07:00:42
合計ジャッジ時間 3,689 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 70 ms
71,092 KB
testcase_05 AC 66 ms
71,008 KB
testcase_06 AC 66 ms
70,840 KB
testcase_07 AC 70 ms
71,028 KB
testcase_08 AC 69 ms
71,260 KB
testcase_09 AC 66 ms
70,960 KB
testcase_10 AC 68 ms
70,840 KB
testcase_11 AC 72 ms
70,928 KB
testcase_12 AC 67 ms
71,084 KB
testcase_13 AC 67 ms
70,896 KB
testcase_14 AC 67 ms
71,088 KB
testcase_15 AC 65 ms
70,960 KB
testcase_16 AC 67 ms
71,028 KB
testcase_17 AC 66 ms
71,088 KB
testcase_18 AC 66 ms
71,012 KB
testcase_19 AC 67 ms
70,860 KB
testcase_20 AC 66 ms
70,960 KB
testcase_21 AC 67 ms
71,096 KB
testcase_22 AC 67 ms
70,976 KB
testcase_23 AC 67 ms
70,904 KB
testcase_24 AC 67 ms
70,868 KB
testcase_25 AC 66 ms
71,092 KB
testcase_26 AC 66 ms
70,812 KB
testcase_27 AC 68 ms
70,844 KB
testcase_28 AC 67 ms
70,900 KB
testcase_29 AC 65 ms
71,204 KB
testcase_30 AC 67 ms
70,924 KB
testcase_31 AC 66 ms
70,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 7)


def get_list(ty=int):
    return list(map(ty, input().split()))


def get_int():
    return int(input())


def get_str():
    return input()


V1, V2, V3, V4, N = get_list()

V = [V1, V2, V3, V4]

C = [0] * 4
C[0] = V[0]
history = set([])
for n in range(N):
    a = n % 4
    b = (n + 1) % 4
    diff = min(V[b] - C[b], C[a])
    C[a] -= diff
    C[b] += diff
    if tuple(C) in history and (n + 1) % 4 == N % 4:
        break
    history.add(tuple(C))

print(" ".join(str(c) for c in C))
0