比赛地址 A(水题) 题目链接 题目: 给出一个数组\(a\)并能进行一个操作使得数组元素更改为数组任意其他两元素之和,问是否可以让数组元素全部小于等于\(d\) 解析: 排序后判断最大值是否小于等于\(d\)或者最小的两个值是否小于等于\(d\)即可 #include<bits/stdc++.h> using namespace std; const int maxn = 105; int n, dat[maxn]; int main() { int T; scanf("%d&qu…
题意:给你一个只含\(+\)和\(-\)的字符串,给你一个数\(x\),\(x\)初始为\(0\),随着字符串的遍历会加一减一,现在有\(m\)个询问,每个询问给出一个区间\([l,r]\)表示将这个区间内的字符串去除,得到新的字符串,问遍历新字符串后,\(x\)取到的值最多有多少. 题解:这题的关键是,\(x\)的值是一一变化的,所以从最大值\(mx\)变为\(mi\),最多有\(mx\)-\(mi\)+1个数,根据题意,区间会把字符串分成两段(不考虑两段的情况),前面的一段很好处理,我们用结…
题意:给你两个字符串\(a\)和\(b\),找出它们的\(lcm\),即构造一个新的字符串\(c\),使得\(c\)可以由\(x\)个\(a\)得到,并且可以由\(y\)个\(b\)得到,输出\(c\),如果\(c\)不存在,输出\(-1\). 题解:我们可以根据\(a\)和\(b\)的长度得出\(c\)的长度\(len_c\),而\(len_c\)一定是\(len_a\)和\(len_b\)的倍数, 我们就可以根据这个倍数关系构造出\(c\)(用\(a\)或者\(b\)构造都行,因为假如合法的…
A. Digits Sequence Dividing(英文速读) 练习英语速读的题,我还上来昏迷一次....只要长度大于2那么一定可以等于2那么前面大于后面就行其他no 大于2的时候分成前面1个剩下后面一定是对的因为按照数字大小 代码 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin>>n;…
Problem   Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec Problem Description Input Output The only line should contain the minimal number of days required for the ship to reach the point (x2,y2)(x2,y2). If it…
Problem   Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec Problem Description Input The input contains a single line consisting of 2 integers N and M (1≤N≤10^18, 2≤M≤100). Output Print one integer, the total n…
Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include<bits/stdc++.h> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define IT set<ll>::iterator #define sqr(x)…
Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 A 模拟 #include<bits/stdc++.h> using namespace std; #define lson l,mid,rt<<1 #define rson mid+1,r,rt<<1|1 #define IT set<ll>::iterator #define sqr(…
Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings 题目连接: http://codeforces.com/contest/985/problem/F Description You are given a string s of length n consisting of lowercase English letters. For two given strings s an…
Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes 题目连接: http://codeforces.com/contest/985/problem/E Description Mishka received a gift of multicolored pencils for his birthday! Unfortunately he lives in a monochrome w…