結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー m1k__m1k__
提出日時 2021-07-21 21:31:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 564 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 87,128 KB
実行使用メモリ 117,588 KB
最終ジャッジ日時 2023-09-24 15:29:23
合計ジャッジ時間 5,742 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,096 KB
testcase_01 AC 78 ms
75,472 KB
testcase_02 AC 74 ms
71,200 KB
testcase_03 AC 79 ms
71,316 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 136 ms
91,800 KB
testcase_09 AC 138 ms
91,428 KB
testcase_10 AC 144 ms
91,708 KB
testcase_11 WA -
testcase_12 AC 138 ms
95,372 KB
testcase_13 AC 132 ms
85,040 KB
testcase_14 AC 119 ms
117,492 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 100 ms
89,516 KB
testcase_18 AC 111 ms
101,416 KB
testcase_19 AC 119 ms
117,588 KB
testcase_20 AC 116 ms
104,912 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 76 ms
71,164 KB
testcase_24 AC 88 ms
82,372 KB
testcase_25 AC 72 ms
71,452 KB
testcase_26 AC 90 ms
82,152 KB
testcase_27 WA -
testcase_28 AC 110 ms
101,420 KB
testcase_29 AC 101 ms
93,532 KB
testcase_30 WA -
testcase_31 AC 99 ms
93,612 KB
testcase_32 AC 107 ms
98,444 KB
testcase_33 AC 112 ms
104,828 KB
testcase_34 AC 106 ms
101,560 KB
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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()
q = [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.pop()
    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')
0