[KM算法 O(n^ 3) ] 带权二分图最大匹配 奔小康赚大钱Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 18257Accepted Submission(s): 7702Problem Description传说在遥远的地方有一个非常富裕的村落,有一天,村长...
[2-SAT] 输出路径 POJ3683 Priest John's Busiest Day Priest John's Busiest DayTime Limit:2000MS Memory Limit:65536K Total Submissions:13255 Accepted:4495 Special Judge DescriptionJohn is the only priest in his town. S...
[DAG支配树(拓扑排序+LCA)] HDU6604 Blow up the city Blow up the cityTime Limit: 5000/5000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 742Accepted Submission(s): 393Problem DescriptionCountry A and B ...
约瑟夫环 n, k 第 m 个出圈 ACM-ICPC 2018 沈阳赛区现场赛 K. Let the Flames Begin (约瑟夫环问题)题目链接:题意:有 n 个人围成一个圈,从 1 开始报到第 k 个人出环,问第 m 个出环的人是谁,n、m、k <= 1e18 且 min(m,k)<= 2e6。题解:容易得出O(m)的递推公式 f[n][m] = (f[n-1][m-1] + k - 1)% n +...
[硬核线段树] 2018CCPC吉林I.lovers LoversTime Limit: 25000/15000 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 351Accepted Submission(s): 104Problem DescriptionThe Fool comes to a cros...
[序列自动机+倍增] 查询是否存在一个给出的全排列的循环右移是给定区间的子序列 CF1143E E. Lynyrd Skynyrdtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently Lynyrd and Skynyrd went to a shop where Lynyrd bought ...
[DP + 序列自动机] 修改子串并询问原串中是否包含子串 CF1150D D. Three Religionstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuring the archaeological research in the Middle East you foun...
[倍增] 将带权树分割为数量最少的链 CF1059E E. Split the Treetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a rooted tree onnnvertices, its root is the ver...
[tarjan + lca] 动态加边求桥 D - NetworkPOJ - 3694A network administrator manages a large network. The network consists of N computers and M links between pairs of computers. Any pair of computers are connected directly or ...
[tarjan缩点 + 割点 / 割边 + 重边] 无向图求割点 #include <iostream>#include <cstdio>#include <cmath>#include <stack>#include <cstring>#define ll long long#define db doubleusing namespace std;const int mn = ...
[tarjan模板] 需要几个点覆盖整张图+需要增加几条边 使全图强联通 A - Network of SchoolsPOJ - 1236A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it d...
[拓扑排序] 横纵涂色 ZOJ3780 E - Paint the Grid AgainZOJ - 3780Leo has a grid withN×Ncells. He wants to paint each cell with a specific color (either black or white).Leo has a magical brush which can paint any row wit...
[状压DP] 每个人排在不同位置有不同贡献 求队伍贡献值一定的方案数 ZOJ3777 B - Problem ArrangementZOJ - 3777The 11th Zhejiang Provincial Collegiate Programming Contest is coming! As a problem setter, Edward is going to arrange the order of the problems. As we know, the...
[NIM博弈变形] A在部分堆中只能取奇数 另一部分只能取偶数 B任取 ZOJ3964 G - Yet Another Game of StonesZOJ - 3964Alice and Bob are playing yet another game of stones. The rules of this game are as follow:The game starts withnpiles of stones indexed from 1 ton. T...
[组合数递推公式] RGB游戏 ZUFE2019校赛D 问题 D: D - RGB游戏时间限制:1 Sec内存限制:256 MB提交:35解决:6[提交][状态][讨论版]题目描述三水最近发明了一个RGB游戏:有 n 个方格,编号为从 1 到 n,它用七种颜色的颜料给方格上色,每个 方块只能涂一种颜色。总的分值是这 n 个方块得分之和,如果方块被涂成红色,则方块的得分为 2,如 果方块被涂成蓝色则为 3,如果方块被涂...
[最大独立集 = 补图的最大团] E. Helping Hiasat CF1105E E. Helping Hiasattime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputHiasat registered a new account in NeckoForces and when his fri...
[线段树+欧拉函数+状态压缩] 区间修改 求区间积的欧拉函数 CF1114F F. Please, another Queries on Array?time limit per test5.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an arraya1,a2,…,ana1,a2,…,a...
[交互式+随机] 询问求等差数列 CF1114E E. Arithmetic Progressiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThis is an interactive problem!An arithmetic progress...
[区间DP] 选择区间改变颜色使同色 n = 5000 CF1114D D. Flood Filltime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a line of nn colored squares in a row, numbered from ...
[分解质因数/阶乘素因子的幂] C. Trailing Loves (or L'oeufs?) CF1114C C. Trailing Loves (or L'oeufs?)time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe number "zero" is called "love" (or "l'oeuf" t...