結果

問題 No.239 にゃんぱすー
ユーザー gemmaro
提出日時 2019-10-23 13:46:22
言語 Ruby
(3.4.1)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,800 KB
最終ジャッジ日時 2024-07-06 08:04:08
合計ジャッジ時間 5,378 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.chomp.to_i

a_array = []
n.times {
  a_vec = gets.chomp.split
  a_array << a_vec
}

count = 0
number = 0
n.times {|col|
  is_exist = true
  n.times {|row|
    line = a_array[row][col]
    is_exist = false if not (line == "nyanpass" or line == '-')
  }
  if is_exist
    count += 1
    number = col + 1
  end
}

p (count == 1) ? number : -1
0