A.Accurate Movement(复现赛) 题意:两个木块最左边都在0的位置,最右边分别为a,b(b>a),并且短的木条只能在长木条内移动,问两个木条需要移动多少次才能使两个木条的右端都在n 思路:短木条最少移动(n-a)/(b-a),如果(n-a)%(b-a)不为0,那么还需要再多移动一次,才能到达最右边,长木条以此类推 代码: 1 #include<iostream> 2 #include<algorithm> 3 #include<cmath> 4 #…
Codeforces Round #517 (Div. 2, based on Technocup 2019 Elimination Round 2) #include <bits/stdc++.h> using namespace std; int n,m,k; ; int main() { cin>>n>>m>>k; ;i<=k-;++i) { sum+=(n+(m-))*-(i)*; } cout<<sum<<endl;…
2017 ACM - ICPC Asia Ho Chi Minh City Regional Contest A - Arranging Wine 题目描述:有\(R\)个红箱和\(W\)个白箱,将这些箱子分成若干堆,使得每一堆只有一种颜色,然后将这些堆排成一排,使得相邻的堆的颜色不一样,并且每堆红箱的个数不能超过\(d\),问有多少种方案. solution 不会. B - Barcode 题目描述:有一排\(n\)个球,现在要给这\(n\)个球涂成红色或蓝色,使得红色球的个数等于蓝色球的个数…
A - Forgetting Things 题意:给 \(a,b\) 两个数字的开头数字(1~9),求使得等式 \(a=b-1\) 成立的一组 \(a,b\) ,无解输出-1. 题解:很显然只有 \(a=b\) 和 \(a=b-1\) 的时候有解,再加上一个从 \(9\) 越到 \(10\) 的就可以了.被样例的 \(199,200\) 误导了. #include<bits/stdc++.h> using namespace std; typedef long long ll; int mai…
目录 Contest Info Solutions Problem A. Accurate Movement Problem B. Bad Treap Problem E. Equidistant Problem H. High Load Database Problem I. Ideal Pyramid Problem J. Just the Last Digit Problem K. King's Children Problem M. Managing Difficulties Conte…
题目连接:https://codeforces.com/gym/102780 寒假第二次训练赛,(某菜依旧是4个小时后咕咕咕),战况还行,个人表现极差(高级演员) A:Green tea 暴力枚举即可 B:Mysterious Resistors 注意到电阻阻值具有单调性,二分 C:Emoticons 据说是模拟 D:Power play 由唯一分解定理可得,\(x=a^{\frac{p}{q}}\) ,由于\(x\leq10^{18}\)又\(x\)为整数,故\(p,q\)的范围极小,枚举即可…
A. 24 Game Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/468/problem/A Description Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game. Initially you ha…
D. Power Products You are given n positive integers a1,-,an, and an integer k≥2. Count the number of pairs i,j such that 1≤i<j≤n, and there exists an integer x such that ai⋅aj=xk. Input The first line contains two integers n and k (2≤n≤105, 2≤k≤100).…
C. p-binary Vasya will fancy any number as long as it is an integer power of two. Petya, on the other hand, is very conservative and only likes a single integer p (which may be positive, negative, or zero). To combine their tastes, they invented p-bi…
Happy Birthday, Polycarp! Make Them Odd As Simple as One and Two Let's Play the Words? Two Fairs Beautiful Rectangle Happy Birthday, Polycarp! \[ Time Limit: 1 s\quad Memory Limit: 256 MB \] 暴力枚举所有数字全为 \(i.i\in[1,9]\),然后暴力判断有多个全为 \(i\) 的数在 \(n\) 以内即可…