2017多校1 hdu-Balala Power!】的更多相关文章

Balala Power! Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 3757    Accepted Submission(s): 907 Problem Description Talented Mr.Tang has n strings consisting of only lower case characters. H…
2017 多校3 hdu 6061 RXD and functions(FFT) 题意: 给一个函数\(f(x)=\sum_{i=0}^{n}c_i \cdot x^{i}\) 求\(g(x) = f(x - \sum a_i)\)后每一项\(x^{i}\)的系数mod998244353 \(n <= 10^{5},m <= 10^{5}\) \(0 <= c_i < 998244353\) \(0 <= a_i < 998244353\) 思路: 令\(d = -\s…
2017 多校2 hdu 6053 TrickGCD 题目: You are given an array \(A\) , and Zhu wants to know there are how many different array \(B\) satisfy the following conditions? \(1≤B_i≤A_i\) For each pair(\(l , r) (1≤l≤r≤n) , gcd(bl,bl+1...br)≥2\) Input The first line…
2017 多校5 Rikka with Number(数学 + 数位dp) 题意: 统计\([L,R]\)内 有多少数字 满足在某个\(d(d>=2)\)进制下是\(d\)的全排列的 \(1 <= L <= R <= 10^{5000}\) 题解: 首先转化成计算小于等于 \(N\)的好数有多少个.因为 \(n^n<(n+1)^n\) ​ ​​而对于 \(n\) 进制下的任何一个好数 \(K\),都有 \(n^{n-1}<K<n^n ​\) ​​ ​​ ,所以每一…
Balala Power! Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2668    Accepted Submission(s): 562 Problem Description Sample Input 1 a 2 aa bb 3 a ba abc Sample Output Case #1: 25 Case #2: 132…
/* HDU 6034 - Balala Power! [ 大数进位,贪心 ] 题意: 给一组字符串(小写英文字母),将上面的字符串考虑成26进制数,每个字母分配一个权值,问这组数字加起来的和最大是多少? 要求每个数字不能有前导0,即每个字符串首位字符不能赋0 分析: 对于每个字符,将每个字符串按位相加,得到这个字符的一个每位上的数量的数组 将其看成一个大数,满26进位,然后排序,从高到低赋值,注意考虑0 */ #include <bits/stdc++.h> using namespace…
Problem Description Talented Mr.Tang has n strings consisting of only lower case characters. He wants to charge them with Balala Power (he could change each character ranged from a to z into each number ranged from 0 to 25, but each two different cha…
题目链接 Problem Description Talented Mr.Tang has n strings consisting of only lower case characters. He wants to charge them with Balala Power (he could change each character ranged from a to z into each number ranged from 0 to 25, but each two differen…
Balala Power! Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 1411    Accepted Submission(s): 239 Problem Description Talented Mr.Tang has n strings consisting of only lower case characters.…
B - Balala Power! 题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=6034 题面描述 Talented Mr.Tang has n strings consisting of only lower case characters. He wants to charge them with Balala Power (he could change each character ranged from a to z into each…
Balala Power! Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 3555    Accepted Submission(s): 844 Problem Description Talented Mr.Tang has n strings consisting of only lower case characters. H…
Balala Power![排序/进制思维] Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 6703    Accepted Submission(s): 1680 Problem Description Talented Mr.Tang has n strings consisting of only lower case cha…
Talented Mr.Tang has n strings consisting of only lower case characters. He wants to charge them with Balala Power (he could change each character ranged from a to z into each number ranged from 0 to 25, but each two different characters should not b…
Talented Mr.Tang has nn strings consisting of only lower case characters. He wants to charge them with Balala Power (he could change each character ranged from a to z into each number ranged from 0 to 25, but each two different characters should not…
// 判断相同区间(lazy) 多校8 HDU 5828 Rikka with Sequence // 题意:三种操作,1增加值,2开根,3求和 // 思路:这题与HDU 4027 和HDU 5634 差不多 // 注意开根号的话,遇到极差等于1的,开根号以后有可能还是差1.如 // 2 3 2 3... // 8 9 8 9... // 2 3 2 3... // 8 9 8 9... // 剩下就是遇到区间相等的话,就直接开根号不往下传 #include <bits/stdc++.h> u…
题目链接 Problem Description Talented Mr.Tang has n strings consisting of only lower case characters. He wants to charge them with Balala Power (he could change each character ranged from a to z into each number ranged from 0 to 25, but each two differen…
1001 Add More Zero(签到题) 题目链接 HDU6033 Add More Zero 找出最大的k,使得\(2^m-1\ge 10^k\). 直接取log,-1可以忽略不计. #include <cstdio> #include <cmath> int cas,m; int main(){ while(~scanf("%d",&m)){ printf("Case #%d: %d\n",++cas,(int)(m*log…
Balala Power! Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 714    Accepted Submission(s): 117 Problem Description Talented Mr.Tang has n strings consisting of only lower case characters. He…
2017 多校5 Rikka with String(ac自动机+dp) 题意: Yuta has \(n\) \(01\) strings \(s_i\), and he wants to know the number of \(01\) antisymmetric strings of length \(2L\) which contain all given strings \(s_i\) as continuous substrings. A \(01\) string \(s\) i…
2017 多校4 Wavel Sequence 题意: Formally, he defines a sequence \(a_1,a_2,...,a_n\) as ''wavel'' if and only if \(a_1<a_2>a_3<a_4>a_5<a_6\)... Now given two sequences \(a_1,a_2,...,a_n\) and \(b_1,b_2,...,b_m\), Little Q wants to find two seque…
2017 多校4 Security Check 题意: 有\(A_i\)和\(B_i\)两个长度为\(n\)的队列过安检,当\(|A_i-B_j|>K\)的时候, \(A_i和B_j\)是可以同时过安检的,过安检必须按照队列的顺序,问你两个队列过完安检最少花费的时间 \(1<=n<=6e4\), \(1<=A_i,B_i<=n\) 题解: 设\(f_{i,j}\) 表示仅考虑\(a[1..i]\)与\(b[1..j]\)时,最少需要多少时间. 若\(|a_i-b_j|>…
2017 多校2 I Curse Myself(第k小生成树) 题目: 给一张带权无向连通图,该图的任意一条边最多只会经过一个简单环,定义\(V(k)为第k小生成树的权值和\),求出\(\sum_{k=1}^{K}k \cdot V(k) mod 2^{32}\) 思路: 比赛的时候看了一眼,没有看清楚是仙人掌那句话,觉得好难啊 看完题解之后觉得就算看清了还是过不了嘛. 直接上题解 由于图是一个仙人掌,所以显然对于图上的每一个环都需要从环上取出一条边删掉.所以问题就变为有 M 个集合,每个集合里…
有点麻烦.. /*hdu6136[模拟+优先队列] 2017多校8*/ #include <bits/stdc++.h> using namespace std; typedef long long LL; struct frac { LL p, q; frac(LL P, LL Q) { p = P / __gcd(P, Q); q = Q / __gcd(P, Q); } frac() {p = , q = ;} bool operator < (const frac& a)…
/*hdu6134[莫比乌斯反演] 2017多校8*/ #include <bits/stdc++.h> using namespace std; typedef long long LL; ; + ; LL f[maxn], g[maxn], d[maxn]; bool vis[maxn]; int prime[maxn], primes, mu[maxn]; void init_mu() { memset(vis, , sizeof(vis)); mu[] = ; primes = ; ;…
/*hdu6098[RMQ+筛法] 2017多校6*/ #include <bits/stdc++.h> using namespace std; ][], len[], a[]; void st_init() { len[] = -; ; i <= n; i++) { st[i][] = a[i]; len[i] = (i & (i - )) == ? len[i - ] + : len[i - ]; } ; j <= len[n]; j++) { ; i + ( <…
/*hdu6103[尺取法] 2017多校6*/ #include <bits/stdc++.h> using namespace std; int T, m; ]; void solve() { ; int n = strlen(str); ; i < n; i++) { , r = , p1 = i, p2 = i + , cost = ; && p2 + r < n) { if (cost + abs(str[p1 - r] - str[p2 + r]) &l…
/*hdu6097[二分+解析几何] 2017多校6*/ #include <bits/stdc++.h> using namespace std; ; struct node{ double x,y; node(double X=0.0,double Y=0.0): x(X),y(Y){} }p,q; double dist(node a,node b){ return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)); } int T; doubl…
/*hdu6085[压位+暴力] 2017多校5*/ /*强行优化..*/ #include <bits/stdc++.h> using namespace std; struct bits{ unsigned num[]; unsigned bitlen; bits(){memset(num,,;} bits get(int l, int r) { bits ret; ; ; left=l/; len1=(l%); len2=-len1; ){ ) ret.num[pos++]=num[le…
/*hdu6038[找规律+循环节] 2017多校1*/ #include<bits/stdc++.h> using namespace std; typedef long long LL; ; const int inf=0x3f3f3f3f; ; ,maxlop; ],b[],mark[]; LL Arep[],Brep[]; LL fastpow(LL a,LL b){ LL ret=,x=a; while(b){ ){ ret=(ret*x)%mod; } x=(x*x)%mod; b…
/*hdu6035[dfs+思维] 2017多校1*/ //合并色块, 妙啊妙啊 #include<bits/stdc++.h> using namespace std; ; const int inf=0x3f3f3f3f; typedef long long LL; vector<]; LL sum[]; ],son[],mark[]; ,kase=; LL ans,res; void dfs(int u,int fa){ son[u]=; LL y=sum[c[u]]; LL x=…