E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
codeforce
Codeforce
s Round #776 (Div. 3)
Codeforce
sRound#776(Div.3)A.DeletionsofTwoAdjacentLetters题目大意给定一个字符串s和一个字符c,能对字符串进行删除操作,删除相邻两个,求能否的到字符
冰镇白干
·
2023-08-19 10:26
比赛
c++
算法
开发语言
Educational
Codeforce
s Round 62 (Rated for Div. 2) C. Playlist
一开始肯定要排个序,b相同时t大的在前边,不同时b大的在前面。然后想最多只能选k个的限制,可以这样想,每次用到的b只能用已选到的最小的值,那可以把每个b都枚举一遍,然后每一次选时长最长的,且b大于等于当前的b的那k个不就好了吗,时间复杂度也才O(n),然后考虑怎么才能每次快速地选到最大的,这时候就可以考虑优先队列了,每次排序都是logn的复杂度,nlogn,完美。#include#defineIO
泠楠子
·
2023-08-19 07:00
日常水题
c++
算法
数据结构
Problem - 1000F -
Codeforce
s
线段树离线处理Problem-1000F-
Codeforce
s问题描述:一个序列,q次询问。求区间[l,r]中只出现一次的数(任意一个即可)。思路:离线处理,用线段树。
golitter.
·
2023-08-19 05:42
cf
算法题
算法
Codeforce
s算法心得——A. Escalator Conversations
大家好,我是晴天学长,今天开始尝试一些外国的题目了,不得不说,创新性挺高的,然后是全英文,也可以练练英文的水平,后面我会持续的更新的!加油!1)A.EscalatorConversations2).算法思路自动扶梯对话(直接暴力)1.接收数据N组2.接收数据n,m,k,H3.再接受身高的数组4.初始变量ans=0;5.开始遍历数组,相减是倍数的话就ans++,注意不能和自己一样高6.输出ans3)
晴天学长
·
2023-08-18 19:07
算法
算法
python
开发语言
Codeforce
s算法心得——A. Array Coloring
大家好,我是晴天学长,确实全世界最大的算法竞赛平台有很多独特且创新的地方,后面我会持续的更新的!加油!1)A.ArrayColoring2).算法思路数组中的奇数个数一定要是偶数才行1.接受n个测试组2.接受k个测试数据,统计奇数个数,sum3.数组的奇数个数是偶数,输出YES,反之输出NO。3).代码示例importjava.util.Scanner;publicclassArrayColori
晴天学长
·
2023-08-18 19:33
算法
Codeforce
s Round 891 (Div. 3)
A.ArrayColoring//判断奇数出现的个数即可voidsolve(){intn;cin>>n;intcnt=0;for(inti=0,t;i>t;cnt+=t&1;}cout>s;stringresult;blok=false;for(inti=0;i='5'){intrem=0;for(intj=sz(result)-1;j>=0;--j){result[j]+=rem;if(resu
_yxc___
·
2023-08-18 00:28
被CF虐待的日常
算法
java
数据结构
Codeforce
s 826 (vp)
前情提要:csdn的app真垃圾啊,既然不能插入代码段,就把代码放正文吧。A:题目有点搞的,s结尾和l结尾两种情况下x的数量变多判定方式不一样voidsolve(){stringa,b;cin>>a>>b;intn=sz(a),m=sz(b);mapmapp;mapp['S']=0;mapp['M']=1;mapp['L']=2;charresult;if(mapp[a[n-1]]>mapp[b[
_yxc___
·
2023-08-18 00:28
被CF虐待的日常
算法
c++
Codeforce
s Round 863 (Div. 3)
A.InsertDigit题意:给定一个数字字符串s和一个数字d,将d找一个位置插入,让这个字符串的数值达到最大。思路:关键点在于找到字符插入的位置,字符插入后字符串会多一位,所以目的是尽可能让高位的字符串的数值大。也就是说,字符串插入的位置的左边的数都是高位,应该都比当前要插入的数大。所以问题也就演变成了查找第一个小于d的字符的位置,或者说是查找最后一个大于d的字符,让d插入到这个数后面。这里区
_yxc___
·
2023-08-18 00:27
被CF虐待的日常
sql
数据库
mysql
Codeforce
s Round 892 (Div. 2)(VP)
A//b里放最小值,其他值放c。如果最大值=最小值,则无解。voidsolve(){ intn;cin>>n; via(n);liter(x,a)cin>>x;sort(all(a)); if(a[0]==a[n-1]){ print(-1);return; } vib,c; for(inti=0;i>n; vvia(n); llsum
_yxc___
·
2023-08-18 00:26
被CF虐待的日常
算法
数据结构
c++
codeforce
s 149-D. Bracket Coloring
原题链接题目大意:字符串只包含左右括号的。好的字符串有两种形式(1)左右括号匹配的序列(2)字符串逆置后左右括号匹配的序列。现在要你对一个字符串每个字符涂一种颜色,使得同种颜色的字符序列拿出来以后是“好的字符串”。需要输出(1)最少涂几种颜色(2)输出每个字符对应的颜色编号。分析:观察样例,实际上颜色的数量最多就两种,因为只能“逆置”,所以字符串中左右括号数量必须相同才能完成“涂色”+“好的字符串
sigd
·
2023-08-17 12:05
算法
算法
Codeforce
s Round 893 (Div. 2)-B. The Walkway
Problem-B-
Codeforce
s题目大意:总长度为n的路径上有m个点,主角在从1走到n的过程中需要饼干。
sigd
·
2023-08-17 12:02
算法
算法
西工大校赛2 weekly contest 10.16
西工大校赛2weeklycontest10.16[Problems-
Codeforce
s.pdf](assets/Problems-
Codeforce
s-20221019121149-0g83yz5.pdf
xjsc01
·
2023-08-17 10:51
#
CodeForce
深度优先
算法
图论
暑假刷题第26天--8/15
Problem-A-
Codeforce
s#include#include#include#includeusingnamespacestd;constintN=200005;inta[N];voidsolve
不能AC的小菜鸡
·
2023-08-17 07:19
暑假打卡
c++
算法
数据结构
Codeforce
s Round 888 (Div. 3)ABC
Codeforce
sRound888(Div.3)目录A.EscalatorConversations题目大意思路代码B.ParitySort题目大意思路代码C.TilesComeback题目大意思路代码
想要AC的sjh
·
2023-08-17 03:24
ACM
算法
数据结构
c++
codeforces
Codeforce
s Round 893 (Div. 2)ABC
Codeforce
sRound893(Div.2)目录A.Buttons题目大意思路核心代码B.TheWalkway题目大意思路核心代码C.YetAnotherPermutationProblem题目大意思路核心代码
想要AC的sjh
·
2023-08-17 03:52
ACM
c++
算法
数论
codeforces
Yet Another Permutation Problem(
Codeforce
s Round 893 (Div. 2))
Alexgotanewgamecalled“GCDpermutations”asabirthdaypresent.Eachroundofthisgameproceedsasfollows:First,Alexchoosesapermutation†^{\dagger}†a1,a2,…,ana_1,a_2,\ldots,a_na1,a2,…,anofintegersfrom111tonnn.Then
前 方
·
2023-08-16 19:25
cf
算法
codeforces
Copil Copac Draws Trees(
Codeforce
s Round 875 (Div. 1))
CopilCopacisgivenalistofn−1n-1n−1edgesdescribingatreeofnnnvertices.Hedecidestodrawitusingthefollowingalgorithm:Step000:Drawsthefirstvertex(vertex111).Gotostep111.Step111:Foreveryedgeintheinput,inorder
前 方
·
2023-08-16 19:23
cf
codeforces
图论
Maximum Rounding(
Codeforce
s Round 891 (Div. 3))
一.题目描述题目大意:题目链接:B.MaximumRounding(
Codeforce
sRound891(Div.3))二.思路分析先从前往后找大于等于5的数字,找到之后将这一位以及后面的数字全部置为0
PH_modest
·
2023-08-16 14:10
每日一题
算法
c++
学习
codeforces
Codeforce
s Round 892 (Div. 2) A~C
A.UnitedWeStand题意要求其中一个数组不能出现被除数的关系,那么只需要把最小的数放在p数组,其他的数放在q数组就可以了,如果q数组是空的则输出-1#include#include#include#defineintlonglongusingnamespacestd;signedmain(){intT;cin>>T;inta[200];while(T--){intn;cin>>n;for
Lsxp1991
·
2023-08-14 19:50
c语言
算法
c++
开发语言
数据结构
codeforce
s代:
感受思维的美丽,abcde题目的思路是怎么样的:上蓝上紫可以代:有问题可以评论区直接问我也可以+q:639682754
codeforces1
·
2023-08-14 16:12
codeforces
算法
数据结构
Codeforce
s Round 890 (Div. 2) supported by Constructor Institute
把c题目做出来了,但是前两个题目用的时间太长了,必须保证15分钟之内做完两个题目,这样就能保证上分了,抓住关键(x&(-x))usingi64=longlong;constexprintN=2e5+10;constexprintmod
lamentropetion
·
2023-08-14 01:52
线段树与树状数组
动态规划
哈希算法
算法
【构造】CF1853D
Problem-D-
Codeforce
s题意:思路:Code:#includeusingi64=longlong;constintN=1e6+10;intans[N];voidsolve(){intn;
lamentropetion
·
2023-08-14 01:52
构造
算法
暑期集训补题系列Day1--模拟/暴力求解
Day1模拟/暴力求解C-CurriculumVitae
Codeforce
s-846A遍历每个位置,计算之前0的个数和之后1的个数,更新ans为这个值的最大值#include#includeusingnamespacestd
D0m1no
·
2023-08-14 01:43
Codeforces
算法
暴力
Codeforce
s Round 889 (Div. 2)题解
目录A.DaltontheTeacher题目大意题解思路代码B.LongestDivisorsInterval题目大意题解思路代码C1.Dual(EasyVersion)题目大意题解思路代码A.DaltontheTeacher题目链接题目大意Dalton是一个班级的老师,这个班级有nnn个学生,分别使用1~n来代表这些学生。课室包含nnn张椅子,编号也是对应1~n,一开始学生iii坐在凳子pipi
想要AC的sjh
·
2023-08-13 23:29
ACM
算法
c++
数据结构
codeforces
Codeforce
s Round 891 (Div. 3)ABC
Codeforce
sRound891(Div.3)目录A.ArrayColoring题目大意思路代码B.MaximumRounding题目大意思路代码C.AssemblyviaMinimums题目大意思路代码
想要AC的sjh
·
2023-08-13 23:59
ACM
算法
c++
数据结构
codeforces
Codeforce
s Round 893 (Div. 2)ABC
Codeforce
sRound892(Div.2)目录A.UnitedWeStand题目大意思路代码B.OlyaandGamewithArrays题目大意思路代码C.AnotherPermutationProblem
想要AC的sjh
·
2023-08-13 23:58
ACM
算法
数据结构
c++
codeforces
Codeforce
s-Round-891-Div-3
Codeforce
sRound891(Div.3)A.ArrayColoring题目给你一个由nnn个整数组成的数组。
重生之我是cxk
·
2023-08-13 21:42
ACM-
ICPC
#
Codeforces
算法
数据结构
c++
【
Codeforce
s】 CF1436F Sum Over Subsets
题目链接CF方向Luogu方向题目解法首先考虑消去gcdgcdgcd的限制考虑莫比乌斯反演优先枚举ddd可得答案为∑d=1nμ(d)∗ans(d)\sum_{d=1}^{n}\mu(d)*ans(d)∑d=1nμ(d)∗ans(d)其中ans(d)ans(d)ans(d)是所有aia_iai是ddd的倍数组成的答案令aia_iai为ddd的倍数的所有数的可重集为SSS考虑∑x∈Ax∗∑y∈By=∑
Farmer_D
·
2023-08-13 11:35
Codeforces
算法
【
Codeforce
s】 CF468C Hack it!
题目链接CF方向Luogu方向题目解法令∑i=11e18f(i)≡g(g#defineintlonglongusingnamespacestd;constintmul=1e18;inlineintread(){intFF=0,RR=1;charch=getchar();for(;!isdigit(ch);ch=getchar())if(ch=='-')RR=-1;for(;isdigit(ch);
Farmer_D
·
2023-08-13 11:35
Codeforces
算法
【
Codeforce
s】 CF1734E Rectangular Congruence
题目链接CF方向Luogu方向题目解法暂时不考虑bib_ibi的限制考虑构造ai,j=ija_{i,j}=ijai,j=ij,那么ar1,c1+ar2,c2=r1c1+r2c2, ar1,c2+ar1,c2=r1c2+r2c1a_{r1,c1}+a_{r2,c2}=r1c1+r2c2,\;a_{r1,c2}+a_{r1,c2}=r1c2+r2c1ar1,c1+ar2,c2=r1c1+r2c2,a
Farmer_D
·
2023-08-13 11:35
Codeforces
算法
Codeforce
s Round 890 (Div. 2) supported by Constructor Institute C. To Become Max
Codeforce
sRound890(Div.2)supportedbyConstructorInstituteC.ToBecomeMaxCode:#include#includeusingnamespacestd
极地星辰
·
2023-08-13 08:24
codeforces
ACM-ICPC算法
算法
c++
数据结构
Codeforce
s Round #785 (Div. 2) C. Palindrome Basis
C.PalindromeBasis题干略AC代码:#include#include#include#include#include#include#include#include#include#include#includeusingnamespacestd;constintmod=1e9+7;constintmaxn=40010;longlonga[maxn];longlongb[maxn]=
极地星辰
·
2023-08-13 08:53
codeforces
ACM-ICPC算法
c语言
c++
动态规划
Codeforce
s Round 892 (Div. 2) C. Another Permutation Problem 纯数学方法 思维题
Codeforce
sRound892(Div.2)C.AnotherPermutationProblem源码:#include#include#include#include#include#include
极地星辰
·
2023-08-13 08:52
ACM-ICPC算法
codeforces
数论
c语言
算法
开发语言
暑假集训笔记
Problem-D-
Codeforce
s这题比赛的时候用dfs打了个全排列,有点猜的成分..然后就猜对了在比赛过程中没有验证其正确性,今天看了题解,发现确实证明的很好!!
_ounce
·
2023-08-13 05:24
笔记
算法
c++
暑假集训笔记
Problem-B-
Codeforce
s这题看了好久,一直没思路..也可能是早上来没睡醒的原因吧.有点困..昨天晚上12点睡的,然后早上直接睡到7.48....真的6啊话说这题真有点猜的成分,先说我的思路
_ounce
·
2023-08-13 05:23
笔记
算法
c++
Codeforce
s Round 828 (Div. 3)E题题解
文章目录[DivisibleNumbers(easyversion)](https://
codeforce
s.com/contest/1744/problem/E1)问题建模问题分析代码[DivisibleNumbers
ChuRi_BaiYu
·
2023-08-12 19:14
CFdiv3题解
深度优先
算法
【枚举】CF1660 D
Problem-1660D-
Codeforce
s题意:思路:思路巨简单,代码也wa了很多发才过,都是因为细节....很显然,要根据0分段处理对于每一段,枚举去掉左边段还是右边段,左边段是l到第一个负数,
lamentropetion
·
2023-08-12 19:14
枚举
算法
【数学】CF1514 C
Problem-1514C-
Codeforce
s题意:思路:Code:#includeusingi64=longlong;constexprintN=2e5+10;constexprintM=2e5+10
lamentropetion
·
2023-08-12 19:44
数学
算法
【二分+贪心】CF1622 C
Problem-1622C-
Codeforce
s题意:思路:首先,观察样例可知,肯定是把原本的最小值减到某个值,然后再复制几次复制的时候肯定是从大到小复制那把最小值减到哪个值是不确定的,考虑枚举这个值?
lamentropetion
·
2023-08-12 19:13
二分
贪心
算法
Codeforce
s Round 888 (Div. 3) A~F
原题链接:Dashboard-
Codeforce
sRound888(Div.3)-
Codeforce
s目录A.EscalatorConversationsB.ParitySortC.TilesComebackD.PrefixPermutationSumsE.NastyaandPotionsF.LisaandtheMartiansA.EscalatorConversations
JGOOD是是
·
2023-08-10 18:05
codeforces题解
算法
c++
数据结构
Educational
Codeforce
s Round 152 F. XOR Partition(boruvka完全图最小生成树/二分+trie+贪心+二分图判定)
题目给定n(n//#includeusingnamespacestd;#definepbpush_back#definefifirst#definesesecondtypedeflonglongll;typedefpairP;constintN=2e5+10,M=30*N;intn,u,v,w,a[N],tr[M][2],id[M],c;charans[N];vectore[N];boolvis[
Code92007
·
2023-08-10 11:11
乱搞AC
#
#
字典树
二分
最小生成树
二分图判定
boruvka
trie字典树
Codeforce
s Round 890 (Div. 2) E2. PermuTree (hard version)(根号分治+二进制优化多重背包+不定长bitset优化01背包)(nsqrt/w)
题目n(nvoidsolve(){if(LEN();return;}}solve();题解每个子树u的直连儿子v,每个v有一个size,在对lca决策的时候,将一部分放比lca小的值,另一部分放比lca大的值,这样贡献就是小的个数*大的个数,相当于做一个背包,使得二者越接近越好计u的子树size总和为tot,如果存在一个子树的size超过tot的一半,显然可以直接算否则,每个子树的size都不超过
Code92007
·
2023-08-10 11:41
#
dp优化
背包
bitset优化
01背包
多重背包
Codeforce
s Round #833 (Div. 2) D. ConstructOR(构造 逆元/exgcd)
题目t(tusingnamespacestd;typedeflonglongll;intt,a,b,c,d,v;intmain(){cin>>t;while(t--){cin>>a>>b>>d;c=0;while(a%2==0&&b%2==0&&d%2==0){a/=2,b/=2,d/=2;c++;}if(d%2==0){coutusingnamespacestd;typedeflonglongl
Code92007
·
2023-08-10 11:10
思维题
构造
数论
构造
逆元
思维题
exgcd
Codeforce
s Round 890 (Div. 2) D. More Wrong(交互题 贪心/启发式 补写法)
题目t(tusingnamespacestd;#definerep(i,a,b)for(inti=(a);i=(b);--i)typedeflonglongll;typedefdoubledb;typedefpairPI;#definefifirst#definesesecond#definepbpush_back#definedbg(x)cerrnow(n);iota(now.begin(),n
Code92007
·
2023-08-10 11:09
思维题
交互
交互题
贪心
启发式
【二分】CF1623 C
Problem-1623C-
Codeforce
s题意:思路:肯定是二分,我们去二分最小值,然后check的时候最小值要大于midcheck的时候要让最小值尽可能大注意到我们不需要去管最大值,只需要最小值尽可能大就好了
lamentropetion
·
2023-08-10 08:52
二分
算法
【数学】CF1796 C
Problem-1796C-
Codeforce
s题意:思路:模拟一下样例可以发现一些规律Code:#include#defineintlonglongusingi64=longlong;constexprintN
lamentropetion
·
2023-08-10 07:38
数学
c语言
开发语言
Codeforce
s Round 870 (Div. 2)AB
然后结果非常的惨淡,一共开了4道题,然后一道题目都没有做来了,这件很伤心的事情,但是正如高中的语文老师所说的,我应该值得庆幸,这是平常训练而不是考试,如果是考试的话自己就没了...AProblem-A-
Codeforce
s
_ounce
·
2023-08-09 17:09
算法
暑假集训记录8.2
哭..Problem-1396A-
Codeforce
s一道1600分的题,没看题解自己写出来了...但就是wa了好几发,看了样例...先说说我的思路极其的麻烦啊!!
_ounce
·
2023-08-09 17:09
笔记
算法
8. 3和8.4暑假集训
昨天又又又又那个了..今天上午写了一道1600分的题,写了快2个小时也没整出来....然后又做了一道1500分异或的题,又没出来下午打航电多校,只出了一题..其他的题直接离谱...Problem-1348C-
Codeforce
s
_ounce
·
2023-08-09 17:09
c++
算法
开发语言
上一页
28
29
30
31
32
33
34
35
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他