結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー 👑 H20H20
提出日時 2021-07-25 22:53:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 606 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 79,032 KB
最終ジャッジ日時 2023-09-28 12:41:53
合計ジャッジ時間 6,558 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,600 KB
testcase_01 AC 100 ms
77,276 KB
testcase_02 AC 95 ms
71,720 KB
testcase_03 AC 96 ms
71,808 KB
testcase_04 AC 94 ms
71,564 KB
testcase_05 AC 143 ms
78,852 KB
testcase_06 AC 144 ms
79,032 KB
testcase_07 AC 142 ms
78,824 KB
testcase_08 AC 141 ms
78,792 KB
testcase_09 AC 144 ms
78,676 KB
testcase_10 AC 140 ms
78,888 KB
testcase_11 AC 143 ms
78,540 KB
testcase_12 AC 139 ms
78,828 KB
testcase_13 AC 141 ms
78,876 KB
testcase_14 AC 103 ms
72,372 KB
testcase_15 AC 103 ms
71,984 KB
testcase_16 AC 102 ms
72,192 KB
testcase_17 AC 103 ms
72,164 KB
testcase_18 AC 102 ms
72,368 KB
testcase_19 AC 104 ms
72,304 KB
testcase_20 AC 102 ms
72,372 KB
testcase_21 AC 101 ms
72,240 KB
testcase_22 AC 101 ms
71,984 KB
testcase_23 AC 94 ms
71,724 KB
testcase_24 AC 92 ms
71,664 KB
testcase_25 AC 93 ms
71,344 KB
testcase_26 AC 95 ms
71,680 KB
testcase_27 AC 95 ms
71,592 KB
testcase_28 AC 93 ms
71,512 KB
testcase_29 AC 95 ms
71,748 KB
testcase_30 AC 96 ms
71,724 KB
testcase_31 AC 96 ms
71,688 KB
testcase_32 AC 94 ms
71,812 KB
testcase_33 AC 94 ms
71,560 KB
testcase_34 AC 96 ms
71,336 KB
testcase_35 AC 94 ms
71,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
N,M = map(int, input().split())
L = [[]  for i in range(N)]
CNT = [0]*N
for _ in range(M):
    a,b = map(int, input().split())
    a-=1
    b-=1
    L[a].append(b)
    L[b].append(a)
    CNT[a]+=1
    CNT[b]+=1

d = collections.deque()
for i in range(N):
    if CNT[i]==1:
        d.append(i)
cut = 0
while len(d):
    i = d.popleft()
    CNT[i]-=1
    flag = False
    for l in L[i]:
        if CNT[l]>0:
            flag = True
            CNT[l]-=1
            if CNT[l]==1:
                d.append(l)
    if flag:
        cut+=1


if cut%2==1:
    print('Yes')
else:
    print('No')
0