結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー moharan627moharan627
提出日時 2021-07-21 23:51:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 1,104 bytes
コンパイル時間 499 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 78,592 KB
最終ジャッジ日時 2023-09-24 19:59:53
合計ジャッジ時間 5,884 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,584 KB
testcase_01 AC 98 ms
77,372 KB
testcase_02 AC 91 ms
71,224 KB
testcase_03 AC 89 ms
71,476 KB
testcase_04 AC 91 ms
71,552 KB
testcase_05 AC 135 ms
77,760 KB
testcase_06 AC 132 ms
77,884 KB
testcase_07 AC 130 ms
78,004 KB
testcase_08 AC 134 ms
78,060 KB
testcase_09 AC 135 ms
78,592 KB
testcase_10 AC 129 ms
77,872 KB
testcase_11 AC 132 ms
78,056 KB
testcase_12 AC 131 ms
77,976 KB
testcase_13 AC 134 ms
78,504 KB
testcase_14 AC 93 ms
71,552 KB
testcase_15 AC 94 ms
71,600 KB
testcase_16 AC 93 ms
71,520 KB
testcase_17 AC 95 ms
71,700 KB
testcase_18 AC 94 ms
71,644 KB
testcase_19 AC 93 ms
71,576 KB
testcase_20 AC 93 ms
71,380 KB
testcase_21 AC 92 ms
71,536 KB
testcase_22 AC 91 ms
71,512 KB
testcase_23 AC 90 ms
71,652 KB
testcase_24 AC 89 ms
71,752 KB
testcase_25 AC 91 ms
71,416 KB
testcase_26 AC 90 ms
71,596 KB
testcase_27 AC 91 ms
71,228 KB
testcase_28 AC 89 ms
71,576 KB
testcase_29 AC 89 ms
71,476 KB
testcase_30 AC 90 ms
71,400 KB
testcase_31 AC 90 ms
71,164 KB
testcase_32 AC 91 ms
71,668 KB
testcase_33 AC 90 ms
71,308 KB
testcase_34 AC 90 ms
71,676 KB
testcase_35 AC 92 ms
71,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
INF = float('inf')
#10**20,2**63,float('inf')
MOD = 10**9 + 7
MOD2 = 998244353
from collections import defaultdict
def solve():
    def II(): return int(sys.stdin.readline())
    def LI(): return list(map(int, sys.stdin.readline().split()))
    def LC(): return list(input())
    def IC(): return [int(c) for c in input()]
    def MI(): return map(int, sys.stdin.readline().split())
    N,M = MI()
    Edge = defaultdict(lambda:0)
    Graph = [[] for _ in range(N+1)]
    for _ in range(M):
        A,B = MI()
        Graph[A].append(B)
        Graph[B].append(A)
        Edge[A] += 1
        Edge[B] += 1
    Flower = 0
    for _ in range(N):
        Bef = Flower
        #print(Edge)
        for n in range(1,N+1):
            if(Edge[n] == 1):
                Edge[n] = 0
                Flower += 1
                for g in Graph[n]:
                    Edge[g] -=1
        if(Bef == Flower):
            break
    if Flower%2 == 1:
        print("Yes")
    else:
        print("No")
    return
solve()
#sys.setrecursionlimit(10 ** 6)#再帰関数ではコメントにしないこと!!
0