結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー Akijin_007Akijin_007
提出日時 2022-11-04 13:39:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 668 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 78,400 KB
最終ジャッジ日時 2023-09-25 16:56:49
合計ジャッジ時間 5,368 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,424 KB
testcase_01 AC 84 ms
75,588 KB
testcase_02 AC 75 ms
71,184 KB
testcase_03 AC 75 ms
71,464 KB
testcase_04 AC 75 ms
71,380 KB
testcase_05 AC 127 ms
78,092 KB
testcase_06 AC 124 ms
78,156 KB
testcase_07 AC 123 ms
78,400 KB
testcase_08 AC 125 ms
78,144 KB
testcase_09 AC 123 ms
78,160 KB
testcase_10 AC 126 ms
78,116 KB
testcase_11 AC 123 ms
78,140 KB
testcase_12 AC 121 ms
78,180 KB
testcase_13 AC 122 ms
78,312 KB
testcase_14 AC 81 ms
71,072 KB
testcase_15 AC 81 ms
71,276 KB
testcase_16 AC 82 ms
71,260 KB
testcase_17 AC 82 ms
71,456 KB
testcase_18 AC 83 ms
71,404 KB
testcase_19 AC 82 ms
71,240 KB
testcase_20 AC 84 ms
71,296 KB
testcase_21 AC 83 ms
71,392 KB
testcase_22 AC 83 ms
71,296 KB
testcase_23 AC 77 ms
71,292 KB
testcase_24 AC 75 ms
71,312 KB
testcase_25 AC 75 ms
71,388 KB
testcase_26 AC 75 ms
71,396 KB
testcase_27 AC 76 ms
71,076 KB
testcase_28 AC 77 ms
71,260 KB
testcase_29 AC 77 ms
71,292 KB
testcase_30 AC 75 ms
71,084 KB
testcase_31 AC 77 ms
71,532 KB
testcase_32 AC 78 ms
71,188 KB
testcase_33 AC 78 ms
71,396 KB
testcase_34 AC 76 ms
71,296 KB
testcase_35 AC 77 ms
71,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

N, M = map(int, input().split())

to = [[] for i in range(N)]
d = [0] * N

for i in range(M):
    l, r = map(int, input().split())
    to[l-1].append(r-1)
    to[r-1].append(l-1)
    d[l-1] += 1
    d[r-1] += 1

ans = 0

q = []

for i in range(N):
    if d[i] == 1:
        q.append(i)

v = [0] * N

while q:
    t = q.pop()
    if v[t] == 1:
        continue
    v[t] = 1

    for x in to[t]:
        if v[x] == 1:
            continue
        d[x] -= 1
        ans += 1
        if d[x] == 1:
            q.append(x)

# print(ans)
if ans % 2 == 0:
    print("No")
else:
    print("Yes")





0