Educational Codeforces Round 26 A B C题】的更多相关文章

题目链接 A. Text Volume 题意:计算句子中,每个单词大写字母出现次数最多的那个的出现次数(混不混乱QAQ). 解题思路:注意getchar()就没啥了. #include<cstdio> #include<cstring> #include<iostream> #include<ctype.h> #include<algorithm> using namespace std; int main() { int n; ]; cin&g…
Educational Codeforces Round 26 困到不行的场,等着中午显示器到了就可以美滋滋了 A. Text Volume time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a text of single-space separated words, consisting of sm…
按tutorial打的我血崩,死活挂第四组- - 思路来自FXXL /* CodeForces 837F - Prefix Sums [ 二分,组合数 ] | Educational Codeforces Round 26 题意: 设定数组 y = f(x) 使得 y[i] = sum(x[j]) (0 <= j < i) 求初始数组 A0 经过多少次 f(x) 后 会有一个元素 大于 k 分析: 考虑 A0 = {1, 0, 0, 0} A1 = {1, 1, 1, 1} -> {C(…
/* CodeForces - 837E - Vasya's Function [ 数论 ] | Educational Codeforces Round 26 题意: f(a, 0) = 0; f(a, b) = 1 + f(a, b-gcd(a, b)); 求 f(a, b) , a,b <= 1e12 分析: b 每次减 gcd(a, b) 等价于 b/gcd(a,b) 每次减 1 减到什么时候呢,就是 b/gcd(a,b)-k 后 不与 a 互质 可先将 a 质因数分解,b能除就除,不能…
/* CodeForces 837D - Round Subset [ DP ] | Educational Codeforces Round 26 题意: 选k个数相乘让末尾0最多 分析: 第i个数字有a[i]个2, b[i] 个5 以其中一维作体积另一维作价值01背包即可 */ #include <bits/stdc++.h> using namespace std; int dp[205][20005]; int get2(long long x) { int s = 0; while…
PROBLEM D - Round Subset 题 OvO http://codeforces.com/contest/837/problem/D 837D 解 DP, dp[i][j]代表已经选择了i个元素,当2的个数为j的时候5的个数的最大值 得注意最大值(貌似因为这个喵呜了一大片喵~☆) #include <iostream> #include <cstring> #include <cstdio> #include <cmath> #include…
题目链接:http://codeforces.com/contest/837/problem/F 题意:如题QAQ 解法:参考题解博客:http://www.cnblogs.com/FxxL/p/7282909.html    由于新生成的m+1个数列第一个肯定为0,所以可以忽略掉,当作每次新生成的数列只拥有m个元素    来枚举一个例子,可以发现规律. 当a[] = {1,0,0,0,0}时,手动推出的矩阵如下: 可以发现对于这个矩阵显然是满足杨辉三角的,我们二分出一个值后可以直接利用组合数来…
B. Flag of Berland 链接:http://codeforces.com/contest/837/problem/B 思路:题目要求判断三个字母是否是条纹型的,而且宽和高相同,那么先求出三个字母的边界,算下面积,是否和数量相同,不相同的话肯定不为条纹型,然后判断下他们宽和高的关系就行了 实现代码: #include<bits/stdc++.h> #include<iostream> #include<cstdio> #include<string&g…
B. s-palindrome 题目连接: http://www.codeforces.com/contest/691/problem/B Description Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the…
D. Round Subset time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Let's call the roundness of the number the number of zeros to which it ends. You have an array of n numbers. You need to cho…