B. Suffix StructuresBizon the Champion isn't just a bison. He also is a favorite of the "Bizons" team.At a competition the "Bizons" got the following ...
分类:
其他好文 时间:
2014-07-18 14:39:26
阅读次数:
221
分治!首先是一大块,贪行刷和竖刷的最小,再转化为小块。。。。。。。。。。。。
AC代码如下:
#include
#include
#include
using namespace std;
int n;
int a[5005];
int solve(int l,int r)
{
int i,j;
int len=r-l+1;
...
分类:
其他好文 时间:
2014-07-18 11:22:29
阅读次数:
229
题意是给我们两个字符串,再在第一个字符串中找第二个,
给了我们两种方法,一:在第一个字符串删掉一些字符后得到第二个字符串;
二:在第一个字符串中改变一些字符的先后顺序得到字符串二;
如果只用第一种方法输出: automaton;
只用第二种输出:array
两种都用输出:both;
找不到输出:need tree;
直接找就行,,,,,,水
#include
#include...
分类:
其他好文 时间:
2014-07-18 11:17:05
阅读次数:
191
题意就是将第一个字符串转化为第二个字符串,支持两个操作,一个是删除,一个是更换字符位置。
简单的字符串操作!!
AC代码如下:
#include
#include
#include
#include
#define M 50010
#define inf 100000000
using namespace std;
char a[1005],b[1005];
int la,lb;
bo...
分类:
其他好文 时间:
2014-07-18 11:03:48
阅读次数:
273
E. DivisorsBizon the Champion isn't just friendly, he also is a rigorous coder.Let's define function f(a), where a is a sequence of integers. Function...
分类:
其他好文 时间:
2014-07-18 10:21:31
阅读次数:
269
A. RewardsBizon the Champion is called the Champion for a reason.Bizon the Champion has recently got a present — a new glass cupboard with n shelves a...
分类:
其他好文 时间:
2014-07-18 10:17:51
阅读次数:
254
C. Painting FenceBizon the Champion isn't just attentive, he also is very hardworking.Bizon the Champion decided to paint his old fence his favorite c...
分类:
其他好文 时间:
2014-07-18 10:14:51
阅读次数:
268
??
Description
Petya has k matches, placed in n matchboxes lying in a line from left to right.
We know that k is divisible by n. Petya wants all boxes to have the same number of matches in...
分类:
其他好文 时间:
2014-07-17 20:35:53
阅读次数:
249
q次询问,每次询问可以对矩阵某一个值改变(0变1,1变0) 或者是查询子矩阵的最大面积,要求这个这个点在所求子矩阵的边界上,且子矩阵各店中全为1
用up[i][j]表示(i,j)这个点向上能走到的最长高度 若(i,j)为0 则up[i][j]值为0
同理,维护down,left, right数组
则每次查询时,从up[i][j]枚举至1作为子矩阵的高度,然后途中分别向左右扩展。若up[i]...
分类:
其他好文 时间:
2014-07-17 20:35:30
阅读次数:
320
可以把序列中一个数改变,使得序列中后一个数与前一个数差的绝对值之和最小
把与数x相邻的数加入G[x]的链表中(若这个数值也为x,则不加入) 那么改变了数x,则相当于只会影响到这个链表中的数
为了让x变化后的数 与这个链表中的数差值绝对值之和最小 取排序后的序列的中位数即可
//#pragma comment(linker, "/STACK:102400000,1024000...
分类:
其他好文 时间:
2014-07-17 19:28:24
阅读次数:
210