結果

問題 No.27 板の準備
ユーザー tailstails
提出日時 2019-08-15 16:43:25
言語 Bash
(Bash 5.1.16)
結果
AC  
実行時間 3,495 ms / 5,000 ms
コード長 324 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 19:06:36
合計ジャッジ時間 37,445 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 318 ms
4,348 KB
testcase_01 AC 622 ms
4,348 KB
testcase_02 AC 1,939 ms
4,348 KB
testcase_03 AC 643 ms
4,348 KB
testcase_04 AC 2,261 ms
4,348 KB
testcase_05 AC 1,966 ms
4,348 KB
testcase_06 AC 2,742 ms
4,348 KB
testcase_07 AC 2,714 ms
4,348 KB
testcase_08 AC 3,495 ms
4,348 KB
testcase_09 AC 2,900 ms
4,348 KB
testcase_10 AC 2,361 ms
4,348 KB
testcase_11 AC 2,181 ms
4,348 KB
testcase_12 AC 2,384 ms
4,348 KB
testcase_13 AC 2,068 ms
4,348 KB
testcase_14 AC 1,647 ms
4,348 KB
testcase_15 AC 2,422 ms
4,348 KB
testcase_16 AC 1,164 ms
4,348 KB
testcase_17 AC 2,336 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

f='v==0 ? 0 : v<0 ? 999 : m[v] ? m[v] :
( m[v]=999,
  v-=a, u=f+1, v+=a, m[v]=u<m[v]?u:m[v],
  v-=b, u=f+1, v+=b, m[v]=u<m[v]?u:m[v],
  v-=c, u=f+1, v+=c, m[v]=u<m[v]?u:m[v] )'
r=999
read {w..z}
for((a=0;++a<29;)){
for((b=a;++b<30;)){
for((c=b;++c<31;)){
m=()
(( s=(v=w,f)+(v=x,f)+(v=y,f)+(v=z,f), r=s<r?s:r ))
}
}
}
echo $r
0