結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 43 ms
11,648 KB
testcase_04 AC 41 ms
11,520 KB
testcase_05 WA -
testcase_06 AC 41 ms
11,392 KB
testcase_07 WA -
testcase_08 AC 40 ms
11,520 KB
testcase_09 AC 45 ms
11,776 KB
testcase_10 AC 29 ms
10,880 KB
testcase_11 AC 28 ms
10,880 KB
testcase_12 AC 28 ms
10,752 KB
testcase_13 WA -
testcase_14 AC 29 ms
10,752 KB
testcase_15 AC 28 ms
10,752 KB
testcase_16 AC 607 ms
19,272 KB
testcase_17 AC 765 ms
52,164 KB
testcase_18 AC 612 ms
27,980 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 788 ms
54,716 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 784 ms
54,720 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):
        b, c = map(int, input().split())
        d[c].add(b)

    ans = 0
    for k, v in d.items():
        ans += len(v) - 1
    print(ans)


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