結果

問題 No.2403 "Eight" Bridges of Königsberg
ユーザー gr1msl3ygr1msl3y
提出日時 2023-08-13 13:12:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 218 bytes
コンパイル時間 2,451 ms
コンパイル使用メモリ 82,024 KB
実行使用メモリ 77,576 KB
最終ジャッジ日時 2024-05-01 06:25:34
合計ジャッジ時間 6,435 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
52,280 KB
testcase_01 AC 31 ms
51,908 KB
testcase_02 AC 31 ms
52,584 KB
testcase_03 AC 31 ms
52,440 KB
testcase_04 AC 95 ms
76,344 KB
testcase_05 AC 124 ms
76,404 KB
testcase_06 AC 133 ms
76,008 KB
testcase_07 AC 102 ms
76,344 KB
testcase_08 AC 112 ms
75,888 KB
testcase_09 AC 137 ms
75,908 KB
testcase_10 AC 131 ms
76,108 KB
testcase_11 AC 114 ms
76,308 KB
testcase_12 AC 135 ms
76,044 KB
testcase_13 AC 114 ms
76,164 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 31 ms
52,888 KB
testcase_19 AC 42 ms
67,464 KB
testcase_20 AC 37 ms
61,080 KB
testcase_21 AC 39 ms
63,892 KB
testcase_22 AC 41 ms
66,456 KB
testcase_23 AC 40 ms
64,932 KB
testcase_24 AC 45 ms
66,592 KB
testcase_25 AC 40 ms
64,504 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 64 ms
76,444 KB
testcase_29 WA -
testcase_30 AC 44 ms
64,308 KB
testcase_31 AC 63 ms
76,480 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
g0 = [0]*(N+1)
g1 = [0]*(N+1)
for _ in range(K):
    a, b = map(int, input().split())
    g0[a] += 1
    g1[b] += 1

ans = max(sum(abs(a-b) for a, b in zip(g0, g1))//2-1, 0)
print(ans)
0