結果
| 問題 |
No.1610 She Loves Me, She Loves Me Not, ...
|
| コンテスト | |
| ユーザー |
m1k__
|
| 提出日時 | 2021-07-21 21:31:57 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 604 bytes |
| コンパイル時間 | 169 ms |
| コンパイル使用メモリ | 82,528 KB |
| 実行使用メモリ | 84,036 KB |
| 最終ジャッジ日時 | 2024-07-17 16:18:42 |
| 合計ジャッジ時間 | 4,185 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 15 WA * 17 |
ソースコード
N, M = [int(x) for x in input().split()]
from_cnt = [0]*N
to = [[]*N for _ in range(N)]
for _ in range(M):
a, b = [int(x)-1 for x in input().split()]
to[a].append(b)
to[b].append(a)
from_cnt[b] += 1
from_cnt[a] += 1
s = set()
from collections import deque
q = deque([v for v in range(N) if from_cnt[v]>0])
cnt = from_cnt[::]
n = 0
ans = 0
while q and n < 10**5:
n += 1
v = q.popleft()
for u in to[v]:
if cnt[u]==0: continue
if cnt[u]%2:
ans ^= 1
cnt[u] -= 1
cnt[v] -= 1
q.append(u)
print('Yes' if ans else 'No')
m1k__