結果

問題 No.1390 Get together
ユーザー paruf4paruf4
提出日時 2021-02-12 22:25:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 267 bytes
コンパイル時間 695 ms
コンパイル使用メモリ 87,160 KB
実行使用メモリ 130,924 KB
最終ジャッジ日時 2023-09-27 04:58:59
合計ジャッジ時間 9,980 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,628 KB
testcase_01 AC 76 ms
71,456 KB
testcase_02 AC 76 ms
71,264 KB
testcase_03 AC 113 ms
78,328 KB
testcase_04 AC 112 ms
77,100 KB
testcase_05 WA -
testcase_06 AC 113 ms
77,076 KB
testcase_07 WA -
testcase_08 AC 126 ms
77,464 KB
testcase_09 AC 120 ms
78,392 KB
testcase_10 AC 81 ms
71,576 KB
testcase_11 AC 82 ms
71,112 KB
testcase_12 AC 81 ms
71,632 KB
testcase_13 WA -
testcase_14 AC 78 ms
71,276 KB
testcase_15 AC 78 ms
71,452 KB
testcase_16 AC 282 ms
108,952 KB
testcase_17 AC 386 ms
130,756 KB
testcase_18 AC 255 ms
116,668 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 403 ms
130,724 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 388 ms
130,924 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())

G = [set() for _ in range(n)]
for i in range(n):
    b, c = map(int, input().split())
    b -= 1
    c -= 1
    G[c].add(b)

t = []
for g in G:
    t.append(len(g))

res = 0
for tt in t:
    if tt > 0:
        res += tt-1

print(res)
0