結果

問題 No.909 たぴの配置
ユーザー yuruhiyayuruhiya
提出日時 2019-10-20 07:27:39
言語 Ruby
(3.3.0)
結果
AC  
実行時間 910 ms / 3,000 ms
コード長 296 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 11,300 KB
実行使用メモリ 65,132 KB
最終ジャッジ日時 2023-09-11 03:39:14
合計ジャッジ時間 13,895 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
15,100 KB
testcase_01 AC 84 ms
15,172 KB
testcase_02 AC 86 ms
15,264 KB
testcase_03 AC 84 ms
15,076 KB
testcase_04 AC 83 ms
15,120 KB
testcase_05 AC 889 ms
64,232 KB
testcase_06 AC 907 ms
64,284 KB
testcase_07 AC 846 ms
64,660 KB
testcase_08 AC 882 ms
64,336 KB
testcase_09 AC 891 ms
64,272 KB
testcase_10 AC 849 ms
64,752 KB
testcase_11 AC 861 ms
65,000 KB
testcase_12 AC 886 ms
64,228 KB
testcase_13 AC 910 ms
64,076 KB
testcase_14 AC 853 ms
64,864 KB
testcase_15 AC 841 ms
65,132 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
pl=1000000
p pl
n.times{|i|
    if a[i]<b[i]
        p a[i]+pl
    else
        p a[pos]+b[pos]-b[i]+pl
    end
}
p a[pos]+b[pos]+pl
0