結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー playerplayer
提出日時 2023-12-20 15:12:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 765 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,816 KB
最終ジャッジ日時 2023-12-20 15:12:46
合計ジャッジ時間 3,375 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 39 ms
59,508 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 AC 34 ms
53,460 KB
testcase_04 AC 36 ms
53,460 KB
testcase_05 AC 87 ms
76,812 KB
testcase_06 AC 84 ms
76,812 KB
testcase_07 AC 91 ms
76,688 KB
testcase_08 AC 94 ms
76,816 KB
testcase_09 AC 90 ms
76,812 KB
testcase_10 AC 86 ms
76,816 KB
testcase_11 AC 93 ms
76,816 KB
testcase_12 AC 85 ms
76,812 KB
testcase_13 AC 88 ms
76,688 KB
testcase_14 AC 44 ms
55,588 KB
testcase_15 AC 44 ms
55,588 KB
testcase_16 AC 43 ms
55,588 KB
testcase_17 AC 42 ms
55,588 KB
testcase_18 AC 42 ms
55,588 KB
testcase_19 AC 45 ms
55,588 KB
testcase_20 AC 42 ms
55,588 KB
testcase_21 AC 44 ms
55,588 KB
testcase_22 AC 42 ms
55,588 KB
testcase_23 AC 34 ms
53,460 KB
testcase_24 AC 35 ms
53,460 KB
testcase_25 AC 37 ms
53,460 KB
testcase_26 AC 35 ms
53,460 KB
testcase_27 AC 35 ms
53,460 KB
testcase_28 AC 35 ms
53,460 KB
testcase_29 AC 35 ms
53,460 KB
testcase_30 AC 35 ms
53,460 KB
testcase_31 AC 36 ms
53,460 KB
testcase_32 AC 36 ms
53,460 KB
testcase_33 AC 36 ms
53,460 KB
testcase_34 AC 35 ms
53,460 KB
testcase_35 AC 36 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())

edge = [[] for _ in range(n)]
into = [0]*n
for _ in range(m):
    a,b = map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
    into[a-1] += 1
    into[b-1] += 1  
    
start = set()
for i in range(n):
    if into[i] == 1:
        start.add(i)
# print(start)        
cnt = 0
while len(start) > 0:
    tmp = []
    for now in start:
        for next in edge[now]:
            if into[next] <= 0:
                continue
            into[next] -= 1
            into[now] -= 1
            cnt += 1
            if into[next] == 1:
                tmp.append(next)
    # print(tmp)
    start = set()
    for i in tmp:
        start.add(i)
# print(cnt)       
if cnt%2 == 1:
    print("Yes")
else:
    print("No")
0