結果

問題 No.2465 Dilated Water Simulation
ユーザー gbrsofygbrsofy
提出日時 2023-11-07 18:27:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 864 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 11,892 KB
実行使用メモリ 29,340 KB
最終ジャッジ日時 2023-11-07 18:27:57
合計ジャッジ時間 18,400 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,224 KB
testcase_01 AC 28 ms
10,224 KB
testcase_02 AC 28 ms
10,224 KB
testcase_03 AC 29 ms
10,224 KB
testcase_04 AC 28 ms
10,224 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

s = int(input())
t = input().split(" ")
u = int(input())

a = u % s
b = u // s
res = [0]*s
res_t=[0]*s
res[0]=int(t[0])
for x in range(b):
    for i in range(s):
        t_b = int(t[(i+1)%s])
            
        if res[i]+res[(i+1)%s] > t_b:
            res[i] = res[i]+res[(i+1)%s] - t_b
            res[(i+1)%s] = t_b
        else:
            res[(i+1)%s] = res[i] + res[(i+1)%s]
            res[i] = 0
                
        #print(res,res_t)
    if res_t == res:
        break
    res_t = res
    #print(res)
if a !=0:
    for i in range(a):
        t_a = int(t[i])
        t_b = int(t[(i+1)%s])
            
        if res[i]+res[(i+1)%s] > t_b:
            res[i] = res[i]+res[(i+1)%s] - t_b
            res[(i+1)%s] = t_b
        else:
            res[(i+1)%s] = res[i] + res[(i+1)%s]
            res[i] = 0
            
        #print(res)
print(*res)
0