http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5072
区域赛果然无水题
通过率最高的一道题 以为二分下就OK 然后WA了果断 外加int没用long long WA
好久没用RMQ 调试也花了一点时间,
upper——bound返回的是大于x的第一个数的下标,最大当然是返回end的位置,注意判断下
注意一点,假设...
分类:
其他好文 时间:
2014-10-07 20:01:44
阅读次数:
213
题目链接:zoj 3471 Most Powerful很经典的状态dp,使用i的二进制位表示粒子的状态,0表示存在,1表示不存在。dp[i]表示在状态i的情况下能够释放的最大的能量,注意自身不能够发生碰撞。例如4个粒子的状态1100表示第0个和第1个粒子不存在,第2、3个粒子存在则可以转移到状态11...
分类:
其他好文 时间:
2014-10-06 20:57:30
阅读次数:
175
这题,找找规律,可以发现一个斐波那契数列。按照斐波那契数列求和,知道,SUM=Fn+2-F1,于是,该长度为Fn+2的倍数。因为斐波那契数列不一定是从1开始的,而从2开始的每个数都是从1开始的倍数。于是,只需求出最大的Fn+2是长度的倍数即可。#include #include #include u...
分类:
其他好文 时间:
2014-10-06 12:01:40
阅读次数:
284
Description
Little jay really hates to deal with string. But moondy likes it very much, and she's so mischievous that she often gives jay some dull problems related to string. And one day, moondy g...
分类:
其他好文 时间:
2014-10-05 15:19:28
阅读次数:
279
题目:有2中面条各n碗,每次抛硬币判断吃哪一种(到一种吃完为止),问抛硬币的数学期望。
分析:动态规划,概率dp。求出每种结束状态(即,有一种吃完)的概率,分别乘以步长即为期望。
大黄解法:状态位剩余的碗数,逆向求解,状态方程:
DP[ i ][ j ] = (DP[ i-1 ][ j ]+DP[ i ][ j-1 ])/2 + 1 ...
分类:
其他好文 时间:
2014-10-04 21:41:47
阅读次数:
193
Additive equations
Time Limit: 10 Seconds Memory Limit: 32768 KB
We all understand that an integer set is a collection of distinct integers. Now the question is: given an integer set, c...
分类:
其他好文 时间:
2014-10-04 19:29:37
阅读次数:
270
题目:ZOJ Problem Set - 3229 Shoot the Bullet
分类:有源有汇有上下界网络流
题意:有 n 天和 m 个girls,然后每天给一部分girls拍照,每个girls 有拍照的下限,即最少要拍这么多张,然后每天有k个女孩拍照,摄影师最多可以拍num张,然后 k 个女该每天拍照数量值有上下限,然后问你有没有满足这样条件的给女孩拍照的最大方案,然后...
分类:
其他好文 时间:
2014-10-04 18:04:06
阅读次数:
221
Treasure Map
Time Limit: 2 Seconds Memory Limit: 32768 KB
Your boss once had got many copies of a treasure map. Unfortunately, all the copies are now broken to many rectangular pieces, an...
分类:
其他好文 时间:
2014-10-04 13:42:37
阅读次数:
173
ZOJ 3609 Modular Inverse(扩展欧几里德)...
分类:
其他好文 时间:
2014-10-04 12:29:36
阅读次数:
197