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 1401 A. Distance and Axis
记录:好久不写,真的是没有
codeforce
s题的思维了,每次隔好久不写,感觉像个麻瓜。
error311
·
2020-08-25 01:59
思维
codeforces
codeforce
s 935 A. Fafa and his Company
DescriptionFafaownsacompanythatworksonhugeprojects.TherearenemployeesinFafa’scompany.Wheneverthecompanyhasanewprojecttostartworkingon,Fafahastodividethetasksofthisprojectamongalltheemployees.Fafafinds
Int32ToByte
·
2020-08-25 01:28
acm
Codeforce
s Round #665 (Div. 2) D. Maximum Distributed Tree
考点:图论,数论。#include#include#include#includeusingnamespacestd;constintmaxn=100010;constlonglongmod=1e9+7;longlongp[maxn];vectorv[maxn];longlongvis[maxn]={0};longlongsum[maxn]={0};longlongb[maxn];voiddfs(
极地星辰
·
2020-08-25 01:27
ACM-ICPC算法
codeforces
CodeForce
s 23A You're Given a String... (简单题)
题目类型简单题题目意思给你一个字符数不超过100的字符串,问出现超过两次的子串最长是多少(可重叠)解题方法从大到小枚举答案再暴力找看是否能找到,找到的话结束参考代码-有疑问的地方在下方留言看到会尽快回复的#include#include#include#include#include#include#include#includeusingnamespacestd;typedeflonglongL
yunyouxi0
·
2020-08-25 01:44
简单题
acm
CodeForce
s 492A
DescriptionVanyagotncubes.Hedecidedtobuildapyramidfromthem.Vanyawantstobuildthepyramidasfollows:thetoplevelofthepyramidmustconsistof1cube,thesecondlevelmustconsistof1 + 2 = 3cubes,thethirdlevelmusthav
revstar_
·
2020-08-25 01:44
codeforce
Codeforce
s Round #665 (Div. 2)A-D题解
**
Codeforce
sRound#665(Div.2)A-D题解**//写于rating值2075/2184//下午刚补的题,28号之前都要练科三,这段时间的比赛应该都要鸽了比赛链接:https://
StandNotAlone
·
2020-08-25 01:42
codeforces
算法
Codeforce
s A. Shovels and Swords (思维 / 均分) (Round 89 Rated for Div2)
传送门题意:你有a,,b两个数,可在其中一个数取1,另一个数取2;试问你最多能进行多少次操作?思路:交换使得a是大数,b是小数。在a中建2,b中减1直到两者相等。a,b两数同取3.最后若a和b都还有余就可再操作一次。代码实现:#include#defineendl'\n'#definenullNULL#definelllonglong#defineintlonglong#definepiipair
S atur
·
2020-08-25 01:42
比赛&训练
数学
Codeforce
s Round #521 (Div. 3) A. Frog Jumping
Afrogiscurrentlyatthepoint00onacoordinateaxisOxOx.Itjumpsbythefollowingalgorithm:thefirstjumpisaaunitstotheright,thesecondjumpisbbunitstotheleft,thethirdjumpisaaunitstotheright,thefourthjumpisbbunitst
魔丸小哪吒
·
2020-08-25 01:12
codeeforces比赛
大数类
CF1399C Boats Competition
原文链接:http://
codeforce
s.com/problemset/problem/1399/CBoatsCompetitionTherearenpeoplewhowanttoparticipateinaboatcompetition.Theweightofthei-thparticipantiswi.Onlyteamsconsistingoftwopeoplecanparticipate
ShadyPi
·
2020-08-25 01:11
杂============
Codeforce
s Round #299 (Div. 2) D. Tavas and Malekas KMP+预处理、string suffix structures
D.TavasandMalekastimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTavasisastrangecreature.Usually"zzz"comesoutofpeople'smouthwhilesleeping,butstringsoflength
ProLightsfxjh
·
2020-08-25 01:09
字符串:KMP
Codeforces
Div.
2:D
☺藏题阁☺
算法的艺术
D. Swords
链接:https://
codeforce
s.com/contest/1216/problem/DTherewerenntypesofswordsinthetheaterbasementwhichhadbeenusedduringtheplays.Moreovertherewereexactlyxxswordsofeachtype.yypeoplehavebrokenintothetheaterba
龍木
·
2020-08-25 01:38
最小公约数
ACM
codeforces
Codeforce
s Round #647 (Div. 2) - Thanks, Algo Muse!
这里就补下BCD吧,这次打思路太慢了传送门B.JohnnyandHisHobbies主要思路:首先看到是1—1024,那么直接枚举1—2048,看看是否符合条件即可(是否和原来的一样)解题思路:首先枚举1—2048这些数,然后直接与输入的值进行^异或操作,然后判断这个值是否在原本输入数据中,并且看是否有重复的主要是处理初始化,也没什么难的,暴力就ok代码:#include#include#incl
清泠,
·
2020-08-25 01:37
CodeForces
思维
递归
Codeforce
s Round #651 (Div. 2)
这里写下ABCDE吧,这次思路感觉不是怎么很明确传送门A.MaximumGCD主要思路:n/2即可解题思路:由于让求1#include#include#include#includeusingnamespacestd;typedeflonglongll;constintN=100010,M=200010;intmain(){intt;scanf("%d",&t);while(t--){intn;s
清泠,
·
2020-08-25 01:37
CodeForces
思维
二分
Codeforce
s Round #648 (Div. 2)
这次状态不好,总是wa题,心态都有点炸了,这里写下CDEF传送门C.RotationMatching主要思路:主要是看两个相同的值的差距距离,然后计算差距距离最多的数值是多少即可解题思路:这题还是比较简单的思维题首先我们可以想到我们计算两个数组相同值差的距离,这里我们用:第一个数组的值的位置-第二个数组值的位置+n%n即可,表达式:(res是记录的差值为x时的个数)scanf("%d",&b[i]
清泠,
·
2020-08-25 01:37
CodeForces
思维
DFS
Codeforce
s Round #649 (Div. 2)
手速思路还是太慢了,放假后要抓紧练习才行传送门A.XXXXX主要思路:首先求出全部的和是否是x的倍数,如果不是,则输出n,如果是,那么找前后第一个余数不为0的点即可。解题思路:首先我们对所有数求和,如果不是x的倍数,那么直接输出n然后我们判断是x的倍数的情况,那么我们只要前后找一个位置,这个位置他不是x的倍数即可,然后我们求这个长度的最大值。代码:#include#include#include#
清泠,
·
2020-08-25 01:37
CodeForces
构造
思维
Codeforce
s Round #491 (Div. 2):D. Bishwock
D.Bishwocktimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputBishwockisachessfigurethatconsistsofthreesquaresresemblingan"L-bar".Thisfigurecanberotatedby90,180a
Jaihk662
·
2020-08-25 01:35
#
各种水题
Codeforce
s Round #641 (Div. 2) A. Orac and Factors
A.OracandFactors题目链接-A.OracandFactors题目大意给你一个数nnn,让你对他执行kkk次操作,每次操作加上当前数nnn的最小质因子,输出最终结果解题思路数论数论数论如果n为偶数,则对于后面每次每个运算,nnn都会加2并保持为偶数,所以答案为n+2kn+2kn+2k如果n是奇数,那么nnn将第一次加一个最小的奇数因子,然后变成偶数,所以答案为facmin(n)+2(k
Fiveneves
·
2020-08-25 01:04
codeforces
数论
Codeforce
s Round #465 (Div. 2) A. Fafa and his Company 水题
A.FafaandhisCompanytimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputFafaownsacompanythatworksonhugeprojects.TherearenemployeesinFafa'scompany.Wheneverthecompa
Frost_Bite
·
2020-08-25 01:04
Codeforce
s Round #624 (Div. 3)A. Add Odd or Subtract Even
A.AddOddorSubtractEven题目链接-A.AddOddorSubtractEven题目大意给你两个数a,b,你就可以通过以下方式更改a:选择任意正奇数x(x>0),将a替换为a+x;选择任意正偶数y(y>0),将a替换为a-y。您可以执行任意数量的此类操作。求从a中得到b所需的最少移动次数解题思路判断a,b大小求差值c=abs(a-b),奇+奇=偶,奇+偶=奇,偶+偶=偶若a==b
Fiveneves
·
2020-08-25 01:04
codeforces
Codeforce
s Round #411 D. Minimum number of steps
题意Wehaveastringofletters‘a’and‘b’.Wewanttoperformsomeoperationsonit.Oneachstepwechooseoneofsubstrings“ab”inthestringandreplaceitwiththestring“bba”.Ifwehaveno“ab”asasubstring,ourjobisdone.Printtheminim
ffutop
·
2020-08-25 01:03
Codeforces
Codeforce
s Round #356 (Div. 1) D. Bear and Chase 暴力 ★ ★
题意有一个人,在一个图里面开始找罪犯了。这个人有两天的抓捕机会,他会在每一天都有机会使用BCD机器,这个BCD机器会返回这个罪犯离他的距离是多少。当然这个人要么在第一天去抓罪犯,要么在第二天去抓罪犯。这个罪犯也不是一个傻逼,如果那个人第一天不抓他的话,那么第二天的时候,这个罪犯就会转移阵地。然后现在问你,在最佳情况下,这个人抓住这个罪犯的概率是多少?题解:考虑最暴力的情况,枚举罪犯第一天哪儿,第二
Ezereal
·
2020-08-25 01:03
思维
Codeforce
s Round #665 (Div. 2)题解ABC
A.DistanceandAxis题目传送门DistanceandAxis题目大意给你一个点a的坐标n,求点b的坐标,使得∣OB−∣AB∣∣=K|OB-|AB||=K∣OB−∣AB∣∣=K思路先判断n和k的大小关系b在OA中每移动一个点改变的大小为2,所以判断n−kn-kn−k的奇偶性即可ACCode#include#include#includeusingnamespacestd;#define
Kurihada
·
2020-08-25 01:29
codeforces
codeforces
Codeforce
s Round #665 (Div. 2) (A-D)
题目A-DistanceandAxis选一点B,使得∣OA−AB∣|OA-AB|∣OA−AB∣为K时A需要挪动多少单位。那么当OAk时B点必须在OA内,此时OA分解为a、b之和,那么当OA为奇数时k=∣a−b∣k=|a-b|k=∣a−b∣为奇数,当OA为偶数时k=∣a−b∣k=|a-b|k=∣a−b∣为偶数。所以根据k的奇偶性改变OA的奇偶性即可。#includeusingnamespacestd
consult_
·
2020-08-25 01:56
CF
贪心
Codeforce
s Round #356 (Div. 2)
A.BearandFiveCardstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAlittlebearLimakplaysagame.Hehasfivecards.Thereisonenumberwrittenoneachcard.Eachnumberisap
weixin_34249367
·
2020-08-25 01:24
Codeforce
s Round #491 (Div. 2)部分题解
这场比赛好鬼畜啊,,A题写崩了wa了4遍,心态直接爆炸,本来想弃疗了,结果发现BCD都是傻逼题。。A.Ifatfirstyoudon'tsucceed...(容斥原理)题目大意:有$N$个人参加了考试,考试完成后在通过的人中,有$A$个人去了第一个酒店聚会,有$B$个人去了第二个酒店聚会,有$C$个人同时去了两个酒店聚会。问有多少个人没有通过考试(主角没有通过考试)Sol小学生容斥,参加了聚会的肯
???Sir
·
2020-08-25 01:24
Codeforce
s Round #356 (Div. 1) D. Bear and Chase 暴力
D.BearandChase题目连接:http://
codeforce
s.com/contest/679/problem/DDescriptionBearlandhasncities,numbered1throughn.Therearembidirectionalroads.Thei-throadconnectstwodistinctcitiesaiandbi.Notworoadsconnectt
weixin_33762321
·
2020-08-25 01:23
Codeforce
s Round #358 (Div. 2)
5/5又是三题滚粗了,注定是打铁的命~~题AAlyonaandNumbers题意:给你n和m,找[1,n]和[1,m]范围内的两个数相加,有多少个的和是5的倍数?题解:枚举x在[1,n]的范围,然后得到范围[x+1,x+m]的数,求有多少个是5的倍数即可。1/*zhenhao*/2#include3usingnamespacestd;45#definelsonl,m,rt*26#definerso
weixin_30401605
·
2020-08-25 01:52
补三道思维题:
Codeforce
s Round #655 (Div. 2)【BCD】
比赛入口B.OmkarandLastClassofMath题意:给出一个整数nnn(1e9范围内),给出条件a+b=na+b=na+b=n,要使得lcm(a,b)lcm(a,b)lcm(a,b)最小,输出aaa和bbb。做法:结论是其中一个答案是nnn的最大因子(由于不会证明被拖出去枪毙),找了找官方题解的证明,总结(翻译)了一下证明如下:令a=k,b=n−ka=k,b=n-ka=k,b=n−k,
cornivores
·
2020-08-25 01:20
Codeforce
s Round #665 (Div. 2) A-D 题解
A.DistanceandAxis题目链接题目原文题目大意在OXOXOX轴上,给出点AAA的坐标x=nx=nx=n,给出一个值kkk,求问能不能在OXOXOX轴上找一个点BBB,使得你∣OA−AB∣=k|OA-AB|=k∣OA−AB∣=k。如果不能找到,你每次可以将AAA点的坐标+1+1+1或−1-1−1,求至少移动点AAA多少次,使得可以找到点BBB(如果以开始就能找到,那么输出000)。解题思
lemonaaaaa23
·
2020-08-25 01:18
算法
Codeforces
算法
dfs
icpc
codeforce
s 1401 B. Ternary Sequence
题目链接:
codeforce
s1401B.TernarySequence题意:给出两个队列,A和B,只包含0,1,2三个元素,可以对A和B随意排序求队列C的最大和,队列C满足如果Ai>BiCi=Ai*Bi
error311
·
2020-08-25 01:14
codeforces
Codeforce
s Round #398 (Div. 2) BCD
B:TheQueue题目大意:你要去办签证,那里上班时间是[s,t),你知道那一天有n个人会来办签证,他们分别是在时间点ai来的。每个人办业务要花相同的时间x,问你什么时候来排队等待的时间最少。(如果你和某个人同时来排队,你会排在他后面)所有时间为正整数。题解:首先可以模拟出每个人的业务什么时候会办好,那么最优解要么是在第一个人来之前的一分钟来,即a1-1,要么是在某个人的业务刚办好的时候来。分别
dehs8915
·
2020-08-25 01:13
(CF 掉分之旅上线)
Codeforce
s Round #665 (Div. 2) 总结
(记录CF掉分之旅上线)
Codeforce
sRound#665(Div.2)总结每场cf不管打的多菜还是记录一下…,不然感觉打了跟没打没啥区别A:DistanceandAxis题目链接题意一个OX坐标系
serendipityLB
·
2020-08-25 01:12
CF
Codeforce
s Round #641 (Div. 2)
这里补BCD题,这次还是太菜了,只a了2题,D还理解错了,c是一点不会传送门B题B题wa了三发好惨,这个时间比较宽裕,所以有很多办法,最终基本都是DP原本想的是把每一个数分解,求出他的因子,然后对因子进行操作或者直接DP,直接对当前数值的倍数进行操作这里比较坑的是让dist[i]=1,原本只对1进行了赋初值,然后想到一个样子a[1]=10,a[2]=1,a[3]=2,a[4]=3,这里是输出2,因
清泠,
·
2020-08-25 01:41
CodeForces
数论
DP
Codeforce
s Round #665(Div.2)题解BCD
B.TernarySequence题目传送门TernarySequence题目大意有两个由0,1,2组成的数组a和b,分别给你a数组和b数组中0,1,2的个数,其中满足求C的和的最大值思路贪心1、通过观察我们发现正的贡献只有a(2)*b(1)=2,负的贡献只有a(1)*b(2)=-2,其他的情况则都为0。按照贪心的思想,a(1)*b(2)应该尽可能的少,而a(2)*b(1)尽可能多。2、于是我们优
小新卖蜡笔orz
·
2020-08-25 01:34
Codeforces
【解题总结】NWERC 2019(
Codeforce
s Gym 102500)
我解决的:E(1WA)、F、I、A。没看的:H。旁观的:C、G、D。看了但没做出来的:K、B、J。EExpeditiousCubing简单题,略。CCanvasLine看起来是一个不很难的贪心,略。FFiretrucksAreRed题意:有nnn个点,每个点有一个数集。两个点的数集有非空交集则两个点可以以该数为权,连一条边。求一个生成树。枚举数,将具有相同数的点连起来即可,要用并查集维护连通性。#
zqy1018
·
2020-08-25 00:03
解题总结
【解题总结】Waterloo Local 2012-2013(
Codeforce
s Gym 100169)
感官难度:C=D#defineINF10000000000000000llusingnamespacestd;typedeflonglongll;typedefpair>pill;intn,m,p;intto[80005],nxt[80005],tp[80005];intw[80005],at[4005]={0},cnt=0;pairdis[4005];priority_queue,greater
zqy1018
·
2020-08-25 00:03
解题总结
Codeforce
s Round #615 (Div. 3)(A~E)
传送门ACollectingCoins题解:可以一起先凑齐最大的币值,能凑齐的话再看剩余的是否被333整除即可。code:code:code:#include#definerep(i,a,b)for(inti=(a);i=(b);i--)#definerush()intT;scanf("%d",&T);while(T--)#definemm(a,b)memset(a,b,sizeof(a))#de
肘子zhouzi
·
2020-08-25 00:24
日常code
Codeforce
s Round #618 (Div. 2) 题解报告
传送门ANon-zero题解:要使得数组中所有乘积和和为000,首先所有的000必须要加上111,之后再特判下此时的和是否为000#include#definerep(i,a,b)for(inti=(a);i=(b);i--)#definerush()intT;scanf("%d",&T);while(T--)#definemm(a,b)memset(a,b,sizeof(a))#definepi
肘子zhouzi
·
2020-08-25 00:24
日常code
CodeForce
s 610APasha and Stick(数学)
DescriptionPashahasawoodenstickofsomepositiveintegerlengthn.Hewantstoperformexactlythreecutstogetfourpartsofthestick.Eachpartmusthavesomepositiveintegerlengthandthesumoftheselengthswillobviouslyben.Pa
Zhac
·
2020-08-25 00:39
CodeForces
水题
数学
暑期集训
CodeForce
s Gym 101741 简要题解
ThreeArrays:枚举aiai,求出当前bb的合法区间和cc的合法区间,并且要求bb中的数在cc中的合法区间与枚举的aa中的数的合法区间有交,然后用前缀和维护一下。#includeusingnamespacestd;#defineXfirst#defineYsecond#definempmake_pair#definepbpush_back#defineDebug(...)fprintf(s
wxh010910
·
2020-08-25 00:38
tsinsen A1393. Palisection (回文树)
A1393.Palisection时间限制:2.0s内存限制:256.0MB总提交次数:392AC次数:143平均分:59.22将本题分享到:查看未格式化的试题提交试题讨论试题来源
CODEFORCE
S17E
whai362
·
2020-08-25 00:49
字符串
字符串Hash例题详解
Catalogue1.
Codeforce
s898FRestoringtheExpression2.
Codeforce
s961Fk-substrings3.
Codeforce
s985FIsomorphicStrings4
南判
·
2020-08-25 00:15
Problemset
Codeforce
s Gym-101291A Alphabet
http://
codeforce
s.com/gym/101291/attachmentsAlphabetAstringoflowercaselettersiscalledalphabeticalifdeletingzeroormoreofitsletterscanresultinthealphabetstring
SDUT_杜广优
·
2020-08-24 23:44
B站带我打
codeforce
s(二)
D.Dr.EvilUnderscores原题地址代码:题目大意:给n个数字,让你求一个数X,使得X和每个数的异或值的最大值最小其实看到最大值最小这样的表述很容易向二分方向想,但显然这题没法二分,只能字典树+DP先将每个数变成30位的二进制数,然后建立字典树,在字典树上搞树上DPqsc讲解、qsc的代码省略了建树的过程(一边DP一边建)E.Xenon’sAttackontheGangs原题地址代码:
灵隐寺未来职工
·
2020-08-24 23:32
[
CodeForce
s 17 E ] Palisection
\(\\\)\(Description\)给定一个长度为\(N\)的小写字母串。问有多少对相交的回文子串\((\)包含也算相交\()\),答案对\(51123987\)取模。\(N\in[1,2\times10^6]\)\(\\\)\(Solution\)先考虑相交如何处理。因为相交既跟端点有关,又跟长度有关,回文子串数目众多不好处理。正难则反。假设总回文串个数是\(cnt\)个,如果两两都相交一
weixin_34038652
·
2020-08-24 23:13
Codeforce
s Gym 100463B Music Mess Hash 逻辑题
MusicMessTimeLimit:20SecMemoryLimit:256MB题目连接http://
codeforce
s.com/gym/100463/attachmentsDescriptionFrancisreallylikeshismusic.Heespeciallylikesthatsong
weixin_33724570
·
2020-08-24 23:27
Codeforce
s Round #337 (Div. 2) A. Pasha and Stick 水题
A.PashaandStickPashahasawoodenstickofsomepositiveintegerlengthn.Hewantstoperformexactlythreecutstogetfourpartsofthestick.Eachpartmusthavesomepositiveintegerlengthandthesumoftheselengthswillobviouslybe
weixin_30256901
·
2020-08-24 23:49
CodeForce
s 17E Palisection(回文树)
E.Palisectiontimelimitpertest2secondsmemorylimitpertest128megabytesinputstandardinputoutputstandardoutputInanEnglishclassNickhadnothingtodoatall,andrememberedaboutwonderfulstringscalledpalindromes.Wes
weixin_30216561
·
2020-08-24 23:18
Codeforce
s Beta Round #17 E. Palisection(回文树)
E.Palisectiontimelimitpertest2secondsmemorylimitpertest128megabytesinputstandardinputoutputstandardoutputInanEnglishclassNickhadnothingtodoatall,andrememberedaboutwonderfulstringscalledpalindromes.Wes
akxxsb
·
2020-08-24 23:39
数据结构
Gym - 101473J
题目链接:http://
codeforce
s.com/gym/101473/attachments题解:最大生成树+树链剖分+线段树维护最小值代码:#include#include#include#include
kicksilver7
·
2020-08-24 23:41
ACM
上一页
82
83
84
85
86
87
88
89
下一页
按字母分类:
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
其他