結果

問題 No.595 登山
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-01-27 00:06:32
言語 Ruby
(3.3.0)
結果
AC  
実行時間 218 ms / 1,500 ms
コード長 149 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 30,336 KB
最終ジャッジ日時 2024-09-19 16:36:47
合計ジャッジ時間 6,809 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
12,288 KB
testcase_01 AC 83 ms
12,160 KB
testcase_02 AC 86 ms
12,416 KB
testcase_03 AC 87 ms
12,160 KB
testcase_04 AC 210 ms
29,440 KB
testcase_05 AC 124 ms
17,408 KB
testcase_06 AC 196 ms
27,392 KB
testcase_07 AC 98 ms
13,312 KB
testcase_08 AC 102 ms
14,720 KB
testcase_09 AC 194 ms
27,520 KB
testcase_10 AC 160 ms
21,888 KB
testcase_11 AC 154 ms
21,504 KB
testcase_12 AC 94 ms
13,440 KB
testcase_13 AC 121 ms
16,512 KB
testcase_14 AC 210 ms
30,080 KB
testcase_15 AC 210 ms
30,080 KB
testcase_16 AC 211 ms
30,080 KB
testcase_17 AC 213 ms
29,952 KB
testcase_18 AC 211 ms
30,080 KB
testcase_19 AC 216 ms
30,208 KB
testcase_20 AC 213 ms
30,208 KB
testcase_21 AC 215 ms
30,208 KB
testcase_22 AC 215 ms
30,080 KB
testcase_23 AC 215 ms
30,208 KB
testcase_24 AC 85 ms
12,160 KB
testcase_25 AC 87 ms
12,160 KB
testcase_26 AC 218 ms
30,336 KB
testcase_27 AC 213 ms
29,440 KB
testcase_28 AC 211 ms
29,440 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,q=gets.split.map &:to_i
h=gets.split.map &:to_i
y=n*q
a=h[x=0]
h.each{|b|x,y,a=[x+q,y+q,b>a ?x+b-a:x].min,[x+q,y+q,a>b ?y+a-b:y].min,b}
p [x,y].min
0