結果

問題 No.909 たぴの配置
ユーザー wikeakawikeaka
提出日時 2019-10-18 22:02:39
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 301 ms / 3,000 ms
コード長 450 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,968 KB
実行使用メモリ 39,036 KB
最終ジャッジ日時 2023-09-07 23:31:21
合計ジャッジ時間 5,641 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,712 KB
testcase_01 AC 16 ms
7,800 KB
testcase_02 AC 16 ms
7,756 KB
testcase_03 AC 17 ms
7,748 KB
testcase_04 AC 16 ms
7,712 KB
testcase_05 AC 282 ms
37,848 KB
testcase_06 AC 291 ms
39,036 KB
testcase_07 AC 271 ms
36,180 KB
testcase_08 AC 291 ms
37,808 KB
testcase_09 AC 301 ms
38,508 KB
testcase_10 AC 282 ms
36,692 KB
testcase_11 AC 277 ms
37,360 KB
testcase_12 AC 286 ms
38,076 KB
testcase_13 AC 295 ms
37,836 KB
testcase_14 AC 279 ms
36,204 KB
testcase_15 AC 281 ms
35,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys


def input(): return sys.stdin.readline().strip()


def main():
    N = int(input())
    X = [int(x) for x in input().split()]
    Y = [int(y) for y in input().split()]

    min_len = min(map(sum, zip(X, Y)))

    tapis = [0] * (N+2)
    tapis[-1] = min_len
    for i in range(N):
        x, y = X[i], Y[i]
        tapis[i+1] = max(tapis[-1] - y, 0)

    print(min_len)
    print(*tapis, sep="\n")


if __name__ == "__main__":
    main()
0