随笔分类 - ACM-二分,三分
摘要:火星人最近研究了一种操作:求一个字串两个后缀的公共前缀。比方说,有这样一个字符串:madamimadam,我们将这个字符串的各个字符予以标号:序号: 1 2 3 4 5 6 7 8 9 10 11 字符 m a d a m i m a d a m 现在,火星人定义了一个函数LCQ(x, y),表示:
阅读全文
摘要:Max Mex 题目地址:https://codeforces.com/contest/1084/problem/F Max Mex 然后合并时注意分情况讨论: 参考代码: 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define pb p
阅读全文
摘要:Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroids
阅读全文
摘要:C. Three Parts of the Arraytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou ar...
阅读全文
摘要:描述题解二分加贪心。先确保前 ii 桶可以分配为相邻的 kk 个,并且保证 a[i∗k+j]−a[1]#include#includeusing namespace std;const int MAXN = 1e5 + 10;int n, k, l;int a[MAX...
阅读全文
摘要:Description前段时间,某省发生干旱,B山区的居民缺乏生活用水,现在需要从A城市修一条通往B山区的路。假设有A城市通往B山区的路由m条连续的路段组成,现在将这m条路段承包给n个工程队(n ≤ m ≤ 300)。为了修路的便利,每个工程队只能分配到连续的若干条路...
阅读全文
摘要:Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...,xN (0 <= xi
阅读全文
摘要:Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the
阅读全文
摘要:Demy has n jewels. Each of her jewels has some value vi and weight wi. Since her husband John got broke after recent financial crises, Demy has decide
阅读全文
摘要:The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D
阅读全文
摘要:Give you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbers ...
阅读全文