結果

問題 No.359 門松行列
ユーザー syarosyaro
提出日時 2017-12-01 20:44:36
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 316 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 11,316 KB
実行使用メモリ 15,476 KB
最終ジャッジ日時 2023-08-18 16:16:01
合計ジャッジ時間 2,605 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,148 KB
testcase_01 AC 75 ms
15,132 KB
testcase_02 AC 75 ms
15,172 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

gets.to_i.times{eval"L,*A="+$<.take(4).join.split*?,;x,y=g=(0..8).select{|i|A[i]<1};q=->a{A[y]=L-A[x]=a;0<a&&a<L&&[[i=0,3,6],[2],0..2,[0]].all?{|k|i+=1;k.all?{|k|k=A.values_at k,k+=i,k+i;k.sort[1]!=k[1]&&k|[]==k}}};A<<L/2;A.map{|a|0.upto(1){|i|g<<a+i<<L-a+i}};v=a=0;g.sort.map{|b|v+=q[a]&&q[b]?b-a:q[b]?1:0;a=b};p v}
0