自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

ayu的博客

偶尔思考人生~

  • 博客(25)
  • 收藏
  • 关注

原创 九度OJ 1482 BFS+HASH

题目1482:玛雅人的密码时间限制:1 秒内存限制:128 兆特殊判题:否提交:3904解决:972题目描述:玛雅人有一种密码,如果字符串中出现连续的2012四个数字就能解开密码。给一个长度为N的字符串,(2=输入:输入包含多组测试数据,每组测试数据由两行组成。第一行为一个整数N,代表字符串的长度(2

2017-09-16 17:36:37 261

原创 POJ3083 DFS+BFS

Children of the Candy CornTime Limit:1000MSMemory Limit:65536KTotal Submissions:14239Accepted:6157DescriptionThe cornfield maze is a popular Halloween treat

2017-09-16 09:52:52 217

原创 POJ1233 Prim Kruskal

还是畅通工程Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 49358    Accepted Submission(s): 22539Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距

2017-09-16 08:14:57 230

原创 HDU1232 Prim

畅通工程Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 57583    Accepted Submission(s): 30795Problem Description某省调查城镇交通状况,得到现有城镇道路

2017-09-16 07:13:31 215

原创 POJ1231 max sum sequences DP

最大连续子序列Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 34628    Accepted Submission(s): 15711Problem Description给定K个整数的序列{ N1, N

2017-09-16 01:38:38 415

原创 POJ1753 枚举

Flip GameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 46853 Accepted: 20050DescriptionFlip game is played on a rectangular 4x4 field with two-sided p

2017-09-15 18:58:21 235

原创 poj1595 素数打表

Prime CutsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11673 Accepted: 4446DescriptionA prime number is a counting number (1, 2, 3, ...) that is even

2017-09-14 20:10:30 165

原创 poj3006 素数

Dirichlet's Theorem on Arithmetic ProgressionsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 19139 Accepted: 9613DescriptionIf a and d are relatively p

2017-09-14 19:46:13 146

原创 poj2251 BFS大法好

Dungeon MasterTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 37528 Accepted: 14351DescriptionYou are trapped in a 3D dungeon and need to find the quick

2017-09-14 01:10:42 192

原创 poj1321 DFS

棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 50621 Accepted: 24518Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求

2017-09-13 22:50:47 154

原创 八数码 BFS+HASH

#include#include#include //getline在这里 #define maxn 1000000#define hasn 1000003using namespace std;typedef int st[9];st queue[maxn];int dir[2][4] = {0,0,-1,1,1,-1,0,0};//下、右、上、左 char *prnt =

2017-09-13 21:12:57 414

原创 poj2533 最最最基础的最长上升子序列 普通版+二分法版

Longest Ordered SubsequenceTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 55298 Accepted: 24789DescriptionA numeric sequence of ai is ordered if a1 a2 

2017-09-12 22:13:39 157

原创 分段上升子序列,二次DP (poj1239)(留坑待完善。。。)

dp经典题。思路是对的但要改一下数据存储方式。。因为80个字符表示的数字int放不下。。。。#include#include#include#include#define maxn 100using namespace std;char a[maxn];int len,last;int bk[maxn];int v[maxn][maxn],front[max

2017-09-12 21:51:20 182

原创 poj1458 LCS 基础dp

Common SubsequenceTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 54939 Accepted: 22901DescriptionA subsequence of a given sequence is the given sequenc

2017-09-12 10:03:13 154

原创 poj1006 模拟

BiorhythmsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 138991 Accepted: 44608DescriptionSome people believe that there are three cycles in a person's

2017-09-11 21:40:37 250

原创 POJ1276 多重背包

Cash MachineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 36959 Accepted: 13408DescriptionA Bank plans to install a machine for cash withdrawal. The m

2017-09-10 20:55:25 234

原创 poj3181 完全背包+整数拆分

Dollar DayzTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7840 Accepted: 2922DescriptionFarmer John goes to Dollar Days at The Cow Store and discovers

2017-09-10 19:31:59 266

原创 poj3624 基础01背包问题 闲来无事划划水啦~

Charm BraceletTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 41224 Accepted: 17934DescriptionBessie has gone to the mall's jewelry store and spies a

2017-09-10 17:24:53 258

原创 ccf 交通规划 dijkstra+最小路径花费

优先队列+邻接链表实现的dijkstra,在判断优先级时增加对该条路径花费的判断,如果最短路径相同,添加最小花费路径。真是力不从心了,写个最短路径都写了一下午,默默吐槽一下自己。。#include#include#include#include#define maxn 10005#define inf 1<<27using namespace std;struct node{

2017-09-07 17:31:16 463

原创 ccf 201612-4 压缩编码 石子合并问题(DP+平行四边形优化)

学无止境~平行四边形优化为啥成立还在思考中~//石子问题 平行四边形优化 #include#define maxn 1002#define inf 0x3fffffff#define min(a,b) a<b?a:busing namespace std;int n;int a[maxn],dp[maxn][maxn],p[maxn][maxn],sum[maxn];int

2017-09-07 00:06:00 285

原创 hdu1026 BFS+路径保存

啊!!想抽自己!又是这种字符型迷宫的输入!!老是忘记getchar()会把空格回车都算进去!!!新get路径保存的方法。。原来不用每个节点存路径。。。暴风哭泣//递归打印路径。学习了#include#include#include#define maxn 102using namespace std;struct node{ int x,y,sec; node(int xx

2017-09-06 21:35:56 282

原创 hdu1016 DFS+素数判断

总是不好好审题。总结一下自己不看题容易犯的错:1.漏掉某个重要条件。如此题的必须为1开头,之前还有一道迷宫题也是。2.打印格式问题3.可能是多个样例输入  !!! 在这点上栽了很多次了。4.不同答案的英文格式问题。此题是最简单的DFS+素数判断,素数直接照搬之前学习的一个单个素数判断方法,非常强悍~//hdu1016 单个素数判断+搜索#include#inc

2017-09-06 20:13:44 226

原创 hdu1025 最长上升子序列 O(nlogn)优化版

这题坑点挺多。首先,输入很大,虽然看懂了是最长上升子序列,但第一次用朴素查找,妥妥的超时了。。学习一下二分查找LIS,可以优化到O(nlogn)。还有就是英文输出时,一定要注意复数复数!!之前有道题也是用到各种数序的英文输出。不注意的话就会WA。二分查找LIS,其实就是拿一个数组f[],下标表示长度,存放该长度序列的末尾数。该数组存放的末尾数也一定是递增的。#inc

2017-09-06 16:41:22 276

原创 hdu1042 n! 大整数阶乘

其实就是大整数和非大整数相乘要注意更新数组长度#include#include#define maxn 40002using namespace std;static int sum[maxn];void cal(int n){ memset(sum,0,sizeof(sum)); int len = 1; sum[0] = 1; int ca = 0; for(int

2017-09-06 14:12:45 190

原创 hdu1002 大整数加法

有很多小细节需要注意:1.去除前导零2.翻转时的char与int变换#include#include#include#define maxn 1002using namespace std;char aa[maxn],bb[maxn];int sum[maxn],a[maxn],b[maxn];int main(){ int n; scanf("%d",&n); f

2017-09-06 13:52:07 291

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除