結果

問題 No.2403 "Eight" Bridges of Königsberg
ユーザー rin204rin204
提出日時 2023-08-04 22:18:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 260 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 76,672 KB
最終ジャッジ日時 2024-04-22 20:36:12
合計ジャッジ時間 3,563 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
51,712 KB
testcase_01 AC 33 ms
51,840 KB
testcase_02 AC 31 ms
51,840 KB
testcase_03 AC 30 ms
51,584 KB
testcase_04 AC 91 ms
76,088 KB
testcase_05 AC 126 ms
76,440 KB
testcase_06 AC 125 ms
76,416 KB
testcase_07 AC 104 ms
76,544 KB
testcase_08 AC 105 ms
76,608 KB
testcase_09 AC 132 ms
76,288 KB
testcase_10 AC 127 ms
76,288 KB
testcase_11 AC 119 ms
76,288 KB
testcase_12 AC 139 ms
76,592 KB
testcase_13 AC 108 ms
76,672 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 32 ms
52,096 KB
testcase_19 AC 41 ms
61,952 KB
testcase_20 AC 40 ms
60,288 KB
testcase_21 AC 38 ms
61,184 KB
testcase_22 AC 40 ms
61,696 KB
testcase_23 AC 37 ms
60,800 KB
testcase_24 AC 39 ms
62,208 KB
testcase_25 AC 38 ms
60,032 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 58 ms
70,784 KB
testcase_29 WA -
testcase_30 AC 43 ms
62,080 KB
testcase_31 AC 58 ms
71,936 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
in_ = [0] * n
out_ = [0] * n

for _ in range(m):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    in_[v] += 1
    out_[u] += 1

tot = 0
for i, o in zip(in_, out_):
    tot += max(0, i - o)

print(max(0, tot - 1))
0