05 2009 档案
pku3734---Blocks
摘要:题目:DescriptionPanda has received an assignment of painting a line of blocks. Since Panda is such an intelligent boy, he starts to think of a math problem of painting. Suppose there are N blocks in a l... 阅读全文
posted @ 2009-05-20 20:08 pandy 阅读(352) 评论(0) 推荐(0)
zoj 2744
摘要:[代码] 阅读全文
posted @ 2009-05-20 10:47 pandy 阅读(194) 评论(0) 推荐(0)
zoj2740
摘要:[代码] 阅读全文
posted @ 2009-05-19 22:49 pandy 阅读(199) 评论(0) 推荐(0)
STL-----multiset <example>
摘要:zjut1204[代码] 阅读全文
posted @ 2009-05-10 22:35 pandy 阅读(219) 评论(0) 推荐(0)
混合图欧拉回路
摘要:相关题目:pku1637,zju1992欧拉回路相关资料:判断一个图中是否存在欧拉回路(每条边恰好只走一次,并能回到出发点的路径),在以下三种情况中有三种不同的算法: 一、无向图每个顶点的度数都是偶数,则存在欧拉回路。二、有向图(所有边都是单向的)每个节顶点的入度都等于出度,则存在欧拉回路。三.混合图欧拉回路  混合图欧拉回路用的是网络流。  把该图的无向边随便定向,计算每个点的入度和出度。如果有... 阅读全文
posted @ 2009-05-07 21:09 pandy 阅读(2409) 评论(1) 推荐(1)
网络流入门----pku1273
摘要:[代码]题目地址:http://acm.pku.edu.cn/JudgeOnline/problem?id=1273 阅读全文
posted @ 2009-05-07 16:43 pandy 阅读(476) 评论(2) 推荐(0)
A STAR +dijkstra搜索 解决k短路径问题
摘要:[代码]题目链接:http://acm.pku.edu.cn/JudgeOnline/problem?id=2449 阅读全文
posted @ 2009-05-07 13:44 pandy 阅读(619) 评论(0) 推荐(0)
Lost II----求有向图的连通分量个数---zjfc
摘要:题目描述 We get lost again , we can not find our friends...But luckly , we have mobile phone.They are moving by group,and we know our friend in the same group can connect with each other in directly or in... 阅读全文
posted @ 2009-05-02 01:12 pandy 阅读(753) 评论(1) 推荐(0)
Just for fun----zjfc 并查集操作
摘要:题目描述When I boring , I'm crazy...So I design a BT game just for fun...It's easy...输入描述 First line is a interger T <=20 ;T case follow ,each case begin with the interger N(N<=100000) , as the max ... 阅读全文
posted @ 2009-05-02 01:04 pandy 阅读(350) 评论(0) 推荐(0)
I won't tell you this is about graph theory----zjfc bellman-ford算法与spfa算法
摘要:题目描述 To think of a beautiful problem description is so hard for me that let's just drop them off. :)Now we have the path from one point to another(directly), and the weight we cost.Tell me the min wei... 阅读全文
posted @ 2009-05-02 00:42 pandy 阅读(713) 评论(0) 推荐(0)
Flood---ZJFC Weekly - 5
摘要:题目描述 The Flood come from the border of the map, so tell me the area without flood...Do u think it's easy ? 输入描述 First T("#"),最后统计地图中"."的个数并是结果了 代码如下: Code Code highlighting produced by A... 阅读全文
posted @ 2009-05-02 00:24 pandy 阅读(153) 评论(0) 推荐(0)
zjfc---1120 对称串
摘要:题目描述 有一些字串,有些对称,有些不对称,请将对称的串按长度排列。 输入描述 输入为多行,每行一个串,串的长度不超过200,处理到文件结束 输出描述 输出对称的串,并且按串的长度升序排列,如果串长度相同,则按输入的顺序输出 样例输入 123321 123454321 123 321 sdfsdfd 121212 \\dd\\ 样例输出 123321 \\dd\... 阅读全文
posted @ 2009-05-01 10:14 pandy 阅读(367) 评论(0) 推荐(0)
string(转载)
摘要:详细解说STL string 详细解说STL string 0 前言: string 的角色 1 string 使用 1.1 充分使用string 操作符 1.2 眼花缭乱的string find 函数 1.3 string insert, replac... 阅读全文
posted @ 2009-05-01 10:10 pandy 阅读(249) 评论(0) 推荐(0)
set and map
摘要:SET 一个集合(set)是一个容器,它其中所包含的元素的值是唯一的。这在收集一个数据的具体值的时候是有用的。集合中的元素按一定的顺序排列,并被作为集合中的实例。如果你需要一个键/值对(pair)来存储数据,map是一个更好的选择。一个集合通过一个链表来组织,在插入操作和删除操作上比向量(vector)快,但查找或添加末尾的元素时会有些慢。 下面是一个例子: ... 阅读全文
posted @ 2009-05-01 08:49 pandy 阅读(223) 评论(0) 推荐(0)
zjfc-1108,hdu-1222 wolf and rabbits
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1222 理解题目: 当两者公约数为1,不存在安全洞。 不为1时,存在安全洞。 #include int gcd(int n,int m) { if(m==0) return n; return gcd(m,n%m); } int main() { int a,b,t; scanf("%d",&t); w... 阅读全文
posted @ 2009-05-01 01:04 pandy 阅读(310) 评论(0) 推荐(0)