結果

問題 No.1935 Water Simulation
ユーザー 👑 KazunKazun
提出日時 2022-05-13 21:28:47
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 256 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 76,004 KB
最終ジャッジ日時 2023-09-29 09:56:39
合計ジャッジ時間 4,254 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,372 KB
testcase_01 AC 81 ms
75,752 KB
testcase_02 AC 81 ms
75,480 KB
testcase_03 AC 80 ms
75,828 KB
testcase_04 AC 82 ms
75,716 KB
testcase_05 AC 78 ms
75,712 KB
testcase_06 AC 77 ms
75,720 KB
testcase_07 AC 78 ms
75,684 KB
testcase_08 AC 81 ms
75,856 KB
testcase_09 AC 79 ms
75,844 KB
testcase_10 AC 81 ms
76,004 KB
testcase_11 AC 81 ms
75,804 KB
testcase_12 AC 78 ms
75,796 KB
testcase_13 AC 78 ms
75,644 KB
testcase_14 AC 77 ms
75,332 KB
testcase_15 AC 82 ms
75,832 KB
testcase_16 AC 81 ms
75,680 KB
testcase_17 AC 80 ms
75,840 KB
testcase_18 AC 78 ms
75,468 KB
testcase_19 AC 80 ms
75,696 KB
testcase_20 AC 80 ms
75,472 KB
testcase_21 AC 82 ms
75,888 KB
testcase_22 AC 80 ms
75,720 KB
testcase_23 AC 77 ms
75,564 KB
testcase_24 AC 79 ms
75,844 KB
testcase_25 AC 79 ms
75,756 KB
testcase_26 AC 77 ms
75,532 KB
testcase_27 AC 81 ms
75,704 KB
testcase_28 AC 80 ms
75,800 KB
testcase_29 AC 75 ms
71,440 KB
testcase_30 AC 74 ms
71,236 KB
testcase_31 AC 81 ms
75,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(V,N):
    W=[V[0],0,0,0]

    N=min(N,N%4+10**5)
    for i in range(N):
        i%=4
        j=(i+1)%4
        w=min(W[i],V[j]-W[j])
        W[i]-=w; W[j]+=w
    return W

V1,V2,V3,V4,N=map(int,input().split())
V=[V1,V2,V3,V4]
print(*solve(V,N))
0