結果
| 問題 | No.1390 Get together |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-22 07:11:06 |
| 言語 | Ruby (4.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 369 bytes |
| 記録 | |
| コンパイル時間 | 284 ms |
| コンパイル使用メモリ | 8,960 KB |
| 実行使用メモリ | 40,920 KB |
| 最終ジャッジ日時 | 2026-05-17 08:58:19 |
| 合計ジャッジ時間 | 9,740 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 14 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - m Syntax OK
ソースコード
n, m = gets.chomp.split(" ").map(&:to_i)
hash = Hash.new(0)
count = 0
arr = []
n.times do
b, c = gets.chomp.split(" ").map(&:to_i)
arr << [b,c]
# count += 1 if hash[c] >= 1
# count -= 1 if iru[c] == b && hash[c] >= 1
# iru[c] = b
# hash[c] += 1
end
arr = arr.uniq
arr.each do |i,j|
count += 1 if hash[j] >= 1
hash[j] += 1
end
puts count