hihoCoder太阁最新面经算法竞赛4 register

Ended

Participants:109

Verdict:Accepted
Score:100 / 100
Submitted:2016-06-18 14:23:08

Lang:Python2

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
T = int(raw_input())
for t in range(T):
    NM = map(lambda xint(x)raw_input().split())
    d = dict(zip(range(N)[0] * N))
    for k in range(M):
        ij = map(lambda xint(x)raw_input().split())
        d[i-1] += 1
        d[j-1] += 1
    if 0 in d.values() or M != N-1:
        print "NO"
    else:
        print "YES"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX