上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页
摘要: 链接: http://poj.org/problem?id=2752 题意: 求一个串所有的前缀等于后缀的子串长度 题解: 求一个next数组,然后递归输出就行了 代码: 阅读全文
posted @ 2017-04-24 19:48 Flowersea 阅读(151) 评论(2) 推荐(0) 编辑
摘要: 链接: http://poj.org/problem?id=2823 题意: 给定一个长度为n的数列,a0,a1,···,an-1和一个整数k。 求数列bi=min{ai,ai+1,···,ai+k-1}(i=0,1,···,n-k) 和数列ci=max{ai,ai+1,···,ai+k-1}(i= 阅读全文
posted @ 2017-04-24 15:28 Flowersea 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 链接: http://poj.org/problem?id=3250 题意: 一群牛排成一列,每头牛都往下看,只要他比下面的牛高,就能看到那头牛的头发 问所有的牛一共能看到多少头牛的头发 题解: 用栈模拟,只要当前牛的高度大于栈顶的牛的高度,就pop,否者push 这个时候栈里的高度是单调递减的,a 阅读全文
posted @ 2017-04-24 14:09 Flowersea 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 31 class Solution { 32 public: 33 string intToRoman(int num) { 34 char* c[4][10] = { 35 { "","I","II","III","IV","V","VI","VII","VIII","IX" }, 36 { "","X","XX","XX.. 阅读全文
posted @ 2017-04-24 13:46 Flowersea 阅读(498) 评论(0) 推荐(0) 编辑
摘要: 链接: http://poj.org/problem?id=1986 代码: 阅读全文
posted @ 2017-04-24 11:36 Flowersea 阅读(168) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define rep(i,a,n) for (int i=a;i=a;i-... 阅读全文
posted @ 2017-04-23 23:26 Flowersea 阅读(403) 评论(0) 推荐(0) 编辑
摘要: 链接: http://poj.org/problem?id=1236 代码: 阅读全文
posted @ 2017-04-23 23:15 Flowersea 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 题目提交地址:http://218.28.220.249:50015/JudgeOnline/problemset.php?page=3 问题 A: 饶学妹的比赛 题意: 给你一场比赛每人提交的记录,计算最后的排名 题解: 模拟+排序 代码: 问题 B: 地狱飞龙 题意: 有一头龙从(0,0)往y轴 阅读全文
posted @ 2017-04-23 18:19 Flowersea 阅读(693) 评论(0) 推荐(0) 编辑
摘要: 什么是数值积分 数值积分可以用来求定积分的近似值。对于很多函数来说,我们是可以使用初等函数来表示出其积分的,对于这种函数,只需要求出不定积分然后代入值就能得到定积分了。 可是除此之外还有许多难求的函数和没法使用初等函数表示的函数。当我们想要求出它们的定积分的时候,需要使用数值积分来求解。 在ACM中 阅读全文
posted @ 2017-04-23 12:42 Flowersea 阅读(574) 评论(0) 推荐(0) 编辑
摘要: 链接: http://poj.org/problem?id=3537 题意: 有个2人玩的游戏在一个规模为1*n的棋盘上进行,每次一个人选择一个地方画上’X’,一旦某个人画上X后出现了连续3个X,那么这个人就赢了。 题解: 仔细思考一下我们发现,xxx的上一步只能是oxx,xox,xxo的其中一种, 阅读全文
posted @ 2017-04-23 11:28 Flowersea 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 博弈论是二人或多人在平等的对局中各自利用对方的策略变换自己的对抗策略,达到取胜目标的理论。 基础的基础 a) 当前执行者想赢。这个是必要的,有时候题目中判别胜负的条件会与平时练习的恰好相反,此时你就应该按照题目要求思考,即在经典模型中思考当前执行者想输的策略。 b) 定义P-position和N-p 阅读全文
posted @ 2017-04-23 10:50 Flowersea 阅读(368) 评论(0) 推荐(0) 编辑
摘要: 链接: http://acm.hdu.edu.cn/showproblem.php?pid=3966 代码: 阅读全文
posted @ 2017-04-21 19:18 Flowersea 阅读(190) 评论(4) 推荐(1) 编辑
摘要: 链接: http://poj.org/problem?id=3713 题意: 给出一个无向图(可能不联通),判断是否每两个点之间都能至少有3条独立不同的路径可达。独立定义为任意两条路径只有起点和 终点相同,其他点均不相同。 思路: 图的三联通判断。枚举删去一个点看是否存在割点,如果存在那么说明不满足 阅读全文
posted @ 2017-04-20 20:52 Flowersea 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 链接: http://hihocoder.com/problemset/problem/1183 代码: 阅读全文
posted @ 2017-04-20 19:04 Flowersea 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 连接: http://codeforces.com/contest/797/problem/E 题意: 给你一个a数组,q次询问,每次给你个p,k 每次操作使p=p+a[p]+k,直到p大于n为止 问一共操作了多少次 题解: 先预处理k不超过325时候的答案,当k大于325的时候就暴力算 代码: 阅读全文
posted @ 2017-04-20 17:31 Flowersea 阅读(159) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页