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
#Codeforces
CF1773J-King‘s Puzzle【构造】
正题题目链接:https://
codeforces
.com/contest/1773/problem/K题目大意要求构造一张nnn个点的无向图满足。
QuantAsk
·
2023-06-24 07:06
codeforces
构造
ICPC
Codeforces
Round #881 (Div. 3) Editorial题解
AB:这个题目的关键就是相连的重复的负数,相当于于一个负数,这个地方是可以优化的一个地方,然后注意到只要是有一个负数,就要进行一次操作,所以接直接检测隔着的相连的负数的个数就是最后的答案CD经典的dfs:从这个题目开始:对dfs这个所谓的深搜
lzllzz23
·
2023-06-24 05:20
深度优先
算法
F. Gardening Friends(树的直径)
Problem-1822F-
Codeforces
两位朋友Alisa和Yuki在他们的花园里种了一棵有n个顶点的树。树是一个无向图,没有循环、回路或多重边。这棵树中的每条边都有一个长度为k。
WYW___
·
2023-06-24 03:23
算法
B. Fish Graph(dfs找环)
Problem-1817B-
Codeforces
给定一个具有n个节点和m条边的简单无向图。请注意,该图不一定是连通的。节点从1到n标记。
WYW___
·
2023-06-24 03:23
深度优先
算法
C. Multiplicity(DP + 分解因数)
Problem-C-
Codeforces
给定一个整数数组a1,a2,...,an。如果可以从a中删除一些元素得到b,则称数组b为a的子序列。
WYW___
·
2023-06-24 03:53
c语言
算法
开发语言
C. Playing Piano(dfs)
Problem-C-
Codeforces
小Paul想学弹钢琴。他已经有了一首想要开始演奏的旋律。为简单起见,他将这个旋律表示为键号序列a1,a2,…,an:数字越大,它就越靠近钢琴键盘的右侧。
WYW___
·
2023-06-24 03:53
深度优先
算法
D. Running Miles(公式转换)
Problem-D-
Codeforces
有一条长为n的街道,其中第i个景点距离街道起点i英里。第i个景点的美丽值为bi。你想要在离街道起点l英里和r英里处开始和结束慢跑。
WYW___
·
2023-06-24 03:53
算法
B. Divide Candies(数学 + 思维)
Problem-B-
Codeforces
Arkady和他的朋友们喜欢在一个n×n的棋盘上玩跳棋。这个棋盘的行和列从1到n编号。他的朋友们最近赢了一场比赛,所以Actady想用一些糖果来取悦他们。
WYW___
·
2023-06-24 03:23
算法
D. Binary String Sorting(枚举位置)
Problem-1809D-
Codeforces
给定一个仅由字符0和/或1组成的二进制字符串s。您可以对此字符串执行几个操作(可能为零)。有两种类型的操作:选择两个相邻的元素并交换它们。
WYW___
·
2023-06-24 02:22
java
开发语言
Codeforces
Round #829 (Div. 2) (补)
A.我们只需判断每个Q后面是否有A就好了#includeusingnamespacestd;voidsolve(){intn;cin>>n;strings;cin>>s;intmp1=0,mp2=0;boolok=0;for(inti=0;imp2){ok=1;break;}if(s[i]=='Q')mp1--;elsemp2--;}if(ok)cout>t;while(t--){solve();
m0_62807361
·
2023-06-23 21:03
1024程序员节
Codeforces
Round #838 (Div. 2)(补)
这场签完到直接去睡觉了结果不如所料掉大分A.就是对每个数都暴力#includeusingnamespacestd;//#defineintlonglong#definepbpush_back#definemkpmake_pair#definelllonglong#definesz(i)(int)(i).size()#definemem(i,j)memset(i,j,sizeof(i))#defin
m0_62807361
·
2023-06-23 21:03
算法
c++
动态规划
Codeforces
Round #738 (Div. 2)(A-D1)
A.最大值最小因为0&1==00&0==0所以我们就把最大值二级进制看看都哪些数位能变成0得到的数就是最小#includeusingnamespacestd;//#defineintlonglong#definepbpush_back#definemkpmake_pair#definelllonglongtypedef__int128lll;#definesz(i)(int)(i).size()#
m0_62807361
·
2023-06-23 21:03
c++
算法
数据结构
Educational
Codeforces
Round 137 (Rated for Div. 2)(A-D)(补)
A.c(10-n)2*3即可#includeusingnamespacestd;voidsolve(){intn;cin>>n;for(inti=1;i>x;}intd=10-n;intsum=0;sum=d*(d-1);cout>t;while(t--){solve();}}B.把1和2分别放在两边即可#includeusingnamespacestd;voidsolve(){intn;cin>
m0_62807361
·
2023-06-23 21:02
c++
蓝桥杯
算法
Codeforces
Round #827 (Div. 4) A-G (补)
A.判段每一种情况即可#includeusingnamespacestd;constintINF=1e9;voidsolve(){boolok=0;inta,b,c;cin>>a>>b>>c;if(a+b==c||a+c==b||b+c==a)ok=1;if(ok)cout>t;while(t--){solve();}}B.如果每个数都只出现一次那么可以严格递增#includeusingnames
m0_62807361
·
2023-06-23 21:32
c++
算法
(sorting+贪心)打cf之路->micro-world
http://
codeforces
.com/problemset/problem/990/B这题是sorting+贪心,怪不得TE了惹QAQYouknowthatyouhavenbacteriainthePetridishandsizeofthei-thbacteriaisai.AlsoyouknowintergalacticpositiveintegerconstantKThei-thbacte
NewdawnFades
·
2023-06-23 21:12
蓝桥杯经验贴(第十四届蓝桥杯C++B组)
省赛和国赛的准备阶段在https://www.dotcpp.com/、https://dasai.lanqiao.cn/、https://www.luogu.com.cn/上练习往年真题,也会在力扣、AcWing、
Codeforces
openallzzz
·
2023-06-23 16:29
蓝桥杯
蓝桥杯
c++
算法
Codeforces
Round 873 (Div. 1) B1.Range Sorting (Easy Version)(单调栈)
题目给定长为n(nusingnamespacestd;typedeflonglongll;#definerep(i,a,b)for(inti=(a);i=(b);--i)#defineSZ(a)(int)(a.size())#definefifirst#definesesecondtypedefpairP;constintN=5e3+10;intt,n,a[N];Pstk[N];intmain()
Code92007
·
2023-06-23 08:17
#
单调栈/单调队列
算法
c++
单调栈
今夜科技谈 | AlphaCode 会不会影响程序员的饭碗?
AlphaCode是一个可以自主编程的系统,在
Codeforces
举办的编程竞赛中,超过了47%的人类工程师。这标志着AI代码生成系统,首次在编程竞赛中,达到了具有竞争力的水平。
·
2023-06-22 19:09
CODEFORCES
ROUND #645 (DIV. 2)
http://www.yyycode.cn/index.php/2020/05/30/
codeforces
-round-645-div-2/A.ParkLightingtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputDuetothecoronaviruspande
小菜鸡加油
·
2023-06-22 18:53
#
codeforces
#
前缀和
#
二分
Codeforces
Round #783 (Div. 2)
A.DirectionChangeSampleinput61121134246105Sampleoutput01-161017题意:现在有个n*m的迷宫,你可以向四个方向走,但是不能两次走同一个方向,问你最少走多少步从左上角走到右下角,若无法走到则输出-1思路:首先考虑方阵从左上角走到右下角需要的步数就是2*n-2,那么就想到了朝着比较长的那个边界走,然后构造出方阵情况就行了,下面看代码#incl
宇智波一打七~
·
2023-06-22 18:23
cf
cf
Codeforces
558B Amr and The Large Array 数组美丽值
题意:给一个数组,记数组中出现次数最多的元素出现的次数为这个数组的美丽值,求这个数组长度最短的子数组(要连续),使得该子数组的美丽值与原数组美丽值相等。要求输出子数组的起始和结束位置下标(从1开始)。也是个水题。每个数最大才10^6,用hash存储每个数出现的次数即可。注意有可能有多个不同的元素出现的次数都相等且为最大,需要一一判断。遍历数组的时候可以用两个值l[i],r[i]维护每个数最左出现的
FirstLucker
·
2023-06-22 15:02
水题
Codeforces
Round 874 (Div. 3)
Codeforces
Round874
Codeforces
Round874A.MusicalPuzzleB.RestoretheWeatherC.VladBuildingBeautifulArrayD.FlipperA.MusicalPuzzleExampleinput54abab7abacaba6aaaaaa7abcdefg5babddoutput24164NoteInthefirstsample
晓觉儿
·
2023-06-22 15:29
CodeForces
c++
算法
贪心算法
Codeforces
Round 764 (Div. 3)
比赛链接
Codeforces
Round764A.PlusOneontheSubsetB.MakeAPC.DivisionbyTwoandPermutationD.PalindromesColoringE.Masha-forgetfulA.PlusOneontheSubsetExampleinput3634241231000100299821211output341
晓觉儿
·
2023-06-22 15:29
CodeForces
c++
算法
贪心算法
Codeforces
Round 867 (Div. 3)(A题到E题)
链接:Dashboard-
Codeforces
Round867(Div.3)-
Codeforces
头一次div3做出来四题,第五题也差临门一脚,赛后看到别人e题跟自己几乎一样的思路肠悔青了,还得练才行A.TubeTubeFeed
lllrainbow
·
2023-06-22 15:58
c++
算法
图论
codeforces
round #797 (div.3)
codeforces
round#797(div.3)E.PriceMaximization给定nnn和kkk,将nnn(偶数)个数分成n/2n/2n/2组,每组两个数,令SiS_iSi为第i组的数的和,
RE自动机
·
2023-06-22 15:58
cf
round
贪心算法
算法
c++
数据结构
Codeforces
Round #744 (Div. 3)部分题解
开始前,我还是想提前庆祝一下,第一次写这么多题的题解QwQ~~。A点击此处查看对应的题目.本题模拟直接统计a,b,c的字母数量,最后判断c数量是否等于a+b数量。时间复杂度O(n)O(n)O(n)#includeusingnamespacestd;constintN=1e5+10,INF=1e9+1;inta,b,c;voidsolve(){a=0,b=0,c=0;strings;cin>>s;f
marvel121
·
2023-06-22 15:28
cf上分
算法
数据结构
Codeforces
Round #277.5 (Div. 2)
A.Problem-A-
Codeforces
题目大意:给n个数,两两交换次数不超过n次,使得最终序列不为降序。这个题乍一看不太好写,因为有个交换次数不大于n的条件。
Bob Young
·
2023-06-22 15:28
c++
算法
Codeforces
Round #776 (Div. 3) (A-E题解)
源代码:ACM/OpenjudgeNow/
Codeforces
atmaster·abmcar/ACM(github.com)更好的阅读体验:
Codeforces
Round#776(Div.3)(A-E题解
Abmcar
·
2023-06-22 15:28
#
Codeforces题解
算法
c++
leetcode
Codeforces
Round #839 (Div. 3)题解
//Contest:
Codeforces
-
Codeforces
Round#839(Div.3)//URL:https://
codeforces
.com/contest/1772/problem/A//MemoryLimit
Kicamon
·
2023-06-22 14:58
cf
c++
算法
数据结构
Codeforces
Round #776 (Div. 3)
菜鸡在这里做做笔记,各位进来的大佬我先orz了B#include#definelllonglongusingnamespacestd;constintN=2e5+10;constintinf=0x3f3f3f3f;intn;intmain(){longlongl,r,a;cin>>n;while(n--){cin>>l>>r>>a;if(a==1){cout#definelllonglongusi
布克波波
·
2023-06-22 14:57
codeforce刷题笔记
蓝桥杯
c++
算法
Codeforces
Round #803 (Div. 2) 题解
AXORMixup题目链接:A题解by:wlxBRisingSand题目链接:B题解链接:B题题解题解by:wushiC3SUMClosure题目链接:C题解链接:C题题解题解by:lyf(题解内含A-D题题解)DFixedPointGuessing题目链接:D题目链接:D题题解题解by:jc感谢大佬们的支持!!!
Euphria
·
2023-06-22 14:57
算法
c++
Codeforces
Round #804 (Div. 2)题解
A.TheThirdThreeNumberProblem题目链接:A题解链接:A题题解作者:dcyB.AlmostTernaryMatrix题目链接:B题解链接:B题题解作者:lcxC.TheThirdProblem题目链接:C题解链接:C题链接作者:wjx该场为5题div2的场次,所以赛时出题最高到达C题,未能成功开出D题
Euphria
·
2023-06-22 14:57
算法
数据结构
c++
Codeforces
Round 776 (Div. 3) Tutorial (zh)
Codeforces
Round776
Codeforces
Round776A.DeletionsofTwoAdjacentLettersB.DIV+MODC.WeightoftheSystemofNestedSegmentsD.TwistthePermutationE.ReschedulingtheExamA.DeletionsofTwoAdjacentLettersExampleinput5abc
晓觉儿
·
2023-06-22 14:27
CodeForces
算法
c++
Codeforces
Mahmoud the Thief(思维)
AsAyoubwasgoinghomefromMahmoud'shouse,herememberedthatheforgothisharddisk,whichcontainsthesolutionstonproblemsfromtheJUFlashcontest.Theithproblemhassizeai.Whilepanicking,herememberedthatheinstalledaso
谳情
·
2023-06-22 08:31
c++
算法
Codeforces
Round 871 (Div. 4) A~H
A.LoveStory题意:找不同思路:水#includeusingnamespacestd;#definelllonglong#definelson(x)(1>t;while(t--){stringstr;cin>>str;intnum=0;for(inti=0;iusingnamespacestd;#definelllonglong#definelson(x)(1>t;while(t--){i
xxcdsg
·
2023-06-22 06:52
练习
深度优先
算法
图论
Codeforces
Round 876 (Div. 2) A~E
杂谈:应付期末考试,连着两三周都没正经打代码,先来6把
codeforces
练练手,结果直接就把第一场全写出来了(太棒了)不过第二题就读假题结果用了45分钟,都和后面的题用时差不多了正经的
Codeforces
Round876
xxcdsg
·
2023-06-22 06:52
练习
c++
算法
Codeforces
Round 870 (Div. 2) A~D
A.TrustNobody题意:n个人,其中一些人是骗子,每个人会说至少有几个骗子,问到底有多少个骗子(任意成立情况,矛盾输出-1)思路:枚举骗子人数,枚举到这个骗子人数时,比这个数小的人说的都是真话,其他人都是骗子,因此有n−前缀==in-前缀==in−前缀==i#includeusingnamespacestd;#definelson(x)(1>t;while(t--){intn;cin>>n
xxcdsg
·
2023-06-22 06:22
练习
c++
算法
Codeforces
Round 877 (Div. 2) A~D
Codeforces
Round877(Div.2)A.BlackboardList题意:给两个数,两个差的绝对值为新数,现给出最后的结果,问一开始的两个数的其中一个为什么。
xxcdsg
·
2023-06-22 06:49
练习
c++
算法
Codeforces
Round 867 (Div. 3) AK题解
目录A.TubeTubeFeed(签到)题意:思路:代码:B.KarinaandArray(签到)题意:思路:代码:C.BunLover(结论)题意:思路:代码:D.Super-Permutation(思维)题意:思路:代码:E.MakingAnti-Palindromes(思维)题意:思路:代码:F.GardeningFriends(图dfs)题意:思路:代码:G2.MagicTriples(H
just afw
·
2023-06-21 06:02
算法
c++
数据结构
Codeforces
Round 879 (Div. 2) AK题解
目录A.UnitArray题意:思路:代码:B.MaximumStrength题意:思路:代码:C.GamewithReversing题意:思路:代码:D.SurveyinClass(区间减法)题意:思路:代码:E.MEXofLCM(子区间枚举+前缀和思想)题意:思路:代码:F.Typewriter(思维)题意:思路:代码:A.UnitArrayGivenanarrayaoflengthn,whi
just afw
·
2023-06-21 06:31
算法
c++
Codeforces
Round 880 (Div. 2)题解
C.k-thequalityConsiderallequalitiesofforma+b=c,whereahasAdigits,bhasBdigits,andchasCdigits.Allthenumbersarepositiveintegersandarewrittenwithoutleadingzeroes.Findthek-thlexicographicallysmallestequalit
just afw
·
2023-06-21 06:31
c++
算法
Codeforces
Round 881 (Div. 3) 题解
目录A.SashaandArrayColoring题意:思路:代码:B.LongLong题意:思路:代码:C.SuminBinaryTree题意:思路:代码:D.AppleTree(树形dp)题意:思路:代码:E.TrackingSegments(二分答案)题意:思路:代码:F1.OmskMetro(simpleversion)(树形dp)题意:思路:代码:A.SashaandArrayColor
just afw
·
2023-06-21 06:00
c++
算法
数据结构
Codeforces
1734F 数位 DP
题意传送门
Codeforces
1734FZerosandOnes题解Si=1S_{i}=1Si=1当且仅当iii的二进制表示中111的个数为奇数。
SHOHOKUKU
·
2023-06-20 10:20
DP
算法
【
Codeforces
】 CF1515E Phoenix and Computers
题目链接点击打开链接题目解法考虑开电脑的过程相当于连通块的操作,可以不考虑每个点的真实位置,只考虑每个点在当前几个点中的相对位置可以令dp[i][j]dp[i][j]dp[i][j]表示有iii个点,构成jjj个连通块的方案数,其中每个点之间有序向这类维护连通块的dpdpdp有一个特殊的做法(可以包含添加新的连通块,在连通块中添加新的元素,合并222个连通块的操作)添加新的连通块即新加一个元素构成
Farmer_D
·
2023-06-19 19:27
Codeforces
算法
【
Codeforces
】 CF1149C. Tree Generator™
题目链接
Codeforces
方向Luogu方向题目解法首先给出一个引理一段序列去掉所有的匹配括号之后,剩下的序列一定组成一条链,且这条链的长度就是剩下序列的长度可以粗糙地证明一下:学过了树上莫队的知道:
Farmer_D
·
2023-06-19 19:56
Codeforces
算法
【
Codeforces
】
Codeforces
Round #843 (Div. 2)
比赛链接点击打开链接官方题解点击打开链接ProblemA1.GardenerandtheCapybaras(easyversion)直接按照题意模拟即可时间复杂度,因为有的常数,所以可以通过#includeusingnamespacestd;constintN(200100);intT,n;charc[N];inlineintread(){intFF=0,RR=1;charch=getchar()
Farmer_D
·
2023-06-19 19:56
Codeforces
算法
Educational
Codeforces
Round 149 (Rated for Div. 2)(A—D、F)
文章目录A.GrasshopperonaLine1、问题2、分析3、代码B.ComparisonString1、问题2、分析3、代码C.BestBinaryString1、问题2、分析3、代码D.BracketColoring1、问题2、分析3、代码E.PlayoffFixing1、问题2、分析3、代码F.EditorialforTwo1、问题2、分析3、代码A.GrasshopperonaLin
Turing_Sheep
·
2023-06-19 07:49
codeforces
比赛记录
算法
数学建模
Codeforces
Round 875 (Div. 2)(A—D)
文章目录A.TwinPermutations1、分析2、代码B.Arraymerging1、分析2、代码C.CopilCopacDrawsTrees1、分析2、代码D.TheBOSSCanCountPairs1、分析2、代码A.TwinPermutationsA.TwinPermutations1、分析作者这里的构造方法是让最终的数组满足:a1+b1=a2+b2=...=ai+bi=n+1a_1+
Turing_Sheep
·
2023-06-19 07:48
codeforces
比赛记录
算法
数据结构
c++
CF:
Codeforces
Round 879 (Div. 2)A. Unit Array
Givenanarrayaaoflengthnn,whichelementsareequalto−1−1and11.Let'scallthearrayaagoodifthefollowingconditionsareheldatthesametime:a1+a2+…+an≥0a1+a2+…+an≥0;a1⋅a2⋅…⋅an=1a1⋅a2⋅…⋅an=1.Inoneoperation,youcansel
爱吃曲琪
·
2023-06-19 04:29
开发语言
c++
算法
cf:
Codeforces
Round 879 (Div. 2) B. Maximum Strength
Fedyaisplayinganewgamecalled"TheLegendofLink",inwhichoneofthecharacter'sabilitiesistocombinetwomaterialsintooneweapon.Eachmaterialhasitsownstrength,whichcanberepresentedbyapositiveintegerxx.Thestrengt
爱吃曲琪
·
2023-06-19 04:58
数学建模
算法
matlab
上一页
32
33
34
35
36
37
38
39
下一页
按字母分类:
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
其他