結果

問題 No.909 たぴの配置
ユーザー yuruhiyayuruhiya
提出日時 2019-10-20 07:26:26
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 275 bytes
コンパイル時間 377 ms
コンパイル使用メモリ 11,204 KB
実行使用メモリ 65,104 KB
最終ジャッジ日時 2023-09-11 03:38:04
合計ジャッジ時間 15,525 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,252 KB
testcase_01 AC 81 ms
15,048 KB
testcase_02 WA -
testcase_03 AC 81 ms
15,284 KB
testcase_04 AC 80 ms
15,240 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 807 ms
64,932 KB
testcase_11 AC 787 ms
64,956 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 811 ms
64,780 KB
testcase_15 AC 814 ms
65,104 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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
p 0
n.times{|i|
    if a[i]<b[i]
        p a[i]
    else
        p a[pos]+b[pos]-b[i]
    end
}
p a[pos]+b[pos]
0