結果
| 問題 | No.239 にゃんぱすー |
| コンテスト | |
| ユーザー |
harhogefoo
|
| 提出日時 | 2016-10-13 15:38:43 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 57 ms / 2,000 ms |
| コード長 | 336 bytes |
| 記録 | |
| コンパイル時間 | 89 ms |
| コンパイル使用メモリ | 9,088 KB |
| 実行使用メモリ | 15,232 KB |
| 最終ジャッジ日時 | 2026-05-16 07:27:04 |
| 合計ジャッジ時間 | 4,042 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
コンパイルメッセージ
Main.rb:21: warning: ambiguous first argument; put parentheses or a space even after `-` operator Syntax OK
ソースコード
n = gets.to_i
renchon = Hash.new(0)
n.times do |i|
a = gets.chomp.split(" ")
a.length.times do |j|
if a[j] == "nyanpass"
renchon[j+1] += 1
end
end
end
renchon_num = 0
renchon.each do |k, nyanpass|
if nyanpass == n - 1
renchon_num += 1
end
end
if renchon_num != 1
puts -1
else
puts renchon.key(n-1)
end
harhogefoo