結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー hirakuhiraku
提出日時 2022-02-12 22:18:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 561 bytes
コンパイル時間 519 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 78,368 KB
最終ジャッジ日時 2023-09-11 10:50:11
合計ジャッジ時間 5,948 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,408 KB
testcase_01 AC 75 ms
75,792 KB
testcase_02 AC 75 ms
71,400 KB
testcase_03 AC 72 ms
71,308 KB
testcase_04 AC 71 ms
71,328 KB
testcase_05 AC 120 ms
78,348 KB
testcase_06 AC 115 ms
78,220 KB
testcase_07 AC 116 ms
78,312 KB
testcase_08 AC 115 ms
78,360 KB
testcase_09 AC 116 ms
78,132 KB
testcase_10 AC 115 ms
78,300 KB
testcase_11 AC 116 ms
78,240 KB
testcase_12 AC 117 ms
78,196 KB
testcase_13 AC 117 ms
78,368 KB
testcase_14 AC 78 ms
71,500 KB
testcase_15 AC 77 ms
71,256 KB
testcase_16 AC 78 ms
71,252 KB
testcase_17 AC 78 ms
71,376 KB
testcase_18 AC 76 ms
71,616 KB
testcase_19 AC 79 ms
71,260 KB
testcase_20 AC 78 ms
71,544 KB
testcase_21 AC 79 ms
71,364 KB
testcase_22 AC 77 ms
71,336 KB
testcase_23 AC 70 ms
71,680 KB
testcase_24 AC 72 ms
71,340 KB
testcase_25 AC 71 ms
71,396 KB
testcase_26 AC 73 ms
71,500 KB
testcase_27 AC 73 ms
71,256 KB
testcase_28 AC 73 ms
71,344 KB
testcase_29 AC 71 ms
71,588 KB
testcase_30 AC 72 ms
71,224 KB
testcase_31 AC 73 ms
71,252 KB
testcase_32 AC 73 ms
71,112 KB
testcase_33 AC 73 ms
71,568 KB
testcase_34 AC 73 ms
71,376 KB
testcase_35 AC 72 ms
71,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# https://yukicoder.me/problems/no/1610
# No.1610 She Loves Me, She Loves Me Not, ...

n, m = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(m)]

graph = [[] for _ in range(n)]
for a, b in AB:
    a -= 1
    b -= 1
    graph[a].append(b)
    graph[b].append(a)

cnt = 0
flg = True
while flg:
    flg = False
    for i in range(n):
        if len(graph[i]) == 1:
            flg = True
            cnt += 1
            nxt = graph[i].pop()
            graph[nxt].remove(i)

if cnt % 2 == 1:
    print("Yes")
else:
    print("No")
0