結果
| 問題 | 
                            No.1390 Get together
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-01-27 17:15:50 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 242 bytes | 
| コンパイル時間 | 384 ms | 
| コンパイル使用メモリ | 82,200 KB | 
| 実行使用メモリ | 99,172 KB | 
| 最終ジャッジ日時 | 2024-09-28 09:43:22 | 
| 合計ジャッジ時間 | 6,006 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 11 WA * 18 | 
ソースコード
from collections import defaultdict
N, M = map(int, input().split())
d = defaultdict(list)
for _ in range(N):
    b, c = map(int, input().split())
    d[c].append(b)
    
ans = 0
for value in d.values():
    ans += len(value) - 1
print(ans)