#39319: #4,#5,#6都被中斷RE,我的程式有什麼可改的(Python)


qaz0978564615@gmail.com (EVIN K)

學校 : 不指定學校
編號 : 255629
來源 : [203.204.110.174]
最後登入時間 :
2024-04-27 15:15:44
b924. kevin 愛畫畫 | From: [203.204.110.174] | 發表日期 : 2024-02-05 15:22

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

t_list = [[int(x) for x in input().split()] for _ in range(m)]#[[1, 2], [2, 4], [3, 4], [3, 1], [1, 4]]
o_list = [o_l for t_l in t_list for o_l in t_l]#[1, 2, 2, 4, 3, 4, 3, 1, 1, 4]
c_list = [i for i in range(1, n + 1) if o_list.count(i) % 2 != 0]
len_c = len(c_list)
result = "YES" if len_c <= 2 else "NO"

print(result)   

 
ZeroJudge Forum