A 题意:给长度为n的序列染黑白色,要求连续的黑的格子数量<=a,连续的白的格子数量<=b,问方案总数,有多个询问 分析:递推 注意数据范围,是可以O(n)做的,所以可以直接递推 B 题意:每个servant有ai,bi,ci,pi,有boss的血量H,求满足(ai+bj+ck)(1+pi%)>=H(i!=j!=k)的组数,n<=1e5 分析:FFT典型应用 枚举每个ai的话,问题就是求bj+ck>=M的组数,明显的FFT应用 若b中有大于H的,直接修改成H,不影响结果,同样…
A =w= B 占坑 C 题意:有长度为n的序列A和长度为n的序列W,以及一个G,对于Ui,1<=Ui<=Wi,求Σgcd(Ai,Ui)=G的方案数,n<=1e3,Ai<=1e5,Wi<=1e5,G<=1e3 分析:递推 f(i,j)表示前i位,当前和为j的方案数 f(i,j)=Σf(i-1,j-gcd(Ai,k)) 这样直接搞是会TLE 注意到我们如果对于一个Ai能预处理求出gcd(Ai,k)的所有种类和个数,那么时间就允许了 考虑Ai.Wi,首先筛出Ai的所有因子,…
Start Time:2016-08-20 13:00:00 End Time:2016-08-20 18:00:00 Refresh Time:2017-11-12 19:51:52 Public A -- Absolute Defeat Time Limit:2s Memory Limit:64MByte Submissions:394Solved:119 DESCRIPTION Eric has an array of integers a1,a2,...,ana1,a2,...,an.…
我能说我比较傻么!就只能做一道签到题,没办法,我就先写下A题的题解&源码吧,日后补上剩余题的题解&源码吧! A -- Niro plays Galaxy Note 7 Time Limit:1s Memory Limit:128MByte DESCRIPTION Niro, a lovely girl, has bought a Galaxy Note 7 and wants to…
“玲珑杯”ACM比赛 Round #19 Start Time:2017-07-29 14:00:00 End Time:2017-07-29 16:30:00 Refresh Time:2017-07-29 16:42:55 Private B -- Buildings Time Limit:2s Memory Limit:128MByte Submissions:590Solved:151 DESCRIPTION There are nn buildings lined up, and th…
A:DESCRIPTION Eric has an array of integers a1,a2,...,ana1,a2,...,an. Every time, he can choose a contiguous subsequence of length kk and increase every integer in the contiguous subsequence by 11. He wants the minimum value of the array is at least…
1171 - 这个E大概是垃圾桶捡来的 Time Limit:2s Memory Limit:128MByte Submissions:138Solved:45 DESCRIPTION B君在做 CODE FESTIVAL 2017 qual B 遇到了这样的一道题目 http://code-festival-2017-qualb.contest.atcoder.jp/tasks/code_festival_2017_qualb_f 于是B君决定出一个加强版 输入一个字符串,将他重新排列,使得重…
A -- A simple math problem Time Limit:2s Memory Limit:128MByte Submissions:1599Solved:270 DESCRIPTION You have a sequence anan, which satisfies: Now you should find the value of ⌊10an⌋⌊10an⌋. INPUT The input includes multiple test cases. The number o…
B 我也不是B 这个题做了一下午,比赛两个小时还是没做出来,比完赛才知道要用一个倍增算法确定区间,然后再二分右端点. 题意:定义一个序列的混乱度为累加和:b[i]*v[i],b[i]为这个序列中第i小的数,v[]数组是给定的.如果当前加进来的数购车的数构成的序列的混乱度大于m,则将当前的序列扔掉,然后将变量C加一,现在给出要加进来的序列的顺序,和v[]数组,求最终C的值. 思路:枚举左端点,二分右端点,暴力判断混乱度与M的关系,如果Me为0,只能一个一个删除,那么二分貌似会将复杂度拉高…
E -- Expected value of the expression DESCRIPTION You are given an expression: A0O1A1O2A2⋯OnAnA0O1A1O2A2⋯OnAn, where Ai(0≤i≤n)Ai(0≤i≤n) represents number, Oi(1≤i≤n)Oi(1≤i≤n) represents operator. There are three operators, &,|,^&,|,^, which means a…
DESCRIPTION 一条东西走向的河两边有都排着工厂,北边有n间工厂A提供原材料,南边有n间工厂B进行生产.现在需要在工厂A和工厂B之间建运输桥以减少运输成本.可是每个工厂B只能接受最多6个工厂A提供的材料能满足生产,而且建立的运输桥之间不能有交叉,北边的工厂A由西向东编号1-n,南边的工厂B也是一样,不能交叉的意思是如果a号工厂A跟b号工厂B之间建立了运输桥,那么不能存在c.d(c < a 且d > b) 使得c号工厂A和d号工厂b之间建立运输桥,每个工厂A只能给一个工厂B提供材料,每个…
http://www.ifrog.cc/acm/problem/1097?contest=1013&no=1 //LIS的高端写法 #include <iostream> #include <cstdio> #include <cstring> #include <cassert> #include <algorithm> using namespace std; ]; ]; int n, x; int main() { while (s…