Submission #971474

#TimeUsernameProblemLanguageResultExecution timeMemory
971474Lcc735Political Development (BOI17_politicaldevelopment)Cpython 3
62 / 100
3074 ms68324 KiB
n,k=map(int,input().split()) disagree=[] enemies=[] for i in range(n): s=set() q=input().split() for j in range(1,len(q)): s.add(int(q[j])) enemies.append([-int(q[0]),i]) disagree.append(s) enemies=sorted(enemies) def juntar(a,comun,disagree,tam,m,k): for i in comun: m=max(m,tam+1) if(m==k): break m=juntar(i,comun&disagree[i],disagree,tam+1,m,k) return m m=1 for i in range(n): a=enemies[i][1] m=juntar(a,disagree[a],disagree,1,m,k) if(m==k): break print(m)
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...