結果

問題 No.1390 Get together
ユーザー roarisroaris
提出日時 2021-02-12 23:10:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 318 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 111,280 KB
最終ジャッジ日時 2024-07-20 00:42:09
合計ジャッジ時間 6,538 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

N, M = map(int, input().split())
slime = defaultdict(list)

for _ in range(N):
    b, c = map(int, input().split())
    slime[c].append(b)

ans = 0

for v in slime.values():
    cnt = Counter(v)
    ans += sum(cnt.values())-max(cnt.values())

print(ans)
0