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的所有因子,…
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题的题解&源码吧,日后补上剩余题的题解&源码吧! 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…
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.…
War Time Limit: 8000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 81 Accepted Submission(s): 23 Special Judge Problem Description Long long ago there are two countrys in the universe. Each country haves i…
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君决定出一个加强版 输入一个字符串,将他重新排列,使得重…
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…
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…