結果

問題 No.909 たぴの配置
ユーザー yuruhiyayuruhiya
提出日時 2019-10-20 07:18:42
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 222 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 11,240 KB
実行使用メモリ 65,228 KB
最終ジャッジ日時 2023-09-11 03:30:50
合計ジャッジ時間 16,023 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 84 ms
15,112 KB
testcase_02 AC 82 ms
15,136 KB
testcase_03 AC 84 ms
15,196 KB
testcase_04 AC 83 ms
15,328 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 -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
a=gets.split.map &:to_i
b=gets.split.map &:to_i
mi=10000000000;pos=-1
n.times{|i|
    if mi>a[i]+b[i]
        mi=a[i]+b[i]
        pos=i
    end
}
p mi
(pos+1).times{p 0}
(n-pos).times{p a[pos]}
p a[pos]+b[pos]
0