“玲珑杯”ACM比赛 Round #4 F -- My-graph【图的同构(构造)】
来源:互联网 发布:惊天战神 游戏源码 编辑:程序博客网 时间:2024/06/11 21:39
Start Time:2016-11-05 12:00:00 End Time:2016-11-05 17:00:00 Refresh Time:2016-11-06 22:00:19 Private
Time Limit:1s Memory Limit:64MByte
Submissions:359Solved:178
In graph theory, the inverse of a graph GG is a graph HH on the same vertices such that two distinct vertices of HH are adjacent if and only if they are not adjacent in GG.
My-graph is the graph that it's inverse graph is an isomorphism graph of itself.
(This is a example of My-graph has 5 nodes).
Now comes the problem: Do you have a way to make a My-graph that has nn nodes?
图的同构看书上没有具体方法判断,给出结论吧:对于任意一个有 k 个顶点的且与自己互补的图,在它外面添加一根由 4 个新顶点组成的链条 x – y – z – w ,再把顶点 x 与所有 k 个顶点都相连,把 w 也与所有 k 个顶点都相连。容易看出,整个图现在就有 k + 4 个顶点了,并且这个新的图也和自己是互补的。
AC代码:
#include<cstdio>typedef long long LL;int main(){int T; scanf("%d",&T);while(T--) { int N; scanf("%d",&N);LL ans=N*(N-1)>>1;printf((ans&1)?"no":"yes");puts("");}return 0;}
- “玲珑杯”ACM比赛 Round #4 F -- My-graph【图的同构(构造)】
- “玲珑杯”ACM比赛 Round #4
- “玲珑杯”ACM比赛 Round #4 E -- array(dp)
- 玲珑杯1052 - See car——STL集合的应用(“玲珑杯”ACM比赛 Round #4 )
- 【玲珑杯 1051】【构造】My-graph
- 玲珑杯”ACM比赛 Round #5 --2的幂次方
- “玲珑杯”ACM比赛 Round #4 A -- chess play
- “玲珑杯”ACM比赛 Round #4 G -- See car
- “玲珑杯”ACM比赛 Round #4 E题
- 玲珑杯”ACM比赛 Round #4 E -- array【DP】
- 玲珑杯”ACM比赛 Round #4 G -- See car【Set】
- “玲珑杯”ACM比赛 Round #4 B Best couple
- “玲珑杯”ACM比赛 Round #5 C -- Coco(递归)
- “玲珑杯”ACM比赛 Round #18 A(穷举)
- “玲珑杯”ACM比赛 Round #18 C(dp)
- 玲珑杯”ACM比赛 Round #5
- “玲珑杯”ACM比赛 Round #7
- “玲珑杯”ACM比赛 Round #7
- hibernate 二级缓存
- 云笔记
- pokemon shuffle c sorce 2
- SpringMVC中如何处理模型数据
- 参数传递方式
- “玲珑杯”ACM比赛 Round #4 F -- My-graph【图的同构(构造)】
- vcenter客户端控制虚拟服务器报错:“VMRC 控制台的连接已断开”
- worker process 245421 exited on signal 11
- 感悟
- C语言入门教程之三表达式和语句
- Python格式化输出
- 总结
- 单片机硬件==PCB的使用注意事项
- 优秀程序员的七大特征,你具备几条?