Aizu - 2306 Rabbit Party (DFS图论)】的更多相关文章

G. Rabbit Party Time Limit: 5000ms Case Time Limit: 5000ms Memory Limit: 65536KB 64-bit integer IO format: %lld      Java class name: Main Submit Status pid=39423" class="goprob button ui-button ui-widget ui-state-default ui-corner-all ui-button…
Rabbit Party Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93265#problem/G Description A rabbit Taro decided to hold a party and invite some friends as guests. He has n rabbit friends, and m pairs o…
Sleeping Time Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93265#problem/B Description Miki is a high school student. She has a part time job, so she cannot take enough sleep on weekdays. She wants…
Description 题意:给定一个点数为n的竞赛图,求图的最小支配集 n<=75 Solution 如果将竞赛图的一个点删去,这个图还是竞赛图 而竞赛图每个点相连的边数为(n-1),那么删去一个点后这个图变成原图一半大小的竞赛图 由此可知竞赛图的最小支配集是log(n)级别的 那么答案最大为6,爆搜即可 Code #include <cstdio> #include <algorithm> #include <cstring> #include <bit…
原题链接:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2300 题意: 给你一个图,让你生成一个完全子图.使得这个子图中每个点的最小边的和最大..好拗口,但是就是这么回事.. 题解: 就直接dfs就好,搜啊搜啊,就做出来了. 代码: #include<iostream> #include<cstring> #include<algorithm> #include<cstdio> #defi…
LINK:Quantifier Question 题面过长 引起不适 读题花了好长时间 对于 和 存在符合不是很熟练 导致很懵逼的做完了. 好在还算很好想.不过wa到了一个坑点上面 自闭一大晌 还以为自己思路错了 看了某个强者的blog才知道自己有个地方没处理好. 题目中明确指出 这种关系运算符只能顺序的添加 也就是说 \(\forall x_2\exists x_1\) 这是不能被表达的 只能表达出\(\exists x_1\forall x_2\) 如果有题目中的f函数 那么后者将会被判定为…
http://www.lydsy.com/JudgeOnline/problem.php?id=1064 题意: 思路: 考虑以下几种情况: ①无环并且是树: 无环的话就是树结构了,树结构的话想一下就知道它的k最大值就是它的最长链,最小值就是3(如果链长>=3的话),如果有多棵树,只需要把它们的最长链加起来即可. ②存在环并且顺序相同 这种情况下的话k肯定是环长的约数,有多个环时就是它们之间的最大公约数.这样找最大和最小的约数即可. ③存在环并且顺序不同 上面这个图的话就不是一个简单的单顺序的环…
Description There are n cities and m two-way roads in Berland, each road connects two cities. It is known that there is no more than one road connecting each pair of cities, and there is no road which connects the city with itself. It is possible tha…
CF首次推出div3给我这种辣鸡做,当然得写份博客纪念下 A. Wrong Subtraction time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little girl Tanya is learning how to decrease a number by one, but she does it wrong with a…
PAT甲级最短路 主要算法:dijkstra 求最短最长路.dfs图论搜索. 1018,dijkstra记录路径 + dfs搜索路径最值 25分,错误点暂时找不出.. 如果只用dijkstra没法做,只能得20分 #include<bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f; const int maxn = 510; int cmax,n,ter,m; int caps[maxn]; int g[maxn][m…