結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー moharan627moharan627
提出日時 2021-07-21 23:54:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 868 ms / 2,000 ms
コード長 1,127 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 87,160 KB
実行使用メモリ 79,240 KB
最終ジャッジ日時 2023-09-24 20:00:40
合計ジャッジ時間 11,436 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,568 KB
testcase_01 AC 611 ms
77,616 KB
testcase_02 AC 87 ms
71,456 KB
testcase_03 AC 86 ms
71,644 KB
testcase_04 AC 85 ms
71,572 KB
testcase_05 AC 817 ms
79,212 KB
testcase_06 AC 868 ms
79,028 KB
testcase_07 AC 797 ms
79,140 KB
testcase_08 AC 760 ms
79,132 KB
testcase_09 AC 749 ms
79,068 KB
testcase_10 AC 791 ms
79,240 KB
testcase_11 AC 782 ms
78,872 KB
testcase_12 AC 577 ms
79,128 KB
testcase_13 AC 727 ms
78,816 KB
testcase_14 AC 97 ms
76,932 KB
testcase_15 AC 95 ms
76,752 KB
testcase_16 AC 95 ms
77,104 KB
testcase_17 AC 95 ms
76,984 KB
testcase_18 AC 93 ms
76,768 KB
testcase_19 AC 93 ms
76,976 KB
testcase_20 AC 98 ms
77,028 KB
testcase_21 AC 95 ms
76,832 KB
testcase_22 AC 97 ms
77,044 KB
testcase_23 AC 87 ms
71,484 KB
testcase_24 AC 88 ms
71,704 KB
testcase_25 AC 88 ms
71,656 KB
testcase_26 AC 87 ms
71,432 KB
testcase_27 AC 86 ms
71,556 KB
testcase_28 AC 88 ms
71,672 KB
testcase_29 AC 89 ms
71,468 KB
testcase_30 AC 88 ms
71,228 KB
testcase_31 AC 88 ms
71,328 KB
testcase_32 AC 83 ms
71,256 KB
testcase_33 AC 87 ms
71,464 KB
testcase_34 AC 88 ms
71,556 KB
testcase_35 AC 87 ms
71,420 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()
    Sub = defaultdict(lambda:0)
    Graph = [[] for _ in range(N+1)]
    for _ in range(M):
        A,B = MI()
        Graph[A].append(B)
        Graph[B].append(A)
    Flower = defaultdict(lambda:0)
    #print(Graph)
    for _ in range(N):
        for n in range(1,N+1):
            if len(Graph[n]) -Sub[n] == 1:
                Sub[n] = len(Graph[n])
                Flower[n] = 1
                Tmp = 0
                for g in Graph[n]:
                    if Flower[g] == 0:
                        Sub[g] += 1
    if sum(list(Flower.values())) %2 == 1:
        print("Yes")
    else:
        print("No")
    return
solve()
#sys.setrecursionlimit(10 ** 6)#再帰関数ではコメントにしないこと!!
0