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
凉肝的比赛补题和题解
A-C题E-F题G-HQ9+
CodeForces
-133A题目HQ9+isajokeprogramminglanguagewhichhasonlyfourone-characterinstructions
墨墨墨小白
·
2020-08-15 17:13
题解
Codeforces
Round #643 (Div. 2)
这场是七点半的场,正好跑完步打了一下于是:害还是太菜了A-SequencewithDigitsLet’sdefinethefollowingrecurrence:an+1=an+minDigit(an)⋅maxDigit(an).HereminDigit(x)andmaxDigit(x)aretheminimalandmaximaldigitsinthedecimalrepresentationo
墨墨墨小白
·
2020-08-15 17:13
题解
Codeforces
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
题解
Codeforces
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
Codeforces
Round #610 (Div. 2) E
E-TheCakeIsaLie题意:输入一个n,给出n-2个三角形。然后把他们拼成一个多边形,多边形的序号和三角形的序号对应,可以是乱序。输出两个东西,一个是三角形的序号,可以随便以哪个序号开头都可以,第二个东西就是我们按照那种顺序拿。题解:我们知道每个这个多边形分成n-2个三角形的过程中,每个边最多使用两次,使用一次的边一定是凸包上的边。所以我们这里想到了异或,让和这个顶点相连接的每个顶点都和他
行走天涯的豆沙包
·
2020-08-15 16:00
dfs
思维
Codeforces
Beta Round #1 A,B,C
A.TheatreSquaretimelimitpertest:1secondmemorylimitpertest:256megabytesinput:standardinputoutput:standardoutputTheatreSquareinthecapitalcityofBerlandhasarectangularshapewiththesizen × mmeters.Ontheocca
weixin_34344403
·
2020-08-15 16:18
Educational
Codeforces
Round 37 A B C
A.WaterTheGardentimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputItiswinternow,andMaxdecidedit'sabouttimehewateredthegarden.Thegardencanberepresentedasnconsec
weixin_34090562
·
2020-08-15 16:24
Educational
Codeforces
Round 37 (Rated for Div. 2)
我的代码应该不会被hack,立个flagA.WaterTheGardentimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputItiswinternow,andMaxdecidedit'sabouttimehewateredthegarden.Thegardencanbe
weixin_33936401
·
2020-08-15 16:14
线段树
Codeforces
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
Codeforces
Round #337 (Div. 2) 610B Vika and Squares(脑洞)
B.VikaandSquarestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVikahasnjarswithpaintsofdistinctcolors.Allthejarsarenumberedfrom1tonandthei-thjarcontainsail
weixin_33698043
·
2020-08-15 16:51
Educational
Codeforces
Round 37 (Rated for Div. 2)C. Swap Adjacent Elements
题目链接:C.SwapAdjacentElements题意:给你一个1~n的序列,然后一个n-1长的01串,为一代表可以和后面一个位置的数交换。问你能否通过交换是序列从小到大;题解:统计每个数字的位置p[i],我们想要一个数字现能够回到原来的位置i必须max(i,p[i])-1到min(i,p[i])全部为一。我们用线段树或者前缀和。就可以快速判断一段是否全部为一(我用的是线段树),对于每一个不在
weixin_30810583
·
2020-08-15 16:12
Codeforces
Beta Round #49 (Div. 2)
Codeforces
BetaRound#49(Div.2)http://
codeforces
.com/contest/53A1#include2usingnamespacestd;3#definelsonl
weixin_30698527
·
2020-08-15 16:06
cf C. Magic Formulas
http://
codeforces
.com/contest/424/problem/C1#include2#include3#include4#include5#definemaxn10000016usingnamespacestd
weixin_30670151
·
2020-08-15 16:05
Educational
Codeforces
Round 37 (Rated for Div. 2) ABC
A.WaterTheGardenItiswinternow,andMaxdecidedit'sabouttimehewateredthegarden.Thegardencanberepresentedasnconsecutivegardenbeds,numberedfrom1ton.kbedscontainwatertaps(i-thtapislocatedinthebedxi),which,if
weixin_30632883
·
2020-08-15 16:01
CodeForces
1A Theatre Square
A.TheatreSquareTheatreSquareinthecapitalcityofBerlandhasarectangularshapewiththesizen × mmeters.Ontheoccasionofthecity'sanniversary,adecisionwastakentopavetheSquarewithsquaregraniteflagstones.Eachflag
weixin_30492047
·
2020-08-15 16:22
Educational
Codeforces
Round 37 (Rated for Div. 2)C. Swap Adjacent Elements (思维,前缀和)
Educational
Codeforces
Round37(RatedforDiv.2)C.SwapAdjacentElementstimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouhaveanarrayaconsistingofnintegers.Eachint
weixin_30387663
·
2020-08-15 16:46
CodeForces
- 681A A Good Contest
咳咳,从今天开始,每天做一个英语题,不论简单还是难,坚持到下学期的省赛,希望能有效果。这题就是判断是否能成为red,如果他超越的人里面有在比赛前分数达到2400,并且在比赛后分数上升,那么他就能成为redAC代码:#include#includeusingnamespacestd;intmain(){stringname;intpre,aft,n;scanf("%d",&n);intok=0;fo
badiu_30394251
·
2020-08-15 16:46
codeforces
1A
TheatreSquare
CodeForces
-1A一个城市的广场面积有N×M平方米,过段时间,恰逢这个城市的庆典活动,主办方决定在广场上铺设一种新的地砖,这种地砖每块都是a×a平方米的。
weixin_30297281
·
2020-08-15 16:12
Codeforces
589F Gourmet and Banquet(二分+贪心)
题目地址:http://
codeforces
.com/problemset/problem/589/F思路:先贪心按照右端点值排序(先把对后面影响最小的菜吃掉),二分吃每道菜的时间即可。
wang2147483647
·
2020-08-15 16:50
算法_二分/三分
算法_贪心
ACM
CF#243 C. Magic Formulas- xor异或运算 / 数学
http://
codeforces
.com/contest/424/problem/C题意:给n个数,p1p2p3...pn求qi=pi^(i%1)^(i%2)^.....
yuhong_liu
·
2020-08-15 16:13
数据结构
前缀和
CodeForces
- 631A Interview
BlakeisaCEOofalargecompanycalled"BlakeTechnologies".Heloveshiscompanyverymuchandhethinksthathiscompanyshouldbethebest.Thatiswhyeverycandidateneedstopassthroughtheinterviewthatconsistsofthefollowingpro
vocaloid01
·
2020-08-15 16:13
CF
codeforces
920D.Tanks+dp
注意return写法D.Tankstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPetyasometimeshastowaterhisfield.Towaterthefield,PetyaneedsatankwithexactlyVmlofwater.Petya
ujn20161222
·
2020-08-15 16:07
Codeforces
367E Sereja and Intervals (dp + sqrt)
#include#include#include#include#include#include#include#include#includeusingnamespacestd;#defineinf0x3f3f3f3f#defineN100020#defineLLlonglong#definemod1000000007#definels(i>1)#definelsonll,md,ls#defin
yamiedie_
·
2020-08-15 16:46
codeforces
组合计数
CF24D 概率DP
http://
codeforces
.com/problemset/problem/24/DD.Brokenrobottimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYoureceivedasagiftaverycleverrobotwalkingonarectan
life4711
·
2020-08-15 16:46
DP
概率dp
codeforces
484 A-Bits
http://
codeforces
.com/problemset/problem/484/A给出一个区间[l,r],求出一个数x(l=l,那么结果的该位取0,之后的低位都低位,保证1的个数是最多的。
FDU_Nan
·
2020-08-15 16:35
比赛
杂题
codeforces
131A cAPS lOCK(模拟水题)
A.cAPSlOCK点击打开题目timelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputwHATDOWENEEDcAPSLOCKFOR?Capslockisacomputerkeyboardkey.Pressingitsetsaninputmodeinwhichtyped
defense881
·
2020-08-15 16:59
codeforces
codeforces
158B Taxi(贪心小水题)
B.Taxi点击打开题目timelimitpertest3secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAfterthelessonsngroupsofschoolchildrenwentoutsideanddecidedtovisitPolycarpustocelebratehisbirthd
defense881
·
2020-08-15 16:59
codeforces
codeforces
#322 div2
A.VasyatheHipstertimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputOnedayVasyatheHipsterdecidedtocounthowmanysockshehad.Itturnedoutthathehadaredsocksandbblueso
defense881
·
2020-08-15 16:59
基础题
codeforces
Codeforces
Round #197 (Div. 2) D. Xenia and Bit Operations(容器做法)
D.XeniaandBitOperationstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputXeniathebeginnerprogrammerhasasequencea,consistingof2nnon-negativeintegers:a1, a2, ..
applepies000
·
2020-08-15 16:32
容器
CF 339B Xenia and Ringroad
题目地址:http://
codeforces
.com/problemset/problem/339/BB.XeniaandRingroadtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputXenialivesinacitythathasnhousesbuiltalo
风动护花
·
2020-08-15 16:27
水题(。・`ω´・)
ACM水题训练
codeforces
415B Mashmokh and Tokens
题目链接~~>做题感悟:在比赛时老马想到了这个方法但是这种方法在无形当中就被忽略了,导致最后十几分钟写二分的方法也没写出来。解题思路:1)员工在保证钱最多的情况下,剩下的tokens尽量多,so(w*a)%b但这并不是最终结果(这样交了一次果断wa),因为这是w*a对b取余的结果,这样得到的并不是剩下的tokens,还必须除以a;2)二分(补充):你得到的钱最多为w*a/b,但是有可能取少于w个也
Bjut_Search2016
·
2020-08-15 16:55
ACM算法
Codeforces
375D:Tree and Queries 点化成区间 莫队
D.TreeandQueriestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouhavearootedtreeconsistingofnvertices.Eachvertexofthetreehassomecolor.Wewillassumethatthetr
2997ms
·
2020-08-15 16:22
Codeforces
搜索-深搜
莫队算法
Codeforces
_357B_Flag Day(贪心)
题型:简单题题意:有n个演员表演m个舞蹈(n#include#include#include#includeusingnamespacestd;intcolor[123456];intmain(){intn,m;inta[3];while(~scanf("%d%d",&n,&m)){memset(color,0,sizeof(color));for(inti=0;i3)color[a[1]]-=3
light_starlight
·
2020-08-15 16:50
ACM
Codeforces
Round #197 (Div. 2) D. Xenia and Bit Operations
居然没想到是线段树,在此给BOBLEE跪。用一个RANK记录深度1就取或0取异或线段树的单点更新。#include#include#include#include#definelsonnum>1;build(lson);build(rson);pushup(num);}voidupdate(intnum,ints,inte,intpos,intval){if(s==e){tree[num]=val
Jinx_jinx_again
·
2020-08-15 16:49
线段树
Codeforces
Round #Pi (Div. 2) B. Berland National Library
B.BerlandNationalLibrarytimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputBerlandNationalLibraryhasrecentlybeenbuiltinthecapitalofBerland.Inaddition,inthelibra
相知无悔
·
2020-08-15 16:17
思考题
cf
Codeforces
Round #206 (Div. 2) B. Vasya and Public Transport
B.VasyaandPublicTransporttimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVasyaoftenusespublictransport.Thetransportinthecityisoftwotypes:trolleysandbuses.The
相知无悔
·
2020-08-15 16:16
cf
数论
Codeforces
Round #199 (Div. 2) E. Xenia and Tree (非正规解法 分情况dfs)
E.XeniaandTreetimelimitpertest5secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputXeniatheprogrammerhasatreeconsistingofnnodes.Wewillconsiderthetreenodesindexedfrom1ton.Wewilla
utobe67
·
2020-08-15 15:12
搜索
Codeforces
Round #610 (Div. 2) E The Cake Is a Lie(拓扑排序)
题目链接:https://
codeforces
.com/contest/1282/problem/E题目大意: 有一个n边形,将其分割成n-2个三角形,给出这n-2个三角形,要求顺时针或者逆时针输出这个
smilestruggler
·
2020-08-15 15:30
拓扑排序
Tanks
CodeForces
- 920D(DP)
Petyasometimeshastowaterhisfield.Towaterthefield,PetyaneedsatankwithexactlyVmlofwater.PetyahasgotNtanks,i-thoftheminitiallycontainingaimlofwater.Thetanksarereallylarge,anyofthemcancontainanyamountofwa
tomjobs
·
2020-08-15 15:58
#
codeforces
#
线性dp
CodeForces
-1A Theatre Square【水题】
A.TheatreSquaretimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheatreSquareinthecapitalcityofBerlandhasarectangularshapewiththesizen × mmeters.Ontheoccasion
海岛Blog
·
2020-08-15 15:25
#
ICPC-备用二
#
ICPC-水题题解三
#
ICPC-CodeForces
Codeforces
1282 E The Cake Is a Lie —— 拓扑
Thisway题意:现在有一个正n边型的蛋糕,每次都会在蛋糕的点上切下一个三角形,现在给你每个三角形的三个点的下标,问你这个蛋糕下标排列的顺序以及按照什么顺序切下这些三角形的。题解:由于最外面的边只会出现一次,切割边会出现两次,所以我们计算每条边出现的次数,然后做一个dfs就可以求出下标排列的顺序。我们可以发现每次切下一个三角形的时候一定有一个点在接下来只出现一次,于是我们只需要做一个拓扑排序即可
天翼之城*
·
2020-08-15 15:53
想法
dfs
拓扑排序
CodeForces
39F Pacifist frogs
http://
codeforces
.com/problemset/problem/39/F模拟具体看代码#include#include#include#includeusingnamespacestd
threeh20
·
2020-08-15 15:18
模板
codeforces
CF1200E Compress Words KMP or Hash
这个题就是求字符串拼接后的字符串,中间重复的不要https://
codeforces
.com/problemset/problem/1200/EHash或者KMP解决就是匹配新出现的串与原来串的(长度与新出现串相等的
wind_bow
·
2020-08-15 15:10
KMP
哈希
ACM学习参考博客
www.cnblogs.com/TheRoadToTheGold/category/985514.htmlOI届的小混混(dalao):https://www.cnblogs.com/zwfymqz/p/9338689.html
codeforces
-Petr
wind_bow
·
2020-08-15 15:34
其他
Educational
Codeforces
Round 37 (Rated for Div. 2)(A、B、C)
地址:点击打开链接A.WaterTheGardenItiswinternow,andMaxdecidedit'sabouttimehewateredthegarden.Thegardencanberepresentedasnconsecutivegardenbeds,numberedfrom1ton.kbedscontainwatertaps(i-thtapislocatedinthebedxi)
sdau20163940
·
2020-08-15 15:04
2017年周训练赛
Codeforces
-Round-#357-(Div.-2)-Economy-Game
EconomyGametimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputKolyaisdevelopinganeconomysimulatorgame.Hismostfavouritepartofthedevelopmentprocessisin-gametestin
Azson
·
2020-08-15 15:32
BASE-数论
BASE-水题
CodeForces
131C--组合数
题意:有n个男生,m个女生分组,一个组t个人,一组至少包含4个男生和1个女生,每个男生或者女生都是不一样的个体,问一共可以构成几组?输入:525435输出:103分析:典型的排列组合问题,分组数=男生分组数*女生分组数=(Cn4+Cn5+...Cnn-i)+(Cn1+....Cnn-i)。代码:#includeusingnamespacestd;longlongfun(longlonga,long
shao1996
·
2020-08-15 15:48
排列组合
A - Theatre Square比赛1
1.题目:A-TheatreSquareTimeLimit:2000MSMemoryLimit:65536KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForces
1ADescriptionTheatreSquareinthecapitalcityofBerlandhasarectangularshapewiththesizen
sdjzping
·
2020-08-15 15:39
欧拉回路
Codeforces
723E One-Way Reform
传送门:点击打开链接题意:给你无向图,现在给无向图定向,使得最多的点,入度等于出度。思路:首先,对于无向图,奇数度的点,肯定是不能使得入度等于出度的。对于一个有向图欧拉回路,我们可以知道,欧拉回路上所有的点的入度等于出度。然后,我们还能知道一个性质,对于一个图,度为奇数的个数,一定是偶数。所以我们把度为奇数的点分成很多组,每组2个点,然后把每组内部的2个点连一条边。这样的话,整个图,就只有度为偶数
逍遥丶綦
·
2020-08-15 15:22
ACM_图论
线性基
Codeforces
724G Xor-matic Number of the Graph
传送门:点击打开链接题意:1e5个点的无向图,求三元环(u,v,s),u#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#definefuck(x)coutPII;constintMX=5e5+5;const
逍遥丶綦
·
2020-08-15 15:22
ACM_线性基
上一页
120
121
122
123
124
125
126
127
下一页
按字母分类:
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
其他