結果

問題 No.595 登山
ユーザー yuruhiyayuruhiya
提出日時 2021-07-23 11:55:25
言語 Ruby
(3.2.2)
結果
AC  
実行時間 265 ms / 1,500 ms
コード長 124 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 11,280 KB
実行使用メモリ 52,288 KB
最終ジャッジ日時 2023-09-25 10:08:03
合計ジャッジ時間 7,302 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,192 KB
testcase_01 AC 83 ms
15,116 KB
testcase_02 AC 79 ms
15,244 KB
testcase_03 AC 80 ms
15,128 KB
testcase_04 AC 246 ms
49,276 KB
testcase_05 AC 125 ms
25,080 KB
testcase_06 AC 225 ms
44,444 KB
testcase_07 AC 92 ms
17,988 KB
testcase_08 AC 103 ms
19,916 KB
testcase_09 AC 223 ms
44,800 KB
testcase_10 AC 181 ms
35,664 KB
testcase_11 AC 175 ms
33,596 KB
testcase_12 AC 92 ms
17,464 KB
testcase_13 AC 120 ms
23,632 KB
testcase_14 AC 240 ms
49,644 KB
testcase_15 AC 243 ms
49,468 KB
testcase_16 AC 248 ms
49,444 KB
testcase_17 AC 245 ms
49,520 KB
testcase_18 AC 245 ms
49,504 KB
testcase_19 AC 264 ms
52,108 KB
testcase_20 AC 264 ms
52,288 KB
testcase_21 AC 259 ms
52,104 KB
testcase_22 AC 261 ms
52,212 KB
testcase_23 AC 265 ms
52,184 KB
testcase_24 AC 84 ms
15,256 KB
testcase_25 AC 81 ms
15,124 KB
testcase_26 AC 260 ms
52,216 KB
testcase_27 AC 249 ms
50,892 KB
testcase_28 AC 251 ms
50,876 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

eval"N,K,*A="+$<.read.split*?,
x,y=0,N*K
A.reduce{x,y=[x+K,y+K,(z=_2-_1)>0?z+x:x].min,[x+K,y+K,z<0?y-z:y].min;_2}
p x<y ?x:y
0