結果

問題 No.595 登山
ユーザー yuruhiyayuruhiya
提出日時 2021-07-23 11:54:19
言語 Ruby
(3.2.2)
結果
AC  
実行時間 306 ms / 1,500 ms
コード長 121 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 11,232 KB
実行使用メモリ 52,428 KB
最終ジャッジ日時 2023-09-25 10:06:46
合計ジャッジ時間 7,648 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
外部呼び出し有り
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
15,160 KB
testcase_01 AC 84 ms
15,156 KB
testcase_02 AC 85 ms
15,260 KB
testcase_03 AC 84 ms
15,156 KB
testcase_04 AC 273 ms
49,468 KB
testcase_05 AC 135 ms
25,192 KB
testcase_06 AC 246 ms
44,440 KB
testcase_07 AC 97 ms
17,984 KB
testcase_08 AC 113 ms
20,004 KB
testcase_09 AC 248 ms
44,720 KB
testcase_10 AC 201 ms
35,800 KB
testcase_11 AC 189 ms
33,480 KB
testcase_12 AC 97 ms
17,416 KB
testcase_13 AC 130 ms
23,592 KB
testcase_14 AC 259 ms
49,516 KB
testcase_15 AC 259 ms
49,672 KB
testcase_16 AC 258 ms
49,644 KB
testcase_17 AC 261 ms
49,612 KB
testcase_18 AC 260 ms
49,452 KB
testcase_19 AC 296 ms
52,076 KB
testcase_20 AC 291 ms
52,336 KB
testcase_21 AC 298 ms
52,120 KB
testcase_22 AC 295 ms
52,208 KB
testcase_23 AC 306 ms
52,164 KB
testcase_24 AC 88 ms
15,112 KB
testcase_25 AC 86 ms
15,156 KB
testcase_26 AC 296 ms
52,428 KB
testcase_27 AC 276 ms
51,084 KB
testcase_28 AC 279 ms
51,080 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

eval"N,K,*A="+`dd`.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