結果

問題 No.1390 Get together
ユーザー hiragnhiragn
提出日時 2022-11-29 14:28:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 328 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 54,848 KB
最終ジャッジ日時 2024-04-16 09:25:18
合計ジャッジ時間 15,126 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,624 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 32 ms
10,752 KB
testcase_03 AC 49 ms
11,648 KB
testcase_04 AC 41 ms
11,264 KB
testcase_05 WA -
testcase_06 AC 40 ms
11,392 KB
testcase_07 WA -
testcase_08 AC 41 ms
11,264 KB
testcase_09 AC 46 ms
11,776 KB
testcase_10 AC 29 ms
10,880 KB
testcase_11 AC 29 ms
10,752 KB
testcase_12 AC 29 ms
10,624 KB
testcase_13 WA -
testcase_14 AC 30 ms
10,752 KB
testcase_15 AC 29 ms
10,880 KB
testcase_16 AC 628 ms
19,348 KB
testcase_17 AC 775 ms
52,036 KB
testcase_18 AC 613 ms
28,032 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 798 ms
54,592 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 793 ms
54,596 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict


def main():
    n, m = map(int, input().split())

    d = defaultdict(set)
    for _ in range(n):
        box, color = map(int, input().split())
        d[color].add(box)

    ans = 0
    for x in d.values():
        ans += len(x) - 1
    print(ans)


if __name__ == "__main__":
    main()
0