結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー tcltktcltk
提出日時 2021-10-18 12:30:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 963 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 81,884 KB
実行使用メモリ 88,948 KB
最終ジャッジ日時 2023-10-19 10:03:39
合計ジャッジ時間 7,397 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
85,932 KB
testcase_01 AC 134 ms
86,392 KB
testcase_02 AC 131 ms
85,948 KB
testcase_03 AC 130 ms
85,944 KB
testcase_04 AC 131 ms
85,952 KB
testcase_05 AC 166 ms
88,948 KB
testcase_06 AC 164 ms
88,916 KB
testcase_07 AC 164 ms
88,912 KB
testcase_08 AC 165 ms
88,928 KB
testcase_09 AC 164 ms
88,924 KB
testcase_10 AC 164 ms
88,908 KB
testcase_11 AC 165 ms
88,912 KB
testcase_12 AC 166 ms
88,920 KB
testcase_13 AC 180 ms
88,920 KB
testcase_14 AC 133 ms
85,948 KB
testcase_15 AC 132 ms
85,948 KB
testcase_16 AC 132 ms
85,944 KB
testcase_17 AC 135 ms
85,948 KB
testcase_18 AC 133 ms
85,952 KB
testcase_19 AC 132 ms
85,944 KB
testcase_20 AC 132 ms
85,944 KB
testcase_21 AC 132 ms
85,948 KB
testcase_22 AC 135 ms
85,944 KB
testcase_23 AC 132 ms
85,944 KB
testcase_24 AC 133 ms
85,944 KB
testcase_25 AC 132 ms
85,948 KB
testcase_26 AC 132 ms
85,952 KB
testcase_27 AC 132 ms
85,948 KB
testcase_28 AC 132 ms
85,948 KB
testcase_29 AC 131 ms
85,948 KB
testcase_30 AC 131 ms
85,948 KB
testcase_31 AC 138 ms
85,948 KB
testcase_32 AC 132 ms
85,948 KB
testcase_33 AC 134 ms
85,948 KB
testcase_34 AC 131 ms
85,948 KB
testcase_35 AC 132 ms
85,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq


def input():
    return sys.stdin.readline()[:-1]


# sys.setrecursionlimit(1000000)

# _INPUT = """4 3
# 1 2
# 1 3
# 1 4

# """
# sys.stdin = io.StringIO(_INPUT)

INF = 10**10

YES = 'Yes'
NO = 'No'

N, M = map(int, input().split())
G = [list() for _ in range(N)]
InDegree = [0] * N
for _ in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    G[a].append(b)
    G[b].append(a)
    InDegree[a] += 1
    InDegree[b] += 1

L = [i for i in range(N) if InDegree[i] == 1]
n = 0
while L:
    p = L.pop()
    if InDegree[p] >= 1:
        n += 1
        InDegree[p] -= 1
        for p1 in G[p]:
            if InDegree[p1]:
                InDegree[p1] -= 1
                if InDegree[p1] == 1:
                    L.append(p1)

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