結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー horitaka1999horitaka1999
提出日時 2021-07-21 22:16:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 574 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 78,456 KB
最終ジャッジ日時 2023-09-24 18:18:57
合計ジャッジ時間 5,596 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,816 KB
testcase_01 AC 101 ms
77,104 KB
testcase_02 AC 92 ms
71,812 KB
testcase_03 AC 91 ms
71,344 KB
testcase_04 AC 93 ms
71,824 KB
testcase_05 AC 138 ms
78,360 KB
testcase_06 AC 137 ms
78,304 KB
testcase_07 AC 137 ms
78,456 KB
testcase_08 AC 137 ms
78,352 KB
testcase_09 AC 143 ms
78,220 KB
testcase_10 AC 142 ms
78,368 KB
testcase_11 AC 142 ms
78,356 KB
testcase_12 AC 140 ms
78,320 KB
testcase_13 AC 140 ms
78,432 KB
testcase_14 AC 102 ms
72,584 KB
testcase_15 AC 104 ms
72,248 KB
testcase_16 AC 102 ms
72,396 KB
testcase_17 AC 102 ms
72,492 KB
testcase_18 AC 102 ms
72,420 KB
testcase_19 AC 100 ms
72,492 KB
testcase_20 AC 104 ms
72,456 KB
testcase_21 AC 100 ms
72,080 KB
testcase_22 AC 102 ms
72,388 KB
testcase_23 AC 92 ms
71,876 KB
testcase_24 AC 94 ms
71,540 KB
testcase_25 AC 92 ms
71,712 KB
testcase_26 AC 93 ms
71,828 KB
testcase_27 AC 93 ms
71,684 KB
testcase_28 AC 93 ms
71,760 KB
testcase_29 AC 93 ms
71,664 KB
testcase_30 AC 97 ms
71,540 KB
testcase_31 AC 94 ms
71,684 KB
testcase_32 AC 93 ms
71,548 KB
testcase_33 AC 93 ms
71,648 KB
testcase_34 AC 92 ms
71,876 KB
testcase_35 AC 91 ms
71,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
Edge = [[] for _ in range(N)]
num = [0 for _ in range(N)]
for _ in range(M):
    a,b = map(int,input().split())
    a-=1
    b-=1
    Edge[a].append(b)
    Edge[b].append(a)
    num[a] += 1
    num[b] += 1
from collections import deque
q = deque()
for i in range(N):
    if num[i] == 1:
        q.append(i)
ans = 0
while q:
    now = q.popleft()
    if num[now] == 1:
        ans += 1
    for next in Edge[now]:
        num[next]-=1
        if num[next] == 1:
            q.append(next)
if ans % 2 == 0:
    print('No')
else:
    print('Yes')
0