結果

問題 No.595 登山
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-01-29 09:44:10
言語 Ruby
(3.3.0)
結果
AC  
実行時間 245 ms / 1,500 ms
コード長 148 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 36,352 KB
最終ジャッジ日時 2024-04-17 09:30:41
合計ジャッジ時間 7,192 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
12,160 KB
testcase_01 AC 84 ms
12,032 KB
testcase_02 AC 88 ms
12,032 KB
testcase_03 AC 86 ms
12,160 KB
testcase_04 AC 240 ms
34,560 KB
testcase_05 AC 132 ms
18,176 KB
testcase_06 AC 221 ms
31,488 KB
testcase_07 AC 98 ms
13,568 KB
testcase_08 AC 104 ms
14,848 KB
testcase_09 AC 220 ms
31,744 KB
testcase_10 AC 166 ms
25,216 KB
testcase_11 AC 162 ms
23,808 KB
testcase_12 AC 96 ms
13,312 KB
testcase_13 AC 124 ms
17,536 KB
testcase_14 AC 238 ms
35,072 KB
testcase_15 AC 238 ms
35,328 KB
testcase_16 AC 241 ms
35,200 KB
testcase_17 AC 238 ms
35,200 KB
testcase_18 AC 236 ms
35,072 KB
testcase_19 AC 245 ms
36,224 KB
testcase_20 AC 245 ms
36,224 KB
testcase_21 AC 241 ms
36,224 KB
testcase_22 AC 241 ms
36,096 KB
testcase_23 AC 243 ms
36,352 KB
testcase_24 AC 86 ms
12,160 KB
testcase_25 AC 84 ms
12,160 KB
testcase_26 AC 245 ms
36,224 KB
testcase_27 AC 245 ms
35,584 KB
testcase_28 AC 238 ms
35,712 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.map{|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