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】510B - Fox And Two Dots(bfs)
点击打开题目B.FoxAndTwoDotstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputFoxCielisplayingamobilepuzzlegamecalled"TwoDots".Thebasiclevelsareplayedonaboardofsizen
wyg1997
·
2020-08-16 04:13
DFS&BFS
【队伍训练3】
Codeforce
s Round #661 (Div. 3)
A签到#include#defineiosios::sync_with_stdio(false);cin.tie(0);cout.tie(0);usingnamespacestd;inta[105];intmain(){iosintn,t;cin>>t;while(t--){cin>>n;for(inti=1;i>a[i];}sort(a+1,a+n+1);boolflag=1;for(inti=
zha_zha_wei
·
2020-08-16 01:50
c
c++
CodeForce
s 471C
E-ECrawlinginprocess...CrawlingfailedTimeLimit:1000MSMemoryLimit:262144KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForce
s471CuDebugDescriptionInputOutputSampleInputSampleOutputHintDescriptionPo
饮溪
·
2020-08-15 23:58
数据结构与算法
cf 1349b Orac and Medians
http://
codeforce
s.com/contest/1349/problem/B题意:给n个数和k,每次操作可以把一段子序列换成它的中位数(偶数的中位数算中间两个数里前面的那个),求是否可以通过若干次操作把它全变成
OlER小昆
·
2020-08-15 20:59
codeforces
codeforce
s 17c
题目看起来简单但比较难,一开始想了一会就想出一种比较类似的做法,但是正解一直没有想出来。后来看了标程和题解,想了好几天才明白。题意:有一个只由abc构成的字符串,可以进行2种操作,把相邻的两个字母前一个换成后面的或把后面的换成前面的。比如ab操作一次可以变成aa或bb。一个字符串称作“平衡的”指它里面出现abc的个数两两只差不超过1。问经过任意次操作后得到的字符串有多少个是“平衡的”。思路:对于字
OlER小昆
·
2020-08-15 20:27
codeforces
Codeforce
s Round #617 (Div. 3) (A ~ F)
A.ArraywithOddSumtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenanarrayaaconsistingofnnintegers.Inonemove,youcanchoosetwoindices1≤i,j≤n1≤i,j≤nsuc
东野圭吾#
·
2020-08-15 20:06
Codeforces
[CF]
Codeforce
s Round #515 (Div. 3)
A.VovaandTrainDescriptionVovaplanstogototheconferencebytrain.Initially,thetrainisatthepoint11andthedestinationpointofthepathisthepointLL.Thespeedofthetrainis11lengthunitperminute(i.e.atthefirstminutet
weixin_30667301
·
2020-08-15 19:02
Codeforce
s Round #624 (Div. 3) 解(补)题报告
前言由于我熬夜的时候解题效率很差,因此在决定开始打CF之后,尽量在比赛后的第二天拉一套题在VJ上面做,就当成练习题做,因为比赛的话自己水平还比较低,先多做Div3,这个比赛是我第一次做div3,做了三道,补了两道(比较菜的那种)E题待补A-AddOddorSubtractEven(签到)Youaregiventwopositiveintegersaandb.Inonemove,youcanchan
Happig丶
·
2020-08-15 19:25
Codeforces
Codeforce
s780C
题解:n个气球从1到n染色,如果a、b和c是不同的正方形,a和b在它们之间有一条直接的路径,b和c之间有一条直接的路径,然后在这三个方块上的气球颜色是不同的。AC代码#include#include#include#include#include#include#include#include#include#includeusingnamespacestd;constintmaxn=200010
dianxue5904
·
2020-08-15 18:32
数据结构与算法
2018-2019 XIX Open Cup, Grand Prix of Korea (Division 2) GYM 102058 F SG函数
http://
codeforce
s.com/gym/102058/problem/F题意:平面上n个点两个人轮流在任意两个点之间连一条线但是不能和已有的线相交,先围成一个凸多边形的获胜,先手赢还是后手赢
dianxue5904
·
2020-08-15 18:02
寒假做题列表
寒假做题列表:1A.Reconnaissance21月6http://
codeforce
s.com/problemset/problem/34/A2A.RestoringPassword1月6http:
ZZZZone
·
2020-08-15 18:56
B - Segment Sum
CodeForce
s - 1073E
B-SegmentSum
CodeForce
s-1073EYouaregiventwointegersllandrr(l≤rl≤r).Yourtaskistocalculatethesumofnumbersfromlltorr
Longlongaaago
·
2020-08-15 18:52
#
数位dp
#
ACM
codeforce
s 367 D. Vasiliy's Multiset
D.Vasiliy'sMultisettimelimitpertest4secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAuthorhasgoneoutofthestoriesaboutVasiliy,sohereisjustaformaltaskdescription.Youaregivenqq
让我改变你的心智
·
2020-08-15 17:38
字典树
C. Journey
CodeForce
s–839CTherearencitiesandn - 1roadsintheSevenKingdoms,eachroadconnectstwocitiesandwecanreachanycityfromanyotherbytheroads.TheonandYaraGreyjoyareonahorseinthefirstcity
小菜鸡加油
·
2020-08-15 17:02
树的dfs
Educational
Codeforce
s Round 92 (Rated for Div. 2)题解(A-C)
1389A.LCMProblem害,水题a的太慢,一开始还想着暴力,时间复杂度都没看,还有没用longlong结果交了3次,后面的不会,水题a的慢,得改改。题意:给定两个整数定义的闭区间[l,r],让你在区间内找出两个数x,y满足LCM(x,y)≤r;思路:容易验证LCM(x,y)至少是min(x,y)的二倍,所以直接构造一组最小的解(l,2l)(l,2l)#includeusingnamespa
nefu_zc
·
2020-08-15 17:15
codeforces
codeforce
s 909b
#includeusingnamespacestd;typedeflonglongll;intmain(){inta[5000];memset(a,0,sizeof(a));a[0]=0;a[1]=1;a[2]=2;a[3]=4;a[4]=6;intn;cin>>n;for(inti=5;i<=100;i++)a[i]=2*a[i-1]-2*a[i-3]+a[i-4];cout<
algorithm戏言
·
2020-08-15 17:11
算法
CodeForce
s 682A
AA-AlyonaandNumbersTimeLimit:1000MSMemoryLimit:262144KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForce
s682ADescriptionAfterf
xzt1996
·
2020-08-15 17:13
CodeForce
s 342C
CC-CupboardandBalloonsTimeLimit:2000MSMemoryLimit:262144KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForce
s342CDescriptionAgi
xzt1996
·
2020-08-15 17:13
CodeForce
s 342A
AA-XeniaandDivisorsTimeLimit:1000MSMemoryLimit:262144KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForce
s342ADescriptionXeniat
xzt1996
·
2020-08-15 17:12
CodeForce
s 339C
/GG-XeniaandWeightsTimeLimit:2000MSMemoryLimit:262144KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForce
s339CDescriptionXeniaha
xzt1996
·
2020-08-15 17:42
CodeForce
s 682B
problem/BB-AlyonaandMexTimeLimit:1000MSMemoryLimit:262144KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForce
s682BDescriptionSomeonegav
xzt1996
·
2020-08-15 17:42
CodeForce
s 518D
DD-R2D2andDroidArmyTimeLimit:2000MSMemoryLimit:262144KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForce
s518DDescriptionIlyago
xzt1996
·
2020-08-15 17:41
CodeForce
s - 686B
id=406129
CodeForce
s-686BLittleRobberGirl'sZooTimeLimit:2000MSMemoryLimit:262144KB64bitIOFormat:%I64d&
xzt1996
·
2020-08-15 17:41
CodeForce
s 518A
AA-ChewbaсcaandNumberTimeLimit:1000MSMemoryLimit:262144KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForce
s518ADescriptionVita
xzt1996
·
2020-08-15 17:41
codeforce
s D - Biathlon Track
最近为准备省赛,每天晚上还找了个
codeforce
s的比赛来做,今天找了个最水的,然后看到了这道题,自我感觉暴力可以过得感觉。
xuezhongfenfei
·
2020-08-15 17:32
零零碎碎
Educational
Codeforce
s Round 93 (Rated for Div. 2)
目录Educational
Codeforce
sRound93(RatedforDiv.2)A.BadTriangleB.SubstringRemovalGameC.GoodSubarraysD.ColoredRectangles
spcia
·
2020-08-15 17:00
codeforce
s 131c 组合数
题目:C.TheWorldisaTheatretimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTherearenboysandmgirlsattendingatheatreclub.Tosetaplay"TheBigBangTheory",theyneedtoch
AC_Lee
·
2020-08-15 17:44
数论
CF-631-.Interview-水题
A.InterviewTimeLimit:1000MSMemoryLimit:262144KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForce
s631ADescriptionBlakeisaCEOofalargecompanycalled
PrConstantin
·
2020-08-15 17:51
cf
The World is a Theatre
http://
codeforce
s.com/problemset/problem/131/CTheWorldisaTheatretimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTherearenboysandmgirlsattendingatheatreclub
蚕豆儿
·
2020-08-15 17:45
基础
CF
暴力
Codeforce
s1372B题解
题目:B.OmkarandLastClassofMathtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputInOmkar’slastclassofmath,helearnedabouttheleastcommonmultiple,orLCM.LCM(a,b)isthe
Couriersix
·
2020-08-15 17:58
ACM学习
补题 dsu on tree
CodeForce
s 600E Lomsat gelral
题目Youaregivenarootedtreewithrootinvertex1.Eachvertexiscolouredinsomecolour.Let’scallcolourcdominatinginthesubtreeofvertexviftherearenoothercoloursthatappearinthesubtreeofvertexvmoretimesthancolourc.So
lqvir
·
2020-08-15 17:54
Codeforce
s C. Omkar and Baseball (Round #655 Div.2)
#include#include#include#include#include#include#includeusingnamespacestd;#defineINF0x3f3f3f3fconstintmaxn=150;intt,n;inta[maxn];intmain(){cin>>t;while(t--){cin>>n;intcnt=0;for(inti=1;i>a[i];if(a[i]!=
Spike Valentine
·
2020-08-15 17:53
codeforce
s432D[kmp的next数组的运用]
解题思路:1.就是nxt数组不断嵌套递归下去就好了2.如何统计子串出现的个数我们从后往前遍历:根据那个图大的子串会包含小的子串,所以我们就处理前缀和将大的个数加到小的里面去#include#includeconstintN=1e5+5;intn,jump[N],c,r[N],dp[N];charstr[N];voidgetJump(){intk=0;n=strlen(str+1);for(inti
黑夜和白天
·
2020-08-15 17:52
字符串算法
codeforce
s B. Omkar and Last Class of Math
题目题意:给你一个数字nnn,你需要求出两个数a,ba,ba,b满足a+b=na+b=na+b=n且lcm(a.b)lcm(a.b)lcm(a.b)最小。思路:我们可以发现当gcd(a,b)≠1gcd(a,b)\not=1gcd(a,b)=1的时候,那么n%a=0n\%a=0n%a=0或者n%b=0n\%b=0n%b=0,我们又可以发现,此时的gcd(a,b)=gcd(a,n−a)=gcd(n
忘梦心
·
2020-08-15 17:16
codeforces
Codeforce
s Round #610 (Div. 2)-C. Petya and Exam(贪心)
题目链接题意:就是离开考场的时间,如果大于等于的某个题的ti时间,就必须做,求做题的最大数量。贪心:先对ti排个序然后从第一个ti-1.开始枚举在每次枚举的时候同时记录在ti-1之前有多少个必须完成的简单题和难题那么耗时m就为asum1+bsum2如果ti-1还有剩余时间,就最大化的做简单题数量sum3如果ti-1还有剩余时间,就最大化的做难题sum4ans为sum1+sum2+sum3+sum4
玛咖二锅头
·
2020-08-15 17:01
#
贪心
Codeforce
s Round #655 (Div. 2) (A-E)
题目:A.OmkarandCompletion直接构造相同的数。#include#include#include#include#include#include#include#include#include#include#include#include#include#defineinf0x3f3f3f3f#definellinf0x3f3f3f3f3f3f3f3f#defineMAX_len
xpnnl
·
2020-08-15 17:56
Codeforce
s Round #646 (Div. 2)F. Rotating Substrings(dp)
题目:click题意:利用该操作,问最小的操作次数使得s变为t,如果不可能则-1.思路来源:https://www.bilibili.com/video/BV13T4y1J73t?p=6记录一下这个dp,切入点在最长的公共子序列,答案min,肯定需要公共子序列max,n-max(公共子序列的长度)即答案,我们只需要改变不是最长公共子序列的字符,但是注意就只能向前移动,所以每次匹配的时候,在者之后的
xpnnl
·
2020-08-15 17:26
动态规划
Codeforce
s Round #610 Div2
1282DEnchantedArtifact(构造贪心交互)题意:你需要猜一个长度为n且仅由a和b组成的密文S,你可以向系统询问信息,每次询问输出一个非空串T,系统将告诉你(输入)S和T之间的编辑距离,你必须在n+2次询问内猜中密文S。S和T之间的编辑距离定义为:对S进行的最小操作数(对单个字符进行替换、插入或删除),使S=T(1≤n≤300)(1\len\le300)(1≤n≤300)。解法:有
Reno_Jarrison
·
2020-08-15 17:24
CF补题记
Codeforce
s Round #610 (Div. 2)【A - D】
题目来源:https://
codeforce
s.com/contest/1282脑速不够,差点掉分了,勉强上蓝,算是圣诞礼物了叭~最可怕的是发生了暑假一样的错误:两个int型变量相乘然后爆了,希望以后不会再犯了
HungTeen
·
2020-08-15 17:52
Contests
codeforces
div2
D
Artifact
Enchanted
Codeforce
s 61D. Eternal Victory
Codeforce
s61D.EternalVictory题目链接D.EternalVictorytimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputValerianwascapturedbyShapur.ThevictorywassuchagreatonethatSh
秋寒丶
·
2020-08-15 17:15
acm
算法
dfs
图论
dijkstra
凉肝的比赛补题和题解
A-C题E-F题G-HQ9+
CodeForce
s-133A题目HQ9+isajokeprogramminglanguagewhichhasonlyfourone-characterinstructions
墨墨墨小白
·
2020-08-15 17:13
题解
Codeforce
s Round #643 (Div. 2)
这场是七点半的场,正好跑完步打了一下于是:害还是太菜了A-SequencewithDigitsLet’sdefinethefollowingrecurrence:an+1=an+minDigit(an)⋅maxDigit(an).HereminDigit(x)andmaxDigit(x)aretheminimalandmaximaldigitsinthedecimalrepresentationo
墨墨墨小白
·
2020-08-15 17:13
题解
Codeforce
s 1372D 贪心
这道题我比赛的时候竟然没做出来。。。太菜了。。。题目给定nnn个数字(nnn为奇数),围成一圈。每次操作去掉其中一个数,再将这个数字的相邻两个数字合并起来。重复操作直到只剩一个数字,问你最后得到的最大的数是多少。我们这样分析,合并的操作一定是n−12\frac{n-1}{2}2n−1次,那么我们贪心的想,我们能得到的最大的数字之和,一定是n+12\frac{n+1}{2}2n+1个数字的和。所以每
gong_zi_shu
·
2020-08-15 17:40
题解
Codeforce
s Round #646 (Div. 2) F. Rotating Substrings
题意给你长度相同的两个字符串sss和ttt,每次操作可以把sss中一个字符移到前面的任意位置,求最少经过多少次操作使得sss和ttt相等;解法1如果操作是可以把sss中一个字符任意移动,那不难想到最少操作次数即(字符串的长度-s和t的最长公共子序列),而现在只能往前移动,那么此时需要求的最长公共子序列就需要有额外条件;我们知道最长公共子序列之间一一对应,对于s[i]s[i]s[i]和t[j]t[j
半缘、
·
2020-08-15 16:04
DP
Codeforce
s Round #610 (Div. 2) E
E-TheCakeIsaLie题意:输入一个n,给出n-2个三角形。然后把他们拼成一个多边形,多边形的序号和三角形的序号对应,可以是乱序。输出两个东西,一个是三角形的序号,可以随便以哪个序号开头都可以,第二个东西就是我们按照那种顺序拿。题解:我们知道每个这个多边形分成n-2个三角形的过程中,每个边最多使用两次,使用一次的边一定是凸包上的边。所以我们这里想到了异或,让和这个顶点相连接的每个顶点都和他
行走天涯的豆沙包
·
2020-08-15 16:00
dfs
思维
Codeforce
s Beta Round #1 A,B,C
A.TheatreSquaretimelimitpertest:1secondmemorylimitpertest:256megabytesinput:standardinputoutput:standardoutputTheatreSquareinthecapitalcityofBerlandhasarectangularshapewiththesizen × mmeters.Ontheocca
weixin_34344403
·
2020-08-15 16:18
Educational
Codeforce
s Round 37 A B C
A.WaterTheGardentimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputItiswinternow,andMaxdecidedit'sabouttimehewateredthegarden.Thegardencanberepresentedasnconsec
weixin_34090562
·
2020-08-15 16:24
Educational
Codeforce
s Round 37 (Rated for Div. 2)
我的代码应该不会被hack,立个flagA.WaterTheGardentimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputItiswinternow,andMaxdecidedit'sabouttimehewateredthegarden.Thegardencanbe
weixin_33936401
·
2020-08-15 16:14
线段树
Codeforce
s Round #197 (Div. 2) D. Xenia and Bit Operations
题目传送门1/*2线段树的单点更新:有一个交叉更新,若rank=1,or;rank=0,xor3详细解释:http://www.xuebuyuan.com/1154895.html4*/5#include6#include7#include8#include9#include10#include11#include12#include13usingnamespacestd;14#definelso
weixin_33704591
·
2020-08-15 16:23
Codeforce
s Round #337 (Div. 2) 610B Vika and Squares(脑洞)
B.VikaandSquarestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVikahasnjarswithpaintsofdistinctcolors.Allthejarsarenumberedfrom1tonandthei-thjarcontainsail
weixin_33698043
·
2020-08-15 16:51
上一页
121
122
123
124
125
126
127
128
下一页
按字母分类:
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
其他