poj 3126 Prime Path
摘要:看题目。。。看解题报告。。。敲。。。。题意转自:優YoU http://user.qzone.qq.com/289065406/blog/1303623014大致题意:给定两个四位素数a b,要求把a变换到b变换的过程要保证 每次变换出来的数都是一个 四位素数,而且当前这步的变换所得的素数 与 前一...
阅读全文
posted @
2013-08-28 15:15
Fann0221
阅读(209)
推荐(0)
poj 1426 Find The Multiple
摘要:好吧,我承认,这道题是水过。。。我就直接暴力了。。。还过了。。。题目: Find The MultipleTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 15361Accepted: 6315Special JudgeDescriptionGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. Yo
阅读全文
posted @
2013-08-27 10:39
Fann0221
阅读(176)
推荐(0)
poj 2251 Dungeon Master
摘要:救命啊!!继续不懂。。继续看题解。。。题目大意转自:優YoU http://user.qzone.qq.com/289065406/blog/1303446571题目大意: 给出一三维空间的地牢,要求求出由字符'S'到字符'E'的最短路径移动方向可以是上,下,左,右,前,后,六个方向每移动一次就耗费...
阅读全文
posted @
2013-08-26 20:11
Fann0221
阅读(292)
推荐(0)
poj 2488 A Knight's Journey
摘要:题意转载于:優YoU http://user.qzone.qq.com/289065406/blog/1303350143大致题意:给出一个国际棋盘的大小,判断马能否不重复的走过所有格,并记录下其中按字典序排列的第一种路径。解题思路:难度不大,但要注意的地方有3点:1、 题目要求以"lexicogr...
阅读全文
posted @
2013-08-26 11:08
Fann0221
阅读(357)
推荐(0)
poj 3349
摘要:大致题意:在n (n 3 #include 4 #include 5 #include 6 const int INF=1000007; 7 int flag,t; 8 int hash[INF]; 9 10 int s[INF][6];11 int st[INF][6];12 int next[I...
阅读全文
posted @
2013-08-23 15:57
Fann0221
阅读(223)
推荐(0)
poj 2442
摘要:题意:给你n*m的矩阵,然后每行取一个元素,组成一个包含n个元素的序列,一共有n^m种序列,让你求出序列和最小的前n个序列的序列和。stl中优先队列的应用;#include#includepriority_queue,less >que;代码如下: 1 #include 2 #include 3...
阅读全文
posted @
2013-08-19 20:07
Fann0221
阅读(290)
推荐(0)
poj 3274 Gold Balanced Lineup
摘要:题意:代码操作如下:1、先将十进制数转换成二进制数记录保存。2、然后逐行累加,得出到某只牛时某种特征出现了几次。3、每行减去第一个数,得出一个序列,若两头牛之间是平衡区间的话,各个特征的增长数是相等的,及减掉第一个数得出来的序列是相等的。4、寻找距离最远的两个相等的序列,得出答案。我们可以由样例举例:转换成二进制特征值为:数字 特征值 第几头牛 7 1 1 1 1 6 0 1 1 2 7 1 1 1 3 2 0 1 0 4 1 1 0 0 5 4 0 0 1 6...
阅读全文
posted @
2013-08-19 15:43
Fann0221
阅读(187)
推荐(0)
优先队列
摘要:priority_queue:优先队列顾名思义,这个东西可以用于存放单调的数据,后面将会看到用于优化Dijkstra有3个类函数:void push(元素类型 变量)void pop()int top()int size()bool empty()分别是:加入类型是XXX的变量XXX弹出队列首元素取优先队列的队首元素的值返回队列元素数量查看队列是否为空定义:priority_queue priority_queuepriority_queue数据类型:int,double.....容器类型:vector(默认),deque,但不能是list元素比较方式:less(默认,不上升序),great.
阅读全文
posted @
2013-08-08 19:51
Fann0221
阅读(218)
推荐(1)
poj 1753 、poj 2965 (枚举)(位运算)
摘要:位运算资料 :http://baike.baidu.com/view/379209.htm(百度百科)poj 1753 Flip Gamehttp://poj.org/problem?id=1753 1 #include 2 #include 3 #include 4 #include 5 usin...
阅读全文
posted @
2013-08-08 16:23
Fann0221
阅读(316)
推荐(0)
模拟题 poj 1068、 2632 、 1573、 2993、 2996
摘要:poj 1068 Parencodingshttp://poj.org/problem?id=1068 1 #include 2 #include 3 #include 4 int vis[100]; 5 int q[100]; 6 void chack(char str[]) 7 { 8 9 int count=0;10 int i,j,k,d;11 int len=strlen(str);12 for(i=0;i=0;j--)18 {19 if(str[j]=='('&&!vis[j])2...
阅读全文
posted @
2013-08-08 15:57
Fann0221
阅读(258)
推荐(0)