結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー convexineqconvexineq
提出日時 2021-07-23 09:33:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 424 bytes
コンパイル時間 587 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 78,620 KB
最終ジャッジ日時 2023-09-25 07:28:04
合計ジャッジ時間 6,344 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,084 KB
testcase_01 AC 77 ms
75,300 KB
testcase_02 AC 70 ms
71,384 KB
testcase_03 AC 70 ms
71,224 KB
testcase_04 AC 70 ms
71,220 KB
testcase_05 AC 124 ms
78,292 KB
testcase_06 AC 116 ms
78,188 KB
testcase_07 AC 118 ms
77,864 KB
testcase_08 AC 116 ms
78,620 KB
testcase_09 AC 117 ms
78,392 KB
testcase_10 AC 117 ms
78,344 KB
testcase_11 AC 116 ms
78,360 KB
testcase_12 AC 118 ms
78,612 KB
testcase_13 AC 117 ms
77,880 KB
testcase_14 AC 77 ms
71,380 KB
testcase_15 AC 77 ms
71,408 KB
testcase_16 AC 77 ms
71,244 KB
testcase_17 AC 77 ms
71,412 KB
testcase_18 AC 77 ms
71,188 KB
testcase_19 AC 78 ms
71,368 KB
testcase_20 AC 78 ms
71,092 KB
testcase_21 AC 80 ms
71,192 KB
testcase_22 AC 82 ms
71,468 KB
testcase_23 AC 73 ms
71,088 KB
testcase_24 AC 73 ms
71,092 KB
testcase_25 AC 72 ms
71,244 KB
testcase_26 AC 72 ms
71,464 KB
testcase_27 AC 73 ms
70,944 KB
testcase_28 AC 71 ms
71,408 KB
testcase_29 AC 70 ms
71,212 KB
testcase_30 AC 72 ms
71,092 KB
testcase_31 AC 73 ms
71,188 KB
testcase_32 AC 71 ms
71,416 KB
testcase_33 AC 71 ms
71,224 KB
testcase_34 AC 70 ms
71,476 KB
testcase_35 AC 70 ms
71,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
g = [[] for _ in range(n)]
deg = [0]*n
for i in range(m):
    a,b = map(int,input().split())
    g[a-1].append((b-1,i))
    g[b-1].append((a-1,i))
    deg[a-1] += 1
    deg[b-1] += 1
q = [i for i in range(n) if deg[i]==1]
used = [0]*m
for v in q:
    for c,i in g[v]:
        used[i] = 1
        deg[c] -= 1
        if deg[c] == 1:
            q.append(c)
print("Yes" if sum(used)%2 else "No")
0