結果

問題 No.909 たぴの配置
ユーザー yuly3yuly3
提出日時 2020-01-10 11:27:31
言語 Nim
(2.0.2)
結果
AC  
実行時間 72 ms / 3,000 ms
コード長 500 bytes
コンパイル時間 3,323 ms
コンパイル使用メモリ 65,408 KB
実行使用メモリ 31,872 KB
最終ジャッジ日時 2024-05-03 01:42:11
合計ジャッジ時間 5,774 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 70 ms
28,160 KB
testcase_06 AC 68 ms
29,824 KB
testcase_07 AC 64 ms
27,520 KB
testcase_08 AC 68 ms
29,952 KB
testcase_09 AC 72 ms
31,872 KB
testcase_10 AC 67 ms
29,568 KB
testcase_11 AC 65 ms
27,520 KB
testcase_12 AC 67 ms
26,752 KB
testcase_13 AC 69 ms
27,776 KB
testcase_14 AC 65 ms
29,440 KB
testcase_15 AC 67 ms
27,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils, sequtils, math

proc solve() =
    var
        N = stdin.readLine.parseInt
        X = stdin.readLine.split.map(parseInt)
        Y = stdin.readLine.split.map(parseInt)
    
    var d_max = 10 ^ 7
    for i in 0..<N:
        d_max = min(d_max, X[i] + Y[i])
    
    var ans = newSeq[int](N+2)
    ans[^1] = d_max
    for i in 0..<N:
        if X[i] < d_max:
            ans[i+1] = X[i]
        else:
            ans[i+1] = d_max
    
    echo d_max
    echo join(ans, "\n")

solve()
0