http://acm.hdu.edu.cn/showproblem.php?pid=6150

 #include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<map>
#include<set>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
const int maxn=+; const int n=;
struct node
{
int u,v;
}e[maxn]; int main()
{
//freopen("in.txt","r",stdin);
int cnt=n;
int e_cnt=;
for(int i=;i<=n;i++)
{
int num=n/i;
int left=;
for(int j=;j<=num;j++)
{
for(int k=;k<=i;k++)
{
e[e_cnt].u=left;
e[e_cnt].v=cnt+j;
e_cnt++;
left++;
}
}
cnt+=num;
}
printf("%d %d\n",cnt,e_cnt);
for(int i=;i<e_cnt;i++) printf("%d %d\n",e[i].u,e[i].v);
printf("%d\n",n);
for(int i=;i<=n;i++) printf("%d\n",i);
return ;
}

HDU 6150 Vertex Cover(构造)的更多相关文章

  1. HDU 6150 - Vertex Cover | 2017 中国大学生程序设计竞赛 - 网络选拔赛

    思路来自 ICPCCamp /* HDU 6150 - Vertex Cover [ 构造 ] | 2017 中国大学生程序设计竞赛 - 网络选拔赛 题意: 给了你一个贪心法找最小覆盖的算法,构造一组 ...

  2. 2017中国大学生程序设计竞赛 - 网络选拔赛 HDU 6150 Vertex Cover 二分图,构造

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6150 题意:"最小点覆盖集"是个NP完全问题 有一个近似算法是说—每次选取度数最大 ...

  3. HDU - 6150 构造题

    最近的vj好垃圾,老崩,实名吐槽 HDU - 6150 题意:给出一个错误的求最小点覆盖的函数,需要来构造一组样例,使得那个函数跑出来的答案是正解的3倍以上. 很巧妙的构造技巧,首先想法就是弄一个二分 ...

  4. PAT-1134 Vertex Cover (图的建立 + set容器)

    A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at le ...

  5. 集合覆盖 顶点覆盖: set cover和vertex cover

    这里将讲解一下npc问题中set cover和vertex cover分别是什么. set cover: 问题定义: 实例:现在有一个集合A,其中包含了m个元素(注意,集合是无序的,并且包含的元素也是 ...

  6. URAL 2038 Minimum Vertex Cover

    2038. Minimum Vertex Cover Time limit: 1.0 secondMemory limit: 64 MB A vertex cover of a graph is a ...

  7. PAT1134:Vertex Cover

    1134. Vertex Cover (25) 时间限制 600 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A vertex ...

  8. A1134. Vertex Cover

    A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at le ...

  9. PAT A1134 Vertex Cover (25 分)——图遍历

    A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at le ...

随机推荐

  1. 十天精通CSS3(8)

    变形--旋转 rotate() 旋转rotate()函数通过指定的角度参数使元素相对原点进行旋转.它主要在二维空间内进行操作,设置一个角度值,用来指定旋转的幅度.如果这个值为正值,元素相对原点中心顺时 ...

  2. 搭建基于HTTP协议内网yum仓库

    目录 1. 前言 2. 把rpm包下载到本地 3. 配置nginx对外提供服务 4. 配置本地repo文件 5. 生成repodata信息 6. 检查及使用 7. 对管理机器上的仓库进行更新 参考资料 ...

  3. 共用tableview一个继承类里面有

    里面的复用cell会不会混在一起呢?

  4. iOS 网易彩票-4设置模块一

    概述 基本上,每一款APP都有相应的设置模块.怎么设置才能更灵活和通用呢,这也是大家一直思考的.下面说说在网易彩票中,设置模块的设置思想. 基本上有三种方案: static cell(呆板,完全没有动 ...

  5. http-equiv="Refresh" 实现定时刷新页面

    ***.html自动跳转文件代码如下: <HTML> <HEAD><META http-equiv="Refresh" content="5 ...

  6. <<Joint Deep Modeling of Users and Items Using Reviews for Recommendation>> 评论打分预测

    综述: 本文将 CNN 与 FM(Factorization Machine) 结合,基于评论文本来进行评分预测. 简介: 目前将神经网络应用推荐系统的研究工作中,有一类思路是把如CNN等神经网络作为 ...

  7. redis windows版本下载

    https://github.com/dmajkic/redis/downloads http://windows.php.net/downloads/pecl/snaps/redis/3.1.4rc ...

  8. python 不同集合上元素的迭代 chain()

    itertools.chain()可以接受一个可迭代对象列表作为输入,并返回一个迭代器,有效的屏蔽掉在多个容器中迭代细节 >>> from itertools import chai ...

  9. Java(20~24)

    1.Collection中的集合称为单列集合,Map中的集合称为双列集合(键值对集合). 2.Map常用方法:map.put()   map.get()   map.remove()   map.ke ...

  10. python之路----模块调用

    如何使用模块? 1 import 示例文件:自定义模块my_module.py,文件名my_module.py,模块名my_module #my_module.py print('from the m ...