結果
| 問題 | No.239 にゃんぱすー |
| コンテスト | |
| ユーザー |
yn
|
| 提出日時 | 2016-06-09 23:31:30 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 59 ms / 2,000 ms |
| コード長 | 313 bytes |
| 記録 | |
| コンパイル時間 | 72 ms |
| コンパイル使用メモリ | 9,216 KB |
| 実行使用メモリ | 14,848 KB |
| 最終ジャッジ日時 | 2026-04-25 11:02:08 |
| 合計ジャッジ時間 | 3,798 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
コンパイルメッセージ
Main.rb:5: warning: assigned but unused variable - j Syntax OK
ソースコード
n = gets.to_i
cnt = Array.new(n, 0)
num = 0
idx = -1
for j in 0..n-1
a = gets.chomp.split(" ")
for i in 0..n-1
if a[i] == 'nyanpass' then
cnt[i] += 1
end
end
end
for i in 0..n-1
if cnt[i] == n-1 then
idx = i
num += 1
end
end
if num == 1 then
puts(idx + 1)
else
puts(-1)
end
yn