
训练
文章平均质量分 55
王道之
物各有主,苟非吾之所有
展开
-
HDU—1711Number Sequence
Number Sequence Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 40418 Accepted Submission(s): 16667Problem Description Given two seque...原创 2018-08-19 11:40:58 · 156 阅读 · 0 评论 -
POJ 1789 Truck History
这是POJ 1789 Truck History链接题解:1、而N代表有几个点;2、7位字符为一个节点;3、两两之间的相同位上的字符不同距离加一,有几位不同距离为几。4、输出中的几分之一中的几就是最小生成树即经过所有点的最小权值和。#include<iostream>#include<cstring>#include<cstdio>using ...原创 2018-11-27 20:36:34 · 121 阅读 · 0 评论 -
POJ 1062 昂贵的聘礼
POJ 1062 昂贵的聘礼Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 57357 Accepted: 17310Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低...原创 2018-11-25 10:04:48 · 130 阅读 · 0 评论 -
POJ - 2109
Current work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these primes. Work in this area has resulted in the practical use of results from n...原创 2018-11-18 00:13:32 · 170 阅读 · 0 评论 -
POJ 3259—Wormholes
题下:POJ 3259—WormholesTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 66356 Accepted: 24748DescriptionWhile exploring his many farms, Farmer John has discovered a number of amazing wor...原创 2018-11-24 11:29:10 · 254 阅读 · 0 评论 -
POJ—1961 Period
POJ—1961 Period#include<cstdio>#include<cstring>#include<iostream>using namespace std;int next[1000005];int n;void Next(char T[]){ int i=0,j=-1; next[0]=-1; while(i<n)...原创 2018-11-24 00:56:49 · 158 阅读 · 0 评论 -
POJ-2406 Power Strings
POJ-2406 Power Strings 题解:其实就是用next把模式串标记出来,然后用如果strlen(模式串)%(strlen(模式串)-next[strlen(模式串)])==0的话,说明这个模式串可以被几个字串组合而成,而个数等于strlen(模式串)/(strlen(模式串)-next[strlen(模式串)])代码:#include<cstdio>#incl...原创 2018-11-23 22:18:30 · 154 阅读 · 0 评论 -
POJ—2752 Seek the Name, Seek the Fame
Time Limit: 2000MSMemory Limit: 65536KTotal Submissions: 24952Accepted: 12999DescriptionThe little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to...原创 2018-11-23 18:09:48 · 151 阅读 · 0 评论 -
POJ—3461 Oulipo
Time Limit: 1000MSMemory Limit: 65536KTotal Submissions: 50449Accepted: 20017DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter ‘e’. He was a ...原创 2018-11-23 17:12:56 · 169 阅读 · 0 评论 -
POJ——1088滑雪
Description Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 516 17 18 19 615 24 25 20 714 23 ...原创 2018-09-14 20:09:16 · 890 阅读 · 0 评论 -
HDU——2553N皇后
在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input 共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。 Output 共有若干行,每行一个正整数,表示对应输入行的皇后的不同放置数量。 Sample In...原创 2018-08-25 20:41:51 · 209 阅读 · 0 评论 -
dfs和bfs的总结
dfs: dfs算法是一个对连通图进行遍历的算法。它的思想是从一个被选定的点出发一条路走到底,如果得不到目的解,那就返回到上一个节点,然后换一条路继续走到底,直到找到目的解返回或者全部遍历完返回一个事先定好的值。dfs一般借用递归完成整个算法的构造。 dfs算法的一般框架经我总结大致为下:int dfs(){ If(达到目的)处理return; else { ...原创 2018-08-25 20:14:15 · 2183 阅读 · 0 评论 -
51nod——1277 字符串中的最大值
1277 字符串中的最大值 题目来源: Codility 基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 一个字符串的前缀是指包含该字符第一个字母的连续子串,例如:abcd的所有前缀为a, ab, abc, abcd。 给出一个字符串S,求其所有前缀中,字符长度与出现次数的乘积的最大值。 例如:S = “abababa” 所有的前缀如下:“a”, ...原创 2018-08-17 20:20:29 · 272 阅读 · 0 评论 -
POJ 1258 Agri—Net
这是POJ 1258 Agri—Net链接比较基础的prim算法!!#include<iostream>#include<cstring>#include<cstdio>using namespace std;#define inf 0x3f3f3f3fint n;int dis[510][510];int vis[510];int prim...原创 2018-11-27 21:04:58 · 116 阅读 · 0 评论