結果

問題 No.1390 Get together
ユーザー nephrologistnephrologist
提出日時 2021-02-12 22:40:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 264 bytes
コンパイル時間 848 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 117,532 KB
最終ジャッジ日時 2023-09-27 05:28:57
合計ジャッジ時間 10,650 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,224 KB
testcase_01 AC 73 ms
71,356 KB
testcase_02 AC 72 ms
71,536 KB
testcase_03 AC 120 ms
78,352 KB
testcase_04 AC 111 ms
78,700 KB
testcase_05 WA -
testcase_06 AC 111 ms
78,436 KB
testcase_07 WA -
testcase_08 AC 110 ms
78,400 KB
testcase_09 AC 111 ms
78,784 KB
testcase_10 AC 72 ms
71,164 KB
testcase_11 AC 73 ms
71,376 KB
testcase_12 AC 73 ms
71,444 KB
testcase_13 WA -
testcase_14 AC 73 ms
71,712 KB
testcase_15 AC 74 ms
71,492 KB
testcase_16 AC 264 ms
98,464 KB
testcase_17 AC 400 ms
117,188 KB
testcase_18 AC 272 ms
107,452 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 409 ms
117,088 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 412 ms
117,364 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

memo = [set() for _ in range(n)]

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

ans = 0
for i in range(n):
    temp = len(list(memo[i]))
    ans += max(0, temp - 1)
print(ans)
0