Codeforces Round #236 402C - Searching for Graph

来源:互联网 发布:网络追逃 编辑:程序博客网 时间:2024/05/18 03:09

题目链接:http://codeforces.com/problemset/problem/402/C

莫名其妙的过了。。。。。。。尴尬尴尬只能想明白前两个条件,第三个想不出来了。。。。大概就是不能让边太密集。。第一次过掉C题

AC代码:

#include<stdio.h>int main(){    int t;    scanf("%d",&t);    while(t--)    {        int n,p;        scanf("%d%d",&n,&p);        int i,j,a=1,b=2,c;        for(i=0;i<2*n+p;i++)        {            printf("%d %d\n",a,b);            b++;            if(b>n)            {                a++;b=a+1;            }        }    }    return 0;}


 

0 0
原创粉丝点击