結果

問題 No.1935 Water Simulation
ユーザー ShirotsumeShirotsume
提出日時 2022-05-13 23:01:00
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 387 bytes
コンパイル時間 975 ms
使用メモリ 80,704 KB
最終ジャッジ日時 2023-02-21 18:54:13
合計ジャッジ時間 5,600 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 86 ms
75,728 KB
testcase_01 AC 127 ms
80,624 KB
testcase_02 AC 124 ms
80,528 KB
testcase_03 AC 124 ms
80,420 KB
testcase_04 AC 131 ms
80,424 KB
testcase_05 AC 123 ms
80,644 KB
testcase_06 AC 123 ms
80,300 KB
testcase_07 AC 122 ms
80,424 KB
testcase_08 AC 130 ms
80,480 KB
testcase_09 AC 130 ms
80,696 KB
testcase_10 AC 129 ms
80,364 KB
testcase_11 AC 129 ms
80,544 KB
testcase_12 AC 112 ms
80,344 KB
testcase_13 AC 110 ms
80,388 KB
testcase_14 AC 110 ms
80,520 KB
testcase_15 AC 128 ms
80,464 KB
testcase_16 AC 129 ms
80,328 KB
testcase_17 AC 122 ms
80,456 KB
testcase_18 AC 111 ms
80,636 KB
testcase_19 AC 130 ms
80,704 KB
testcase_20 AC 120 ms
80,576 KB
testcase_21 AC 122 ms
80,520 KB
testcase_22 AC 128 ms
80,340 KB
testcase_23 AC 108 ms
80,344 KB
testcase_24 AC 122 ms
80,344 KB
testcase_25 AC 128 ms
80,540 KB
testcase_26 AC 108 ms
80,536 KB
testcase_27 AC 121 ms
80,592 KB
testcase_28 AC 121 ms
80,532 KB
testcase_29 AC 84 ms
75,820 KB
testcase_30 AC 84 ms
75,660 KB
testcase_31 AC 120 ms
80,412 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