結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー moharan627moharan627
提出日時 2021-07-21 22:03:57
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,113 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 79,164 KB
最終ジャッジ日時 2023-09-24 17:39:37
合計ジャッジ時間 12,644 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,580 KB
testcase_01 AC 610 ms
77,816 KB
testcase_02 AC 92 ms
71,640 KB
testcase_03 AC 91 ms
71,820 KB
testcase_04 AC 93 ms
71,700 KB
testcase_05 AC 1,889 ms
79,104 KB
testcase_06 AC 1,458 ms
78,900 KB
testcase_07 AC 1,913 ms
78,892 KB
testcase_08 AC 1,898 ms
79,164 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

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()
    Flag = defaultdict(lambda:1)
    Graph = [[] for _ in range(N+1)]
    for _ in range(M):
        A,B = MI()
        Graph[A].append(B)
        Graph[B].append(A)
    Flower = 0
    #print(Graph)
    for _ in range(N):
        for n in range(1,N+1):
            if Flag[n] == 1:
                Node = 0
                for g in Graph[n]:
                    Node += Flag[g]
                if Node == 1:
                    #print(n)
                    Flag[n] = 0
                    Flower += 1
        #print(Flag)
    if Flower %2 == 1:
        print("Yes")
    else:
        print("No")

    return
solve()
#sys.setrecursionlimit(10 ** 6)#再帰関数ではコメントにしないこと!!
0