C. Two Seals time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One very important person has a piece of paper in the form of a rectangle a × b. Also, he has n seals. Each seal leaves an impre…
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…
B. Flag of Berland time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The flag of Berland is such rectangular field n × m that satisfies following conditions: Flag consists of three colors whi…
Shortest Path Problem? You are given an undirected graph with weighted edges. The length of some path between two vertices is the bitwise xor of weights of all edges belonging to this path (if some edge is traversed more than once, then it is include…
A. Chess Tourney time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Berland annual chess tournament is coming! Organizers have gathered 2·n chess players who should be divided into two teams w…
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…
这题调得我心疲力竭...Educational Round 5就过一段时间再发了_(:з」∠)_ 先后找了三份AC代码对拍,结果有两份都会在某些数据上出点问题...这场的数据有点水啊_(:з」∠)_[然而卡掉本弱还是轻轻松松的] 题目链接:616F - Expensive Strings 题目大意:给出\(n\)个字符串\(t_i\)以及\(n\)个数\(c_i\),定义\(p_{s,i}\)为字符串\(s\)在\(t_i\)中出现的次数,\(f(s)=\sum_{i=1}^{n}c_i\cdo…