結果
問題 |
No.1390 Get together
|
ユーザー |
![]() |
提出日時 | 2024-09-17 21:41:37 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 344 bytes |
コンパイル時間 | 220 ms |
コンパイル使用メモリ | 82,284 KB |
実行使用メモリ | 149,180 KB |
最終ジャッジ日時 | 2024-09-17 21:41:47 |
合計ジャッジ時間 | 7,953 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 WA * 15 |
ソースコード
from collections import defaultdict, Counter dic = defaultdict(list) N, M = map(int, input().split()) BC = [list(map(int, input().split())) for _ in range(N)] for b, c in BC: dic[c].append(b) ans = 0 for k, v in dic.items(): n = len(v) L = list(Counter(v).items()) L.sort(key = lambda x:-x[1]) ans += n - L[0][1] print(ans)