A-E

Codeforces Edu 154 (A-E)

Codeforces Edu154 (Rated for Div2) (A-E) A.Prime Deletion 可以发现只要存在一个两位数(两位不相同),其正着看和反着看都是质数,则原问题有解。这时我们可以把除了这两位上的数之外的其他数从 \(s\) 中剔除,就有答案。上述两位数不少,如:13, ......
Codeforces 154 A-E Edu

ABC330 A-E 题解

ABC330题解 AtCoder Beginner Contest 330 A - Counting Passes 思路: 枚举一遍,当前数大于\(L\)使\(ans+1\)即可. 代码: #include<iostream> #define int long long using namespac ......
题解 ABC 330 A-E

Codeforces Round 909 (Div. 3) A-E

Codeforces Round 909 (Div. 3) A. Game with Integers 题意: 两人轮流操作,可以加一或减一,若结果能被3整除则输出First,否则输出Second 思路: 若n不能被3整除,则第一个人可以直接通过加一或减一使结果被3整除,反之则一定不能 代码: #i ......
Codeforces Round 909 A-E Div

Codeforces Round 906 (Div. 2)A-E1

A. Doremy's Paint 3 记数组中数的种类数为\(k\),当\(k=1\)时,答案为\(yes\);当\(k=2\)时,记两个种类的数的个数差为\(d\),当\(d≤1\)时,答案为\(yes\);其他情况答案为\(no\)。 时间复杂度:\(O(nlogn)\) 1 void sol ......
Codeforces Round 906 A-E Div

Codeforces Round 906 (Div. 2) A-E1

比赛地址 A. Doremy's Paint 3 题意:给出一个数组\(b\),问能否通过重新排序使得数组满足\(b_1+b_2=b_2+b_3=...=b_{n-1}+b_{n}\) Solution 首先判断元素个数 如果是1,则满足条件 如果是2,需判断不同元素个数的差是否小于等于1 其余的均 ......
Codeforces Round 906 A-E Div

Educational Codeforces Round 156 (Rated for Div. 2) A-E

A题签到题 分余1 余2 余0讨论 #include<bits/stdc++.h> using namespace std ; #define maxn 400100 #define int long long int read(){ int ans = 0 , f = 1 ; char ch = ......
Educational Codeforces Round Rated 156

CF1877 Div2 A-E 题解

A 显然 \(n\) 个队的得分之和为 \(0\),因此答案为这 \(n-1\) 个数的和的相反数。 赛时代码 B 小贪心。 将所有人按 \(b\) 升序排序,\(b\) 相同时按 \(a\) 降序,对每个人按 \(b\) 进行分类讨论: 若 \(b< p\),那么我们一定要选这个人,因为选了这个人 ......
题解 1877 Div2 A-E Div

Codeforces Round 897 (Div. 2) A-E

