結果

問題 No.1935 Water Simulation
ユーザー ShirotsumeShirotsume
提出日時 2022-05-13 23:01:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 387 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 76,224 KB
最終ジャッジ日時 2023-09-29 10:03:25
合計ジャッジ時間 5,233 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,192 KB
testcase_01 AC 120 ms
76,224 KB
testcase_02 AC 116 ms
75,956 KB
testcase_03 AC 114 ms
76,164 KB
testcase_04 AC 121 ms
75,916 KB
testcase_05 AC 117 ms
76,072 KB
testcase_06 AC 115 ms
75,916 KB
testcase_07 AC 112 ms
75,956 KB
testcase_08 AC 121 ms
75,980 KB
testcase_09 AC 123 ms
76,080 KB
testcase_10 AC 123 ms
75,880 KB
testcase_11 AC 123 ms
76,028 KB
testcase_12 AC 105 ms
75,880 KB
testcase_13 AC 106 ms
75,880 KB
testcase_14 AC 103 ms
75,884 KB
testcase_15 AC 125 ms
76,016 KB
testcase_16 AC 122 ms
76,024 KB
testcase_17 AC 112 ms
75,876 KB
testcase_18 AC 103 ms
76,028 KB
testcase_19 AC 124 ms
76,080 KB
testcase_20 AC 114 ms
76,104 KB
testcase_21 AC 113 ms
76,136 KB
testcase_22 AC 123 ms
76,176 KB
testcase_23 AC 104 ms
75,952 KB
testcase_24 AC 114 ms
76,140 KB
testcase_25 AC 124 ms
76,020 KB
testcase_26 AC 104 ms
75,888 KB
testcase_27 AC 114 ms
75,780 KB
testcase_28 AC 113 ms
76,140 KB
testcase_29 AC 75 ms
71,188 KB
testcase_30 AC 77 ms
71,564 KB
testcase_31 AC 113 ms
75,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
INF = 2 ** 63 - 1
mod = 998244353


v = li()
n = v.pop()
a = [0] * 4
a[0] = v[0]
for i in range(min(n, 4 * 10 ** 6 + n % 4)):
    temp = min(a[i % 4], v[(i + 1) % 4] - a[(i + 1) % 4])
    a[i % 4] -= temp
    a[(i + 1) % 4] += temp
print(*a)
0