結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー O2MTO2MT
提出日時 2021-07-21 22:16:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 512 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 79,172 KB
最終ジャッジ日時 2023-09-24 18:18:49
合計ジャッジ時間 6,035 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,512 KB
testcase_01 AC 106 ms
77,524 KB
testcase_02 AC 95 ms
71,396 KB
testcase_03 AC 91 ms
71,868 KB
testcase_04 AC 91 ms
71,536 KB
testcase_05 WA -
testcase_06 AC 147 ms
78,820 KB
testcase_07 AC 141 ms
78,976 KB
testcase_08 AC 150 ms
79,140 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 152 ms
78,972 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 102 ms
72,032 KB
testcase_16 WA -
testcase_17 AC 100 ms
72,320 KB
testcase_18 AC 104 ms
77,356 KB
testcase_19 AC 102 ms
72,392 KB
testcase_20 WA -
testcase_21 AC 100 ms
71,976 KB
testcase_22 WA -
testcase_23 AC 92 ms
71,620 KB
testcase_24 AC 92 ms
71,344 KB
testcase_25 AC 91 ms
71,368 KB
testcase_26 AC 93 ms
71,768 KB
testcase_27 AC 94 ms
71,824 KB
testcase_28 AC 99 ms
71,500 KB
testcase_29 AC 93 ms
71,620 KB
testcase_30 AC 93 ms
71,720 KB
testcase_31 AC 95 ms
71,592 KB
testcase_32 AC 93 ms
71,724 KB
testcase_33 AC 94 ms
71,664 KB
testcase_34 AC 94 ms
71,760 KB
testcase_35 AC 93 ms
71,620 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.popleft()
    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