General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
35855900 Practice:
______n______
263D - 19 Python 2 Accepted 902 ms 18140 KB 2018-03-02 23:10:05 2018-03-02 23:10:05
→ Source
r=lambda:map(int,raw_input().split())
n,m,k=r()
p=[-1]*(n+1)
g=[[] for _ in (n+1)*[0]]
for _ in [0]*m:
    a,b=r()
    g[a]+=[b]
    g[b]+=[a]
x,s=1,0
r=[]
while 1:
    r+=[x]
    p[x]=s
    s+=1
    m=n
    for y in g[x]:
        if p[y] < 0:
            x=y
            break
        else:
            m=min(m,p[y])
    else:
        i=r.index(p.index(m))
        r=r[i:]
        print len(r)
        print ' '.join(map(str,r))
        break
 
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details