結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー O2MTO2MT
提出日時 2021-07-21 22:24:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 546 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 79,180 KB
最終ジャッジ日時 2023-09-24 18:32:58
合計ジャッジ時間 5,917 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,656 KB
testcase_01 AC 105 ms
77,112 KB
testcase_02 AC 97 ms
71,792 KB
testcase_03 AC 94 ms
71,644 KB
testcase_04 AC 94 ms
71,752 KB
testcase_05 AC 155 ms
79,052 KB
testcase_06 AC 147 ms
78,968 KB
testcase_07 AC 150 ms
79,112 KB
testcase_08 AC 150 ms
78,968 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 148 ms
78,932 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 98 ms
72,324 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 101 ms
72,484 KB
testcase_18 AC 100 ms
72,460 KB
testcase_19 WA -
testcase_20 AC 101 ms
72,492 KB
testcase_21 WA -
testcase_22 AC 101 ms
72,196 KB
testcase_23 AC 93 ms
71,416 KB
testcase_24 AC 95 ms
71,884 KB
testcase_25 AC 96 ms
71,648 KB
testcase_26 AC 92 ms
71,740 KB
testcase_27 AC 95 ms
71,848 KB
testcase_28 AC 95 ms
71,804 KB
testcase_29 AC 94 ms
71,412 KB
testcase_30 AC 92 ms
71,600 KB
testcase_31 AC 95 ms
71,700 KB
testcase_32 AC 96 ms
71,776 KB
testcase_33 AC 95 ms
71,812 KB
testcase_34 AC 93 ms
71,676 KB
testcase_35 AC 92 ms
71,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

N,M = map(int,input().split())
l = [[] for _ in range(N)]
visited = [False]*N

for _ in range(M):
  a,b = map(int,input().split())
  a -= 1
  b -= 1
  l[a].append(b)
  l[b].append(a)

num = 0

for i in range(N):
  if len(l[i]) > 1:
    continue
  visited[i] = True
  que = deque([i])
  while que:
    v = que.pop()
    if len(l[v]) > 3:
      continue
    for vv in l[v]:
      if not visited[vv]:
        que.append(vv)
        visited[vv] = True
        num += 1

if num%2 != 0:
  print('Yes')
else:
  print('No')
0