結果

問題 No.640 76本のトロンボーン
ユーザー 👑 hos.lyrichos.lyric
提出日時 2019-01-29 11:27:05
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 414 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 18,432 KB
最終ジャッジ日時 2024-04-17 15:57:23
合計ジャッジ時間 4,215 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

k=0...n=gets.to_i
i=0..n-2
j=1...n
a=k.map{gets}
z=0
i.map{|r|k.map{|s|k.map{|t|
  d=k.map{|x|k.map{|y|(r<1?a[x][y]:a[y][x])>'$'}}
  w=0
  e=d[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