結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-07 17:35:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 536 bytes
コンパイル時間 537 ms
コンパイル使用メモリ 10,940 KB
実行使用メモリ 9,532 KB
最終ジャッジ日時 2023-09-04 00:09:16
合計ジャッジ時間 3,467 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,492 KB
testcase_01 AC 19 ms
8,848 KB
testcase_02 AC 17 ms
8,544 KB
testcase_03 AC 18 ms
8,472 KB
testcase_04 AC 17 ms
8,600 KB
testcase_05 AC 37 ms
9,316 KB
testcase_06 AC 37 ms
9,380 KB
testcase_07 AC 37 ms
9,532 KB
testcase_08 AC 37 ms
9,440 KB
testcase_09 AC 36 ms
9,520 KB
testcase_10 AC 37 ms
9,524 KB
testcase_11 AC 37 ms
9,340 KB
testcase_12 AC 37 ms
9,364 KB
testcase_13 AC 37 ms
9,304 KB
testcase_14 AC 20 ms
8,624 KB
testcase_15 AC 20 ms
8,504 KB
testcase_16 AC 19 ms
8,672 KB
testcase_17 AC 19 ms
8,496 KB
testcase_18 AC 19 ms
8,632 KB
testcase_19 AC 19 ms
8,532 KB
testcase_20 AC 19 ms
8,696 KB
testcase_21 AC 19 ms
8,624 KB
testcase_22 AC 19 ms
8,688 KB
testcase_23 AC 17 ms
8,596 KB
testcase_24 AC 17 ms
8,484 KB
testcase_25 AC 18 ms
8,652 KB
testcase_26 AC 17 ms
8,524 KB
testcase_27 AC 17 ms
8,664 KB
testcase_28 AC 17 ms
8,672 KB
testcase_29 AC 18 ms
8,544 KB
testcase_30 AC 18 ms
8,540 KB
testcase_31 AC 18 ms
8,580 KB
testcase_32 AC 18 ms
8,636 KB
testcase_33 AC 18 ms
8,644 KB
testcase_34 AC 18 ms
8,588 KB
testcase_35 AC 18 ms
8,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
n,m=map(int,input().split())
g=[[] for _ in range(n)]
v=[0]*n
for _ in range(m):
    a,b=map(int,input().split())
    a-=1;b-=1
    g[a].append(b)
    g[b].append(a)
    v[a]+=1;v[b]+=1
q=deque()
for i in range(n):
    if v[i]==1:
        q.append(i)
cnt=0
while q:
    now=q.popleft()
    if v[now]>=1:
        v[now]-=1
        cnt+=1
        for to in g[now]:
            if v[to]>=1:
                v[to]-=1
                if v[to]==1:
                    q.append(to)
print('Yes' if cnt%2 else 'No')
0