結果

問題 No.909 たぴの配置
ユーザー はむ吉🐹はむ吉🐹
提出日時 2019-10-18 21:36:50
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 266 ms / 3,000 ms
コード長 439 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 11,016 KB
実行使用メモリ 39,128 KB
最終ジャッジ日時 2023-09-07 21:33:37
合計ジャッジ時間 5,652 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,948 KB
testcase_01 AC 14 ms
7,948 KB
testcase_02 AC 15 ms
7,948 KB
testcase_03 AC 14 ms
7,844 KB
testcase_04 AC 15 ms
7,844 KB
testcase_05 AC 241 ms
37,952 KB
testcase_06 AC 253 ms
39,128 KB
testcase_07 AC 235 ms
36,300 KB
testcase_08 AC 251 ms
38,128 KB
testcase_09 AC 260 ms
38,688 KB
testcase_10 AC 245 ms
37,732 KB
testcase_11 AC 233 ms
36,144 KB
testcase_12 AC 248 ms
38,192 KB
testcase_13 AC 266 ms
37,912 KB
testcase_14 AC 249 ms
36,168 KB
testcase_15 AC 246 ms
36,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3


def arrange(n, xs, ys):
    width = min(x + y for x, y in zip(xs, ys))
    zs = [0]
    for x in xs:
        zs.append(min(x, width))
    zs.append(width)
    return width, zs


def main():
    n = int(input())
    xs = [int(z) for z in input().split()]
    ys = [int(z) for z in input().split()]
    width, zs = arrange(n, xs, ys)
    print(width)
    print(*zs, sep="\n")


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