A-D

Codeforces Round 876 (Div. 2) A-D

[比赛地址](https://codeforces.com/contest/1839/my) ## A.The Good Array 题意:定义一个数组是good的要求有: 从左往右所有的i,前i个数中至少有[i/k]个数是1 从右往左所有的i,前i个数中至少有[i/k]个数是1 问good数组对于 ......
Codeforces Round 876 A-D Div

Codeforces Round 875 (Div. 2) A-D

## A. Twin Permutations 题意:给出一个由[1,2,...,n]组成的数组a,构造另一个由[1,2,...,n]组成的数组b,使得a[1]+b[1]>n; for(int i=1;i>a[i]; } for(int i=1;i>n; for(int i=1;i>a[i]; fo ......
Codeforces Round 875 A-D Div

Codeforces Round 875 (Div. 2) A-D

# Codeforces Round 875 (Div. 2) ## A. Twin Permutations ```c++ int a[N]; void solve(){ int n=read(); for(int i=1;i0?"YES":"NO"); //puts(ans>0?"Yes":"N ......
Codeforces Round 875 A-D Div

Educational Codeforces Round 143 (Rated for Div. 2) A-D

Educational Codeforces Round 143 (Rated for Div. 2) A. Two Towers void solve(){ int n=read(),m=read(); string s,t; cin>>s>>t; int ans=1; for(int i=0;i ......
Educational Codeforces Round Rated 143

Codeforces Round 862 (Div. 2) A-D

Codeforces Round 862 (Div. 2) A. We Need the Zero int a[N]; void solve(){ int n=read(),sum; for(int i=1;i<=n;i++){ a[i]=read(); if(i==1)sum=a[i]; else ......
Codeforces Round 862 A-D Div

Educational Codeforces Round 148 (Rated for Div. 2) A-D2

Educational Codeforces Round 148 (Rated for Div. 2) A. New Palindrome map<int,int>mp; void solve(){ string s; mp.clear(); cin>>s; for(int i=0;i<s.size ......
Educational Codeforces Round Rated 148

Codeforces Round 872 (Div. 2) A-D

比赛地址 A. LuoTianyi and the Palindrome String 题意:给一个回文串,求最长的非回文子串的长度 Solution 判一下回文串是不是由相同的字母组成的,如果是的那么无解,如果不是答案就是len-1 void solve() { string s;cin>>s; ......
Codeforces Round 872 A-D Div

练习记录-cf-div2-Codeforces Round 870 (A-D)

这次写的也是比较快!rank305 虽然D简单,但是写出来了就算胜利! A. Trust Nobody 题意:给出n个人,他们会说多少人是说谎的,你要找出这个人数 思路: n最多只有100个,我枚举说谎的人有i个,对说话小于等于i的做前缀和,这个几个人都是说真话,记录前缀和sum,n-sum就是说谎 ......
Codeforces cf-div Round 870 A-D

Codeforces Round 870 (A-D)

A $n^2$暴力推,遍历可能撒谎的人数(0-n),然后$O(n)$check就行了。 仔细看逻辑其实$O(1)$就能check,草率了,后面再修正 点击查看代码 #include <bits/stdc++.h> #define rep(i, l, r) for(int i = l; i <= r; ......
Codeforces Round 870 A-D

牛客练习赛111(A-D)

A 题意:给出一个整数A,求出最小的整数B使得A+B产生进位。 输入: 3 114514 1314520 100 输出: 6 80 900 根据样例,不难看出答案只跟最右边的非零数位有关。 点击查看代码 #include <bits/stdc++.h> #define rep(i, l, r) fo ......
练习赛 111 A-D

Codeforces Round 869 (Div. 2) A-D题解

比赛地址 A. Politics 题意:有n个人对m个决案进行投票,对于每一个决案如果票数相同则所有人都离场,反之票数少的一方离场,现在提前知道了每个人的意见,让一些人参与投票,在保证第一个人不离场的情况下最终剩余人数最多是多少 Solution 把和第一个意见不同的给去掉就行了 void solv ......
题解 Codeforces Round 869 A-D

Educational Codeforces Round 147 (A-D)

#A. Matching 橘子熊:这题太简单了我不想写 ##题面 Description 给定给一个带问号的字符串,求有多少种可能的数字 Input 多次询问,一次一个字符串 Output 对于每次询问,输出可能的数字的总数 数据范围与约定 2e5次询问,单词询问不超过5个字符 ##思路 主要思路 ......
Educational Codeforces Round 147 A-D

Educational Codeforces Round 147 (Rated for Div. 2) A-D题解

A. Matching 题意:给出一个数,数中可能会有?,可以用0-9替换问号,问最后有多少种方法 Solution 对于位于首位的数可以用1-9替换,对于其他位置的额、可以用0-9替换,如果首位为0则无解 void solve() { string s;cin>>s; if(s[0]=='0') ......
题解 Educational Codeforces Round Rated

练习记录-cf-Educational Codeforces Round 147 (A-D)

打的很烂的一场 C想了很久 D的贪心没有贪好 赛后一小时补起来了 谁是nc 我是nc! A. Matching 问有多少种情况能匹配 就计算?的个数 x10x10...... 如果第一个是? 那么就是9x10x10... 如果第一个是0 不能有前导0 就输出0 #include<bits/stdc+ ......

Codeforces Round 628 (Div. 2) A-D

Codeforces Round 628 (Div. 2) A. EhAb AnD gCd void solve(){ int n=read(); for(int i=1;i*i<=n;i++){ int g=__gcd(i,n-i); if(g*g+i*(n-i)==n*g){ cout<<i<< ......
Codeforces Round 628 A-D Div

练习记录-cf-div2-864(A-D)

状态不怎么好 场上就写出3道 还磨磨蹭蹭推错结论qwq 警钟长鸣 A. Li Hua and Maze 一开始以为要切割 发现就把其中一个包起来就行了 计算包某个块需要的最小块数 #include<bits/stdc++.h> #define close std::ios::sync_with_st ......
cf-div 864 A-D div cf

Codeforces Round 862 (Div. 2) A-D题解

比赛地址 A. We Need the Zero 题意:给出一个数组,对任意1<=i<=n,令bi=ai^x,问是否存在x,使得b1^b2^...^bn=0 Solution 如果n为奇数,那么x一定存在,因为偶数个x异或得到的是0,直接令x=0^(a1^a2^...^an)即可 如果n为偶数,那么 ......
题解 Codeforces Round 862 A-D

练习记录-cf-div2-682(A-D)

终于场上写出4道,听说E是树链剖分,学的不够深,学完再补 感动感动 A. We Need the Zero 题意:求一个数 所有数异或上这个数 使得所有数是异或和为0 分奇偶考虑,奇数个的情况下,异或这么多次,相当于只异或了1次x,那么先求出原数组的异或和,再异或一遍就是0了,x就是原数组的异或和、 ......
cf-div 682 A-D div cf

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

题目地址 A - Beautiful Sequence 题意:给出一个数组,问是否存在任意一个子区间,存在i,使得ai=i Solution 直接比较当前的数和i的大小就行了,当前为x,如果要求答案存在,必须有i>=x void solve() { int n;cin>>n; int flag=0; ......
题解 Div CodeTON Prizes Round

Codeforces Round 860 (Div. 2) A-D题解

比赛地址 A.Showstopper 题意:给两个数组a和b,可以进行任意次操作:交换a[i]和b[i],问能否使得a[n]和b[n]分别是数组a和b的最大值 Solution 假设a[n]和b[n]固定,对于每一个i,a[i]和b[i]只能选其中之一,并且必须选择比a[n]或者b[n]小的,如果只 ......
题解 Codeforces Round 860 A-D

AtCoder Beginner Contest 295 A-D题解

比赛地址 A.Probably English 1 void solve() 2 { 3 int n;cin>>n; 4 set<string>st; 5 st.insert("and"); 6 st.insert("not"); 7 st.insert("that"); 8 st.insert(" ......
题解 Beginner AtCoder Contest 295

Educational Codeforces Round 145 (Rated for Div. 2) A-D题解

比赛地址 A. Garland 1 void solve() 2 { 3 for(int i=1;i<=4;i++) 4 { 5 b[i]=a[i]=0; 6 } 7 int cnt=0; 8 string t;cin>>t; 9 set<int>st; 10 for(int i=0;i<4;i++ ......
题解 Educational Codeforces Round Rated

Codeforces Round #844 (Div. 1 + Div. 2, based on VK Cup 2022 - Elimination Round) A-D

比赛链接 A 题意 设计一条线路要贴着6个墙面走,从 $(a,b)$ 到 $(f,g)$ ,线路长度最短。 题解 知识点:模拟。 分类取最短即可。 时间复杂度 $O(1)$ 空间复杂度 $O(1)$ 代码 #include <bits/stdc++.h> #define ll long long u ......
Round Elimination Codeforces Div based
共53篇  :2/2页 首页上一页2下一页尾页