昨天晚上打了打codeforce,睡的比较晚,早上七点三十才起0.0 没有找到今天题的ppt,就先不弄图片了。 t1: 题目大概就是一个有许多脚的东西,每个脚都有他的初始位置和他的速度,每一次后面的脚超过前面的脚都会发生一次碰撞, 让你求出都有那个脚超过那个脚了。然后发生超越和被超越的脚组成两个集合 ...
分类:
其他好文 时间:
2017-08-04 21:33:12
阅读次数:
98
题意:给定了一个公式,让你找到一对(l,r),求解出公式给定的F值。 当时没有想到,我把(-1)^(i-l)看成(-1)^i,然后思路就完全错了。其实这道题是个简单的dp+最长连续子序列。 O(n)求最长连续子序列代码 其实我们可以发现,其实正负是交错的,那么我们只要用两个dp(正负相反)的数组来存 ...
分类:
其他好文 时间:
2017-08-04 20:31:03
阅读次数:
150
Description Berland has n cities connected by m bidirectional roads. No road connects a city to itself, and each pair of cities is connected by no mor ...
分类:
其他好文 时间:
2017-08-02 16:01:55
阅读次数:
195
One beautiful July morning a terrible thing happened in Mainframe: a mean virus Megabyte somehow got access to the memory of his not less mean sister ...
分类:
其他好文 时间:
2017-08-02 10:21:24
阅读次数:
137
Array of integers is unimodal, if: it is strictly increasing in the beginning; after that it is constant; after that it is strictly decreasing. The fi ...
分类:
其他好文 时间:
2017-08-02 00:35:31
阅读次数:
202
codeforces 677E [给一个0123的n*n网格图。求+形和X形的最大乘积] [枚举中心点,二分0的位置,然后计算出该点最大的2^a*3^b。比较两个幂次的成绩可以用log()] codeforces 735E [给一棵树进行黑白染色,要求每个点距离为k的点内有至少一个黑点,求方案数] ... ...
分类:
其他好文 时间:
2017-08-02 00:25:20
阅读次数:
152
Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The f ...
分类:
其他好文 时间:
2017-08-01 12:44:01
阅读次数:
126
Opponents 题意:一共有d天,每天和n个人打架,如果某天n个人有人没有出现,那么可以打赢,问最多连续打赢几天,输入d个字符串,第i位为0表示第i个人没有出现,为1表示出现了 思路:xjb写 AC代码: ...
分类:
其他好文 时间:
2017-07-31 20:05:56
阅读次数:
99
1503 猪和回文 一只猪走进了一个森林。很凑巧的是,这个森林的形状是长方形的,有n行,m列组成。我们把这个长方形的行从上到下标记为1到n,列从左到右标记为1到m。处于第r行第c列的格子用(r,c)表示。 刚开始的时候猪站在(1,1),他的目标是走到(n,m)。由于猪回家心切,他在(r,c)的时候, ...
分类:
其他好文 时间:
2017-07-31 19:55:14
阅读次数:
135
题意:有26个城门,k个守卫,给出每个城门人进入的顺序,只有当这个城门进入的人是最后一个,该城门的守卫才能去别的城门,问是否有个时间段,守卫不够用 思路:记录起始,模拟下 ...
分类:
其他好文 时间:
2017-07-31 13:28:40
阅读次数:
207