結果
| 問題 | No.1390 Get together |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-22 07:11:06 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 369 bytes |
| コンパイル時間 | 78 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 41,216 KB |
| 最終ジャッジ日時 | 2024-11-23 15:56:36 |
| 合計ジャッジ時間 | 13,431 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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