結果

問題 No.1390 Get together
ユーザー ntuda
提出日時 2024-09-17 21:35:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 249 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 82,272 KB
実行使用メモリ 144,728 KB
最終ジャッジ日時 2024-09-17 21:36:00
合計ジャッジ時間 8,950 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
dic = defaultdict(set)
N, M = map(int, input().split())
BC = [list(map(int, input().split())) for _ in range(N)]
for b, c in BC:
    dic[c].add(b)
ans = 0
for k, v in dic.items():
    ans += len(v) - 1
print(ans)
0