摘要: Description描述Two of the three members of the winning team of one of the ACM regional contests are going to meet in order to train for the upcoming Wor... 阅读全文
posted @ 2015-07-22 20:46 Ivy_End 阅读(257) 评论(0) 推荐(0) 编辑
摘要: Description描述Let P1, P2, … ,PN, … be a sequence of prime numbers. Super-prime number is such a prime number that its current number in prime numbers s... 阅读全文
posted @ 2015-07-20 13:39 Ivy_End 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 很久以前刷完了Virtual Judge上的简单搜索专题,现总结如下:POJ 1321由于题目的数据范围比较小,可以直接dfs暴力。读入时记录每个空位的位置,保存在pX[]以及pY[]数组中。暴力的时候统计当前处理第几个空格以及当前处理到了第几行即可。#include #include using ... 阅读全文
posted @ 2015-06-08 21:57 Ivy_End 阅读(494) 评论(0) 推荐(0) 编辑
摘要: 最近主要刷一下动态规划专题,题目来自于HDU。HDU 2955这是一道概率DP,我第一次的想法是把概率P乘以100,变成一个背包然后做0-1背包,后来发现这样做是错误的。原因:概率应该是相乘,而不是相加。后来看了题解想到了另外一种方法,使用逃脱概率来计算,用f[j]表示偷走j价值后逃脱的概率。易知,... 阅读全文
posted @ 2015-03-14 13:22 Ivy_End 阅读(242) 评论(1) 推荐(0) 编辑
摘要: Description描述Every city in Berland is situated on Ox axis. The government of the country decided to build new telecasting station. After many experime... 阅读全文
posted @ 2015-03-13 19:37 Ivy_End 阅读(431) 评论(0) 推荐(0) 编辑
摘要: Description描述Inspired by a "Little Bishops" problem, Petya now wants to solve problem for rooks.A rook is a piece used in the game of chess which is p... 阅读全文
posted @ 2015-03-07 14:26 Ivy_End 阅读(278) 评论(0) 推荐(0) 编辑
摘要: Description描述You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2... 阅读全文
posted @ 2015-03-07 13:18 Ivy_End 阅读(243) 评论(0) 推荐(0) 编辑
摘要: Description描述On a circle border there are 2k different points A1, A2, ..., A2k, located contiguously. These points connect k chords so that each of po... 阅读全文
posted @ 2015-03-07 11:04 Ivy_End 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Description描述Famous Berland ACM-ICPC team Anisovka consists of three programmers: Andrew, Michael and Ilya. A long time ago, during the first few mont... 阅读全文
posted @ 2015-03-07 09:48 Ivy_End 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Description描述There are two boxes. There are A balls in the first box, and B balls in the second box (0 using namespace std;const int MAX = 32;int main... 阅读全文
posted @ 2015-03-07 09:28 Ivy_End 阅读(199) 评论(0) 推荐(0) 编辑