- 博客(8)
- 收藏
- 关注
原创 AtCoder Grand Contest 018 F - Two Trees
Problem StatementThere are two rooted trees, each with N vertices. The vertices of each tree are numbered 1 through N. In the first tree, the parent of Vertex i is Vertex Ai. Here, Ai=−1 if
2017-07-25 13:14:30 1037
原创 AtCoder Grand Contest 018 E - Sightseeing Plan
Problem StatementJoisino is planning on touring Takahashi Town. The town is divided into square sections by north-south and east-west lines. We will refer to the section that is the x-th from the
2017-07-25 11:30:03 733
原创 Topcoder SRM 718 Hard
链接:https://community.topcoder.com/stat?c=problem_statement&pm=14607&rd=16933题意:给一个排列p[n],定义f(k)表示它长度为k的所有子序列提取出来,对于每一个按大小顺序标号之后形成的本质不同的排列个数是否为C(n, k),现在你要补全一个排列,使∑f(k)最大,然后字典序最小题解:考虑f(n - 1) = 1的时
2017-07-18 20:31:14 392
原创 CodeForces 827F. Dirty Arkady's Kitchen
Arkady likes to walk around his kitchen. His labyrinthine kitchen consists of several important places connected with passages. Unfortunately it happens that these passages are flooded with milk so th
2017-07-16 16:08:06 847
原创 AtCoder Grand Contest 017 C - Snuke and Spells
Problem StatementThere are N balls in a row. Initially, the i-th ball from the left has the integer Ai written on it.When Snuke cast a spell, the following happens:Let the current number o
2017-07-12 20:03:28 710
原创 LOJ #6077. 「2017 山东一轮集训 Day7」逆序对
链接:https://loj.mcfx.us/problem/6077题解:DP首先注意到如果从小到大填进去第i个数,那么逆序对会增加[0, i - 1]个问题转化为:∑x[i] = k, 0 这是个经典问题,我们考虑容斥,至少有j个不满足条件,剩下随便选不满足条件即x[i] >= i,我们把k减去i,然后就是个组合数的事情了我们需要求出f(i, j)表示[1, n]中i个
2017-07-05 18:57:34 1704
原创 Topcoder SRM 716 Hard
链接:https://community.topcoder.com/stat?c=problem_statement&pm=14600&rd=16931题意:初始有N个区间[i, i],你可以进行k次操作,每次可以将两个已有区间的并(要求也是个区间)加入已有区间,最后考虑每一个合法区间[i, j],记f(i, j)表示覆盖它最少需要的区间数(区间可以相交),记c = max(f(i, j)),
2017-07-05 18:49:00 382
原创 BZOJ 2803: [Poi2012]Prefixuffix
Description对于两个串S1、S2,如果能够将S1的一个后缀移动到开头后变成S2,就称S1和S2循环相同。例如串ababba和串abbaab是循环相同的。给出一个长度为n的串S,求满足下面条件的最大的L:1. L2. S的L前缀和S的L后缀是循环相同的。Input第一行一个正整数n (nOutput一个整数,表示最大的L。
2017-07-01 19:46:42 452 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人