1641. Duties

1641

枚举

 #include <iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<stdlib.h>
#include<queue>
#include<vector>
using namespace std;
int w[][],o[];
int main()
{
int i,j,k,n,m;
scanf("%d%d%d",&n,&k,&m);
int t = ;
for(i = ; i <= n ; i++)
{
if(t>k)
t = ;
o[i] = t;
printf("%d\n",t);
t++;
}
int tt=,a=;
while()
{
if(a<=n)
{
if(a<n)
{
printf("%d %d\n",a,a+);
w[a][a+] = ;
w[a+][a] = ;
a+=;
}
else
{
printf("%d %d\n",n-,n);
w[n-][n] =;
w[n][n-] = ;
a++;
}
tt++;
}
else
{
for(i = ; i <= n ;i++)
{
for(j = ; j <= n ; j++)
if(i!=j&&!w[i][j]&&o[i]!=o[j])
{
printf("%d %d\n",i,j);
w[i][j] = ;
w[j][i] = ;
tt++;
if(tt==m)
break;
}
if(tt==m)
break;
}
}
if(tt==m)
break;
}
return ;
}
上一篇:【转】DBMS_STATS.GATHER_TABLE_STATS详解 2012-04-22 09:20:10


下一篇:anaconda-ks.cfg详解