### 题目描述

Panel 国每年举办名为 Number Games的节目，全国每个区都将派出一名代表参赛。

6 3
2 1
2 6
4 2
5 6
2 3

1 3 4

### 代码

#include
#define maxn 1000100
using namespace std;
struct Edge{
int to,next;
Edge(int a=0,int b=0){
to=a,next=b;
}
}l[maxn*2];
bool vis[maxn];
}
void dfs(int u,int f){
p[u][0]=f;
for (int i=1;i<=20;i++)
p[u][i]=p[p[u][i-1]][i-1];
if (l[i].to!=f) dfs(l[i].to,u);
}
int main(){
ios::sync_with_stdio(false);
cin>>n>>k; int t1,t2;
for (int i=1;i>t1>>t2;
}
dfs(n,0);int res=n-k-1;vis[n]=1;
for (int v=n-1;v>=1;v--){
int x=v,t=v,dis=0;
if (vis[x]) continue;
for (int i=20;i>=0;i--){
if (!p[x][i]) continue;
if (!vis[p[x][i]]) x=p[x][i],dis+=(1<res) continue;res-=dis;
while(t!=x) vis[t]=1,t=p[t][0];
}
for (int i=1;i<=n;i++)
if (!vis[i]) cout<
 
 Share Show Comments 【CodeVS 1922】骑士共存问题 / 题解 洛谷原题 CodeVS 原题 题目描述 在一个 $n*n$ 个方格的国际象棋棋盘上，马（骑士）可以攻击的棋盘方格如图所示。棋盘上某些方格设置了障碍，… 13 Jul 2018 【CodeForces 980D】Perfect Groups / 题解 原题地址 题目描述 注意: 不易于人类理解题意，所以我就不翻译了。 SaMer has written the greatest test case… 11 Jul 2018 
 
 
 Topics Thought: 30 Study: 26 Selected: 26 Zepto's © 2022 Sponsor Data & privacy Contact → Published with Ghost • Theme Attila • System theme 
 $(document).ready(function () { var viewport =$(window); var post = $('.post-content'); // Responsive videos with fitVids post.fitVids(); // Format code blocks and add line numbers function codestyling() {$('pre code').each(function(i, e) { // Code highlight hljs.highlightBlock(e); // No lines for plain text blocks if (!$(this).hasClass('language-text')) { var code =$(this); // Calculate amount of lines var lines = code.html().split(/\n(?!$)/g).length; var numbers = []; if (lines > 1) { lines++; } for (i = 1; i < lines; i++) { numbers += '<span class="line" aria-hidden="true">' + i + '</span>'; } code.parent().append('<div class="lines">' + numbers + '</div>'); } }); } codestyling(); // Reading progress bar on window top function readingProgress() { var postBottom = post.offset().top + post.height(); var viewportHeight = viewport.height(); var progress = 100 - (((postBottom - (viewport.scrollTop() + viewportHeight) + viewportHeight / 3) / (postBottom - viewportHeight + viewportHeight / 3)) * 100);$('.progress-bar').css('width', progress + '%'); (progress > 100) ? $('.progress-container').addClass('complete'):$('.progress-container').removeClass('complete'); } readingProgress(); // Trigger reading progress viewport.on({ 'scroll': function() { readingProgress(); }, 'resize': function() { readingProgress(); }, 'orientationchange': function() { readingProgress(); } }); // Check if disqus is defined by code injection if (typeof disqus === 'undefined') { // hide comment section $('.post-comments').css({ 'display': 'none' }); } else {$('#show-disqus').on('click', function() { $.ajax({ type: "GET", url: "//" + disqus + ".disqus.com/embed.js", dataType: "script", cache: true });$(this).parent().addClass('activated'); }); } });