結果

問題 No.1935 Water Simulation
ユーザー tassei903tassei903
提出日時 2022-05-14 00:40:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 604 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 76,112 KB
最終ジャッジ日時 2023-09-29 10:51:06
合計ジャッジ時間 4,370 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,364 KB
testcase_01 AC 90 ms
75,800 KB
testcase_02 AC 88 ms
75,968 KB
testcase_03 AC 88 ms
75,880 KB
testcase_04 AC 92 ms
75,984 KB
testcase_05 AC 87 ms
75,888 KB
testcase_06 AC 85 ms
75,744 KB
testcase_07 AC 86 ms
75,892 KB
testcase_08 AC 90 ms
75,968 KB
testcase_09 AC 89 ms
75,904 KB
testcase_10 AC 91 ms
76,004 KB
testcase_11 AC 90 ms
75,988 KB
testcase_12 AC 84 ms
75,768 KB
testcase_13 AC 83 ms
75,748 KB
testcase_14 AC 86 ms
75,992 KB
testcase_15 AC 89 ms
75,768 KB
testcase_16 AC 90 ms
76,040 KB
testcase_17 AC 86 ms
75,836 KB
testcase_18 AC 84 ms
75,916 KB
testcase_19 AC 91 ms
76,048 KB
testcase_20 AC 88 ms
75,924 KB
testcase_21 AC 87 ms
75,912 KB
testcase_22 AC 90 ms
75,964 KB
testcase_23 AC 83 ms
75,780 KB
testcase_24 AC 87 ms
75,792 KB
testcase_25 AC 92 ms
75,912 KB
testcase_26 AC 83 ms
75,872 KB
testcase_27 AC 88 ms
75,968 KB
testcase_28 AC 85 ms
76,112 KB
testcase_29 AC 74 ms
71,196 KB
testcase_30 AC 72 ms
71,072 KB
testcase_31 AC 87 ms
75,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################

a,b,c,d,n = na()
n = min(n % 4 + 1000000, n)

v = [a,b,c,d]
w = [a,0,0,0]

m = 4
for j in range(n):
    x = min(w[j%4],v[(j+1)%4]-w[(j+1)%4]) 
    w[j%4] -= x
    w[(j+1)%4] += x
    #print(*w)
    """if j % 4 == 3:
        print()"""
    
print(*w)
0