A. green_gold_dog, array and permutation 题意:给出一个长为\(n\)的数组\(a\),找到一个长为\(n\)的排列\(b\),使得\(a\)与\(b\)对应位置上的元素的差尽可能大 Solution 将数组\(a\)排序,然后令排列\(n,n-1,...,2 ......
Codeforces Round 897 A-E Div

ABC319 A-E 题解

A 用 map <string, int> 将名字对应的值存下来即可。 赛时代码 B 按照题意暴力模拟,注意细节。 赛时代码 C 答辩题,卡了我半个小时。 枚举 \(1\sim 9\) 的全排列,然后按照顺序计算即可,但代码实现比较答辩。 赛时代码 D 显然具有可二分性,直接二分并判定可行性即可,注 ......
题解 ABC 319 A-E

Educational Codeforces Round 5 A-E

# [Educational Codeforces Round 5](https://codeforces.com/contest/616) ![image-20230901173739735](C:\Users\magicat\AppData\Roaming\Typora\typora-user- ......
Educational Codeforces Round A-E

【题解】Educational Codeforces Round 154 A-E(CF1861)

感觉很不在状态啊,竟然没做出来 E。 ## A.Prime Deletion ### 题目描述: 质数是一个正整数,它正好有两个不同的正除数 $1$和整数本身。例如,$2$、$3$、$13$和$101$是质数;$1$、$4$、$6$和$42$不是质数。 给你一个从$1$到$9$的数字序列,其中**从 ......
题解 Educational Codeforces Round 1861

Codeforces Round 765 (Div. 2) A-E

## **A. Ancient Civilization** 好像就是对每个二进制位看一下0多还是1多,选择多的那个数就好了。 vp的时候直接猜的,交了一发直接过了 ```cpp void solve(){ int n=read(),m=read(); vectorcnt0(m+1),cnt1(m+ ......
Codeforces Round 765 A-E Div

Codeforces Round 892 (Div. 2) A-E

## A. United We Stand 题意:给出一个长为$n$的数组$a$,将其中的元素分别放到空数组$b$和$c$中,使得$c$中的任意一个元素都不是$b$中任意一个元素的因数,并且两个数组都不是空数组 ### Solution 把$a$中最小的数放到$b$,其它的都放到$c$,一定可以保证 ......
Codeforces Round 892 A-E Div

Codeforces Round 890 (Div. 2) supported by Constructor Institute A-E1

A n=50非常小 所以直接暴力枚举 枚举每次把某个数以下的全部减完 然后看一下是否上升就行 https://codeforces.com/contest/1856/submission/217275334 B题直接 贪心 前面优先放最小的 最后一个放最大的 然后如果重复了就到前面去看能不能调整一下 ......

Codeforces Round 890 (Div. 2) A-E1

## A. Tales of a Sort 题意:给出一个长为n的数组a,每次操作可以使得所有的数-1,最小不会小于0,问至少需要多少次操作才能使得a变得有序。 ### Solution 把数组a排序,从大到小遍历,如果当前的$a[i]$不是原来的话,那么要想让它有序,必须进行当前的$a[i]$次操 ......
Codeforces Round 890 A-E Div

AtCoder Beginner Contest 313 A-E Code

比赛链接:AtCoder Beginner Contest 313 - AtCoder A: #include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int ......
Beginner AtCoder Contest Code 313

Codeforces Round 889 (Div. 2) A-E

[传送门,不用谢。](https://codeforces.com/contest/1855) A 给出排列每次可以交换两个数字,求最少多少次使得排列为错排。 考虑在原位的数字个数为$cnt$ 则答案显然为$(cnt+1)>>1$ B 求一个最大区间满足其中说有数字被$n$整除 极其有趣,注意到样例 ......
Codeforces Round 889 A-E Div

Codeforces Round #887 Div.2 A-E

# Codeforces Round #887 Div.2 一定要手玩哦 前言: **一定要手玩,一定要手玩!** 我今早一手玩发现C很TM简单,如果赛时我能切C说不定直接上1800.。。。 时隔多年,我的**Codeforces Rating(1718) 再次超越了 @cqbzlhy**(1674 ......
Codeforces Round 887 A-E Div

练习记录-AtCoder Beginner Contest 311-(A-E)

写的还挺顺的 F之后补 A - First ABC 找abc三个字母什么时候出现了一次 输出即可 B - Vacation Together 题意:最长的几个人一排里面均有时间 #include<bits/stdc++.h> #define close std::ios::sync_with_std ......
Beginner AtCoder Contest 311 A-E

AtCoder Beginner Contest 311 A-E题解

# A - First ABC ## 题意 给一个长度为N的仅由ABC三个字符组成的字符串S,问S中ABC三个字符第一次出现的位置的最大值。 ## 题解 使用`map`判重,记录当前不同的字符串的个数`cnt`,当`cnt`等于3时,输出此时的下标+1作为答案。 ## Code ```cpp #in ......
题解 Beginner AtCoder Contest 311

Codeforces Round 882 (Div. 2) A-E

Codeforces Round 882 (Div. 2) 2023.7.6 这场还有意思,出题的背景都很相似,通过不同的操作实现不同的要求。 ......
Codeforces Round 882 A-E Div

Codeforces Round 884 (Div. 1 + Div. 2) A-E

# Codeforces Round 884 (Div. 1 + Div. 2) 题目链接:[Codeforces Round 884 (Div. 1 + Div. 2)](https://codeforces.com/contest/1844 "Codeforces Round 884 (Div. ......
Codeforces Div Round 884 A-E

Codeforces Round 884 (Div. 1 + Div. 2) A-E

# Codeforces Round 884 (Div. 1 + Div. 2) 题目链接:[Codeforces Round 884 (Div. 1 + Div. 2)](https://codeforces.com/contest/1844 "Codeforces Round 884 (Div. ......
Codeforces Div Round 884 A-E

Codeforces Round #771 (Div. 2) A-E

# A ## 代码 ```c++ #include using namespace std; using ll = long long; int p[507]; bool solve() { int n; cin >> n; for (int i = 1;i > p[i]; int pos1 = 0 ......
Codeforces Round 771 A-E Div

CodeTON Round 5 (Div. 1 + Div. 2, Rated, Prizes!) A-E

[比赛链接](https://codeforces.com/contest/1842) # A ## 代码 ```c++ #include using namespace std; using ll = long long; bool solve() { int n, m; cin >> n >> ......
Div CodeTON Prizes Round Rated

Codeforces Round #877 (Div. 2) A-E

# A ## 代码 ```c++ #include using namespace std; using ll = long long; bool solve() { int n; cin >> n; int mx = -2e9, mi = 2e9; for (int i = 1;i > x; mi ......
Codeforces Round 877 A-E Div

Educational Codeforces Round 150 (Rated for Div. 2) A-E

[比赛链接](https://codeforces.com/contest/1841) # A ## 代码 ```c++ #include using namespace std; using ll = long long; bool solve() { int n; cin >> n; if (n ......
Educational Codeforces Round Rated 150

Codeforces Round #879 (Div. 2) A-E

[比赛链接](https://codeforces.com/contest/1834) # A ## 代码 ```c++ #include using namespace std; using ll = long long; bool solve() { int n; cin >> n; int c ......
Codeforces Round 879 A-E Div

CodeTON Round 4 (Div. 1 + Div. 2, Rated, Prizes!) A-E

CodeTON Round 4 (Div. 1 + Div. 2, Rated, Prizes!) A. Beautiful Sequence int a[N],poi[N]; void solve(){ int n=read(),ans=0; for(int i=1;i<=n;i++){ a[i] ......
Div CodeTON Prizes Round Rated

Codeforces Round 868 (Div. 2) A-E题解

比赛地址 这把真不在状态,麻了,看来还得再练 A. A-characteristic 题意:给出n和k,要求构造只含1和-1数组a,存在k对(i,j)(i≠j),有a[i]*a[j]=1 Solution 令构造的数组有x个1和y个-1,那么其对于答案的贡献有 $$ x*(x-1)/2+y*(y-1 ......
题解 Codeforces Round 868 A-E
共36篇  :1/2页 首页上一页1下一页尾页