結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー ああいいああいい
提出日時 2022-01-14 18:27:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 607 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 82,160 KB
実行使用メモリ 77,696 KB
最終ジャッジ日時 2024-04-30 02:09:54
合計ジャッジ時間 3,562 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
53,760 KB
testcase_01 AC 47 ms
60,032 KB
testcase_02 AC 43 ms
53,376 KB
testcase_03 AC 43 ms
53,888 KB
testcase_04 AC 43 ms
53,376 KB
testcase_05 AC 94 ms
77,440 KB
testcase_06 AC 94 ms
77,568 KB
testcase_07 AC 95 ms
77,440 KB
testcase_08 AC 96 ms
77,608 KB
testcase_09 AC 93 ms
77,500 KB
testcase_10 AC 89 ms
77,568 KB
testcase_11 AC 91 ms
77,696 KB
testcase_12 AC 93 ms
77,484 KB
testcase_13 AC 91 ms
77,468 KB
testcase_14 AC 47 ms
55,808 KB
testcase_15 AC 48 ms
56,192 KB
testcase_16 AC 47 ms
56,064 KB
testcase_17 AC 47 ms
56,064 KB
testcase_18 AC 51 ms
56,064 KB
testcase_19 AC 50 ms
55,936 KB
testcase_20 AC 49 ms
55,936 KB
testcase_21 AC 49 ms
56,192 KB
testcase_22 AC 49 ms
56,448 KB
testcase_23 AC 41 ms
53,504 KB
testcase_24 AC 43 ms
53,504 KB
testcase_25 AC 41 ms
53,888 KB
testcase_26 AC 40 ms
54,088 KB
testcase_27 AC 40 ms
53,632 KB
testcase_28 AC 40 ms
53,376 KB
testcase_29 AC 40 ms
53,632 KB
testcase_30 AC 41 ms
54,144 KB
testcase_31 AC 40 ms
53,632 KB
testcase_32 AC 41 ms
54,016 KB
testcase_33 AC 41 ms
54,016 KB
testcase_34 AC 43 ms
53,632 KB
testcase_35 AC 42 ms
54,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
G = [[] for _ in range(N+1)]
gnum = [0] * (N+1)
for _ in range(M):
    a,b = map(int,input().split())
    G[a].append(b)
    G[b].append(a)
    gnum[a] += 1
    gnum[b] += 1
memo = [0] * (N + 1)
from collections import deque
q = deque()
for i in range(1,N+1):
    if gnum[i] == 1:
        q.append(i)
        memo[i] = 1
count = 0
while q:
    now = q.popleft()
    if gnum[now] != 1:continue
    count += 1
    for v in G[now]:
        gnum[v] -= 1
        if gnum[v] == 1:
            memo[v] = 1
            q.append(v)
if count & 1:
    print('Yes')
else:
    print('No')
0