首页 > Partition problem
头像 Schelski
发表于 2019-07-21 11:05:03
序     作为一只菜鸡,本场比赛的题一下子把我搞懵逼了,在队友过了H之后,剩余的时间无所事事,于是就开始各种瞎搞F题,最后还真的用一种制杖操作给过了,在此放出这种方法,主要是因为我也不知道为什么能过,希望和各位大佬一起探讨一下,如果有大佬能给出样例就更好了,欢迎 展开全文
头像 EW_DUST
发表于 2019-07-20 19:27:56
2019牛客暑期多校训练营(第二场)F C(2*n,n)是4e7,总状态是4e7种,然后转移,o(n)直接从相邻的状态转移。和裸暴力没啥区别. #include<bits/stdc++.h> using namespace std; typedef long long LL; typed 展开全文
头像 firevolt
发表于 2019-07-21 19:17:11
Given 2N people, you need to assign each of them into either red team or white team such that each team consists of exactly N people and the total com 展开全文
头像 zyw12138
发表于 2019-07-21 16:48:12
题解 把个人分成两组,那么一共是种情况,如果每一次都暴力计算竞争力总和,那么每一次的时间复杂度将是,总时间复杂度是,对于这个数据范围来说是过不去的。 考虑如何惰性计算这个竞争力总和,也就是说从状态转移到状态的时候根据状态的变化来计算贡献,这是一个常用的思路。 起初,我尝试讨论第个元素是被分到哪一组, 展开全文
头像 cherry71
发表于 2019-07-21 17:35:12
#include<iostream> #include<cstdio> #include<queue> #include<cmath> #include<algorithm> #include<set> #include&l 展开全文
头像 断腿三郎
发表于 2019-07-20 17:59:45
链接:https://ac.nowcoder.com/acm/contest/882/F来源:牛客网 Given 2N people, you need to assign each of them into either red team or white team such that each 展开全文