結果

問題 No.585 工夫のないパズル
ユーザー syarosyaro
提出日時 2017-12-02 13:06:19
言語 Ruby
(3.3.0)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 539 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 11,324 KB
実行使用メモリ 15,300 KB
最終ジャッジ日時 2023-08-18 19:57:44
合計ジャッジ時間 2,569 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,172 KB
testcase_01 AC 82 ms
15,040 KB
testcase_02 AC 78 ms
15,300 KB
testcase_03 AC 83 ms
15,084 KB
testcase_04 AC 81 ms
15,084 KB
testcase_05 AC 81 ms
15,200 KB
testcase_06 AC 82 ms
15,048 KB
testcase_07 AC 78 ms
15,036 KB
testcase_08 AC 86 ms
15,036 KB
testcase_09 AC 80 ms
15,120 KB
testcase_10 AC 80 ms
15,140 KB
testcase_11 AC 84 ms
15,072 KB
testcase_12 AC 79 ms
15,020 KB
testcase_13 AC 83 ms
15,200 KB
testcase_14 AC 81 ms
15,032 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

f=$<.map{|l|l.chop.bytes}
t,*X=->x,y{g=f[x];f[x]=g[y,4]+g[0,y]}
r=->r,a{X+=["R #{r} #{a%=4}"]*-2[a];t[r,4-a];DBG[]}
d=->c,b{X+=["C #{c} #{b%=4}"]*-2[b];f=f.transpose;t[c,4-b];f=f.transpose;DBG[]}
w=->x{2.times{|i|d[x,1];r[3,-1];d[x,-1];r[3,2-3*i]}}
DBG=->{f.each{|g|false&&X<<g.pack('C*')};[]}
j=3.times{|s|4.times{|t|#\
i=f.index{|g|j=g.index 65+s*4+t}
g=i-s
j==t&&r[i,1]+d[t,g]+r[i,3]+d[t,-g]||#\
d[j,h=1[g]]+d[t,g+h]+r[i+h,t-j]+d[t,-g-h]+d[j,-h]#\
}}
r[3,-f[3].index(77)]
f[3][1]>79&&w[0]
f[3][2]>79&&w[1]
f[3][1]>78&&w[0]
puts X.size,X
0