把v和2结点交换,

1和v连,其它点和v之间能够互相连。

#include <iostream>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std; int n,m,v,flag,i,cnt,j; int main()
{
while(~scanf("%d%d%d",&n,&m,&v))
{
flag=0;
if((n-1)*(n-2)/2+1<m) flag=1;
if(m<n-1) flag=1;
if(flag)
{
printf("-1\n");
continue;
}
cnt=n-1;
for(i=1;i<n;i++)
{
if(i==2) printf("%d ",v);
else if(i==v) printf("%d ",2);
else printf("%d ",i);
if(i+1==2) printf("%d\n",v);
else if(i+1==v) printf("%d\n",2);
else printf("%d\n",i+1);
}
for(i=2;i<n&&cnt!=m;i++)
{
for(j=i+2;j<=n&&cnt!=m;j++)
{
cnt++;
if(i==2) printf("%d ",v);
else if(i==v) printf("%d ",2);
else printf("%d ",i);
if(j==2) printf("%d\n",v);
else if(j==v) printf("%d\n",2);
else printf("%d\n",j);
}
}
}
return 0;
}

CodeForces 22C System Administrator的更多相关文章

  1. codeforces 22C System Administrator(构造水题)

    转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud System Administrator Bob got a job as a s ...

  2. 解决方法:An error occurred on the server when processing the URL. Please contact the system administrator

    在WINDOWS7或SERVER2008上安装了IIS7.5,调试ASP程序时出现以下错误: An error occurred on the server when processing the U ...

  3. Requirements of an SAP system administrator

    Requirements of an SAP system administrator Have a "proper" attitude Protect and safeguard ...

  4. the account is currently locked out. The system administrator can unlock it.

    今天遇到的问题比较有意思.首先是很久没有打开测试数据库了,今天打开,使用service程序测试的时候出现下面的错误提示:Message: System.Data.SqlClient.SqlExcept ...

  5. 解决IIS7运行ASP提示错误:An error occurred on the server when processing the URL. Please contact the system administrator

    原文:解决IIS7运行ASP提示错误:An error occurred on the server when processing the URL. Please contact the syste ...

  6. SQL点滴8—the account is currently locked out. The system administrator can unlock it.

    原文:SQL点滴8-the account is currently locked out. The system administrator can unlock it. 今天遇到的问题比较有意思. ...

  7. The Windows account sa does not exist and cannot be provisioned as a SQL Server system administrator

    今天遇到一个案例,在使用命令修改一个测试服务器(SQL Server 2014标准版)的服务器排序规则时,遇到了下面错误信息 (具体账号信息脱敏处理,随机生成一个账号密码) The Windows a ...

  8. cvsnt报错:Administrator: Switch to user failed due to configuration error. Contact your System Administrator

    在安装CVSNT一开始用Administrator登录时总是报[login aborted]Switch to user failed due to configuration error. Cont ...

  9. Sql server 账号被锁住:"the account is currently locked out. The system administrator can unlock it."的解决办法(转载)

    今天遇到的问题比较有意思.首先是很久没有打开测试数据库了,今天打开,使用service程序测试的时候出现下面的错误提示:Message: System.Data.SqlClient.SqlExcept ...

随机推荐

  1. 2 kNN-K-Nearest Neighbors algorithm k邻近算法(二)

    2.3 示例:手写识别系统 2.3 .1 准备数据:将图像转换为测试向量 训练样本:trainingDigits 2000个例子,每个数字大约200个样本 测试数据:testDigits 大约900个 ...

  2. linux 关于动态库的知识

    问题起缘于编译一个程序时,使用glib2-2.28.8的动态库,而系统自带的是glib2-2.22.5 不想升级系统的glib2库,而使用程序自带库文件的方式加载(类似windows系统,优先加载当前 ...

  3. Core开发-MVC 使用dotnet 命令创建Controller和View

    NET Core开发-MVC 使用dotnet 命令创建Controller和View   使用dotnet 命令在ASP.NET Core MVC 中创建Controller和View,之前讲解过使 ...

  4. SQL Server MYSQL 检查点的好处

    执行检查点时: 如果一个事务不没有提交.日志缓存还是会被更新到磁盘上的物理文件. 这样做就使得大事务commit 时也特别快!

  5. mysql binlog 混合模式 出现的基于sql的数据不一致,主要是now()这类函数导致

  6. JAVA实现字符串反转,借助字符数组实现

    public static String reverseStr(String str) { int len = str.length(); char ch[] = str.toCharArray(); ...

  7. 接着上一个版本在上一个分离access-token和ticket的版本

    上代码: 本次修改将获取token和ticket分离出来,分别封装在函数中: 每个函数最后一个参数是一个回调参数: 回调函数的参数,是这一步中需要处理的结果; 结果怎么处理,根据传递进去的函数: va ...

  8. ebs清除并法管理器所清除的表

    In this Document   Goal   Solution   References Applies to: Oracle Concurrent Processing - Version 1 ...

  9. 跟我一起学extjs5(16--各种Grid列的自己定义渲染)

    跟我一起学extjs5(16--各种Grid列的自己定义渲染)         Grid各列已经可以展示出来了.列的类型包含字符型,整型,浮点型,货币型,百分比型,日期型和布尔型,我自己定义了各种类型 ...

  10. CF Codeforces Round #258 (Div. 2) B (451B)

    题意:找出一段逆序! 预存a[]数组到b[]数组.将b排序,然后前后找不同找到区间[l,r],然后推断[l,r]是否逆序就能够了!.当然还得特判本身就是顺序的!! ! AC代码例如以下: #inclu ...