結果

問題 No.1610 She Loves Me, She Loves Me Not, ...
ユーザー kohei2019kohei2019
提出日時 2022-06-23 23:53:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 476 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 77,824 KB
最終ジャッジ日時 2024-04-25 07:43:35
合計ジャッジ時間 3,238 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
51,712 KB
testcase_01 AC 42 ms
58,880 KB
testcase_02 AC 36 ms
51,840 KB
testcase_03 AC 36 ms
51,840 KB
testcase_04 AC 38 ms
51,840 KB
testcase_05 AC 97 ms
77,696 KB
testcase_06 AC 95 ms
77,440 KB
testcase_07 AC 95 ms
77,696 KB
testcase_08 AC 104 ms
77,440 KB
testcase_09 AC 93 ms
77,824 KB
testcase_10 AC 93 ms
77,824 KB
testcase_11 AC 95 ms
77,568 KB
testcase_12 AC 92 ms
77,568 KB
testcase_13 AC 89 ms
77,568 KB
testcase_14 AC 43 ms
54,272 KB
testcase_15 AC 44 ms
54,400 KB
testcase_16 AC 44 ms
54,144 KB
testcase_17 AC 45 ms
54,016 KB
testcase_18 AC 44 ms
54,144 KB
testcase_19 AC 45 ms
54,272 KB
testcase_20 AC 44 ms
54,144 KB
testcase_21 AC 46 ms
54,144 KB
testcase_22 AC 43 ms
54,272 KB
testcase_23 AC 36 ms
51,712 KB
testcase_24 AC 38 ms
52,224 KB
testcase_25 AC 37 ms
51,840 KB
testcase_26 AC 38 ms
51,840 KB
testcase_27 AC 37 ms
51,968 KB
testcase_28 AC 39 ms
52,096 KB
testcase_29 AC 37 ms
52,352 KB
testcase_30 AC 36 ms
51,968 KB
testcase_31 AC 36 ms
51,968 KB
testcase_32 AC 38 ms
51,712 KB
testcase_33 AC 37 ms
51,968 KB
testcase_34 AC 36 ms
51,840 KB
testcase_35 AC 37 ms
52,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
lsAB = [set() for i in range(N)]
for i in range(M):
    A,B = map(int,input().split())
    A -= 1
    B -= 1
    lsAB[A].add(B)
    lsAB[B].add(A)

used = [False]*(N)
for i in range(N):
    if used[i]:
        continue
    now = i
    while len(lsAB[now]) == 1:
        used[now] = True
        nex = list(lsAB[now])[0]
        lsAB[now].remove(nex)
        lsAB[nex].remove(now)
        now = nex
print('Yes' if used.count(True)%2==1 else 'No')
0