結果

問題 No.640 76本のトロンボーン
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-01-29 11:28:54
言語 Ruby
(3.2.2)
結果
AC  
実行時間 1,975 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 11,476 KB
実行使用メモリ 15,636 KB
最終ジャッジ日時 2023-09-27 23:02:05
合計ジャッジ時間 17,200 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
15,264 KB
testcase_01 AC 83 ms
15,160 KB
testcase_02 AC 81 ms
15,304 KB
testcase_03 AC 84 ms
15,144 KB
testcase_04 AC 84 ms
15,276 KB
testcase_05 AC 88 ms
15,364 KB
testcase_06 AC 1,969 ms
15,636 KB
testcase_07 AC 1,961 ms
15,428 KB
testcase_08 AC 1,975 ms
15,616 KB
testcase_09 AC 1,967 ms
15,544 KB
testcase_10 AC 1,951 ms
15,600 KB
testcase_11 AC 1,969 ms
15,300 KB
testcase_12 AC 1,972 ms
15,576 KB
testcase_13 AC 86 ms
15,240 KB
testcase_14 AC 1,691 ms
15,504 KB
testcase_15 AC 82 ms
15,284 KB
testcase_16 AC 84 ms
15,364 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

k=0...n=gets.to_i
i=0..n-2
j=1...n
a=k.map{gets}
z=0
k.map{|r|3.times{|s|3.times{|t|d=k.map{|x|k.map{|y|(r<1?a[x][y]:a[y][x])>'$'}}
e=d[w=0]
s<1&&e[i].all?&&i.map{|y|e[y]=nil}&&w=1
s>1&&e[j].all?&&j.map{|y|e[y]=nil}&&w=1
e=d[-1]
t<1&&e[i].all?&&i.map{|y|e[y]=nil}&&w+=1
t>1&&e[j].all?&&j.map{|y|e[y]=nil}&&w+=1
k.map{|y|f=d.map{|e|e[y]};(f[i].all?||f[j].all?)&&w+=1}
z<w&&z=w}}}
p z
0