Ollivanders: Makers of Fine Wands since 382 BC.Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 93...
分类:
其他好文 时间:
2014-08-22 00:03:45
阅读次数:
428
比较裸的二分,但是比赛的时候脑抽,用树状数组瞎搞过了,但是边界条件没注意让hack了。
后来看到有人写了很简单的版本,又过了一遍,提醒一下自己不能忘记基本算法。
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
typedef long long ll;
in...
分类:
其他好文 时间:
2014-08-21 22:52:45
阅读次数:
238
思路:本来前两题都很快做出来的,然后觉得ranting应该可以增加了。然后觉得代码没问题了,又想到了一组cha人的数据,然后就锁了,然后刚锁就被别人cha了大哭大哭看了代码才发现尼玛忘了判断小于10^9了,然后C反正想了好多种方法都不会就没心情了,就这样rating又降了哭哭...
分类:
其他好文 时间:
2014-08-21 22:50:35
阅读次数:
202
Codeforces Round #262 (Div. 2)
A:水题,直接不断模拟即可
B:由于s(x)大小最大到1e9,所以数位和最多为81,这样只要枚举s(x),就只要枚举1到81即可,然后在计算出x,判断是否符合,符合就加进答案
C:二分高度,然后判断的时候for一遍,每次不符合的位置就去浇水,从左往右推一遍即可
D:构造,如果k >= 5, 那么就可以直接放偶数,...
分类:
其他好文 时间:
2014-08-21 22:48:05
阅读次数:
257
Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord...
分类:
其他好文 时间:
2014-08-21 22:33:34
阅读次数:
240
题意:
给定n长的序列 m个操作
序列默认为 1, 2, 3···n
操作1:D [l,r] 把[l,r]区间增长 :( 1,2,3,4 进行 D [1,3]变成 1,1,2,2,3,3,4 )
操作2:Q [l,r] 问区间[l,r] 上出现最多次数的数 的次数
线段树,维护每个区间的size 和叶子节点中最大的size
开始二分查找size的前缀和,逗了一场。。其实直接dfs就好了...
分类:
其他好文 时间:
2014-08-21 21:17:44
阅读次数:
345
Girls and BoysTime Limit: 20000/10000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7577Accepted Submission(s): 3472Pr...
分类:
其他好文 时间:
2014-08-21 21:00:54
阅读次数:
163
output
standard output
Little beaver is a beginner programmer, so informatics is his favorite subject. Soon his informatics teacher is going to have a birthday and the beaver has decided to prepar...
分类:
其他好文 时间:
2014-08-21 19:31:34
阅读次数:
259
//题意:给定N朵花的原先的高度,从左到右排列,
//最多浇水m天,每天只能浇一次,每次使得连续的w朵花的高度增长1,问最后最矮的花的高度最高是多少。
# include
# include
# include
using namespace std;
int main()
{
__int64 n,m,w,l,r,i,m1,sum;
__int64 a[200010],b[2...
分类:
其他好文 时间:
2014-08-21 19:26:54
阅读次数:
239
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2962TruckingTime Limit: 20000/10000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Subm...
分类:
其他好文 时间:
2014-08-21 18:44:44
阅读次数:
208