As a part of the mission ‘Beautification of Dhaka City’, the government has decided to replace all the old lampposts with new expensive ones. Since th ...
分类:
其他好文 时间:
2017-08-30 23:41:37
阅读次数:
247
题意:给定一个长度为n的01串,你的任务是依次执行如表所示的m条指令: 1 p c 在第p个字符后插入字符,p = 0表示在整个字符串之前插入2 p 删除第p个字符,后面的字符往前移3 p1 p2反转第p1到第p2个字符4 p1 p2输出从p1开始和p2开始的两个后缀的LCP。 析:对于前三个操作, ...
分类:
其他好文 时间:
2017-08-30 21:48:53
阅读次数:
202
#include #include #include #include using namespace std; const int N = 1000005; const long double pi = acos(-1.0); struct Complex { long double r,i; C... ...
分类:
其他好文 时间:
2017-08-30 18:32:11
阅读次数:
155
This is a two player game. Initially there are n integer numbers in an array and players A and B get chance to take them alternatively. Each player ca ...
分类:
其他好文 时间:
2017-08-30 18:25:34
阅读次数:
139
题目链接:https://vjudge.net/problem/UVA-10118 Little Bob is playing a game. He wants to win some candies in it - as many as possible. There are 4 piles, e ...
分类:
其他好文 时间:
2017-08-30 15:39:11
阅读次数:
118
题意: 分析: 类似UVa 297, 模拟四分树四分的过程, 就是记录一个左上角, 记录宽度wideth, 然后每次w/2这样递归下去。 注意全黑是输出0, 不是输出1234。 ...
分类:
其他好文 时间:
2017-08-30 13:12:46
阅读次数:
153
No wonder the old bookcase caved under the massive piles of books Tom had stacked on it. He had better build a new one, this time large enough to hold ...
分类:
其他好文 时间:
2017-08-29 15:31:43
阅读次数:
136
贴个源码// UVa1572 Self-Assembly // Rujia Liu #include #include #include using namespace std; int ID(char a1, char a2) { return (a1-'A')*2 + (a2 == '+' ? ... ...
分类:
其他好文 时间:
2017-08-29 14:32:13
阅读次数:
167
题意:给定一个有向图,求一个最大的结点集,使得任意两个结点,要么 u 能到 v,要么 v 到u。 析:首先,如果是同一个连通分量,那么要么全选,要么全不选,然后我们就可以先把强连通分量先求出来,然后缩成一个点,然后该图就成了一个DAG,然后就可以直接用DP来做了。 代码如下: ...
分类:
其他好文 时间:
2017-08-29 11:06:58
阅读次数:
128