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
Educational
Codeforce
s 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
Codeforce
s Beta Round #49 (Div. 2)
Codeforce
sBetaRound#49(Div.2)http://
codeforce
s.com/contest/53A1#include2usingnamespacestd;3#definelsonl
weixin_30698527
·
2020-08-15 16:06
cf C. Magic Formulas
http://
codeforce
s.com/contest/424/problem/C1#include2#include3#include4#include5#definemaxn10000016usingnamespacestd
weixin_30670151
·
2020-08-15 16:05
Educational
Codeforce
s 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
CodeForce
s 1A Theatre Square
A.TheatreSquareTheatreSquareinthecapitalcityofBerlandhasarectangularshapewiththesizen × mmeters.Ontheoccasionofthecity'sanniversary,adecisionwastakentopavetheSquarewithsquaregraniteflagstones.Eachflag
weixin_30492047
·
2020-08-15 16:22
Educational
Codeforce
s Round 37 (Rated for Div. 2)C. Swap Adjacent Elements (思维,前缀和)
Educational
Codeforce
sRound37(RatedforDiv.2)C.SwapAdjacentElementstimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouhaveanarrayaconsistingofnintegers.Eachint
weixin_30387663
·
2020-08-15 16:46
CodeForce
s - 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
codeforce
s1A
TheatreSquare
CodeForce
s-1A一个城市的广场面积有N×M平方米,过段时间,恰逢这个城市的庆典活动,主办方决定在广场上铺设一种新的地砖,这种地砖每块都是a×a平方米的。
weixin_30297281
·
2020-08-15 16:12
Codeforce
s 589F Gourmet and Banquet(二分+贪心)
题目地址:http://
codeforce
s.com/problemset/problem/589/F思路:先贪心按照右端点值排序(先把对后面影响最小的菜吃掉),二分吃每道菜的时间即可。
wang2147483647
·
2020-08-15 16:50
算法_二分/三分
算法_贪心
ACM
CF#243 C. Magic Formulas- xor异或运算 / 数学
http://
codeforce
s.com/contest/424/problem/C题意:给n个数,p1p2p3...pn求qi=pi^(i%1)^(i%2)^.....
yuhong_liu
·
2020-08-15 16:13
数据结构
前缀和
CodeForce
s - 631A Interview
BlakeisaCEOofalargecompanycalled"BlakeTechnologies".Heloveshiscompanyverymuchandhethinksthathiscompanyshouldbethebest.Thatiswhyeverycandidateneedstopassthroughtheinterviewthatconsistsofthefollowingpro
vocaloid01
·
2020-08-15 16:13
CF
codeforce
s920D.Tanks+dp
注意return写法D.Tankstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPetyasometimeshastowaterhisfield.Towaterthefield,PetyaneedsatankwithexactlyVmlofwater.Petya
ujn20161222
·
2020-08-15 16:07
Codeforce
s 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://
codeforce
s.com/problemset/problem/24/DD.Brokenrobottimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYoureceivedasagiftaverycleverrobotwalkingonarectan
life4711
·
2020-08-15 16:46
DP
概率dp
codeforce
s 484 A-Bits
http://
codeforce
s.com/problemset/problem/484/A给出一个区间[l,r],求出一个数x(l=l,那么结果的该位取0,之后的低位都低位,保证1的个数是最多的。
FDU_Nan
·
2020-08-15 16:35
比赛
杂题
codeforce
s 131A cAPS lOCK(模拟水题)
A.cAPSlOCK点击打开题目timelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputwHATDOWENEEDcAPSLOCKFOR?Capslockisacomputerkeyboardkey.Pressingitsetsaninputmodeinwhichtyped
defense881
·
2020-08-15 16:59
codeforces
codeforce
s 158B Taxi(贪心小水题)
B.Taxi点击打开题目timelimitpertest3secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAfterthelessonsngroupsofschoolchildrenwentoutsideanddecidedtovisitPolycarpustocelebratehisbirthd
defense881
·
2020-08-15 16:59
codeforces
codeforce
s#322 div2
A.VasyatheHipstertimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputOnedayVasyatheHipsterdecidedtocounthowmanysockshehad.Itturnedoutthathehadaredsocksandbblueso
defense881
·
2020-08-15 16:59
基础题
codeforces
Codeforce
s 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://
codeforce
s.com/problemset/problem/339/BB.XeniaandRingroadtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputXenialivesinacitythathasnhousesbuiltalo
风动护花
·
2020-08-15 16:27
水题(。・`ω´・)
ACM水题训练
codeforce
s 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算法
Codeforce
s 375D:Tree and Queries 点化成区间 莫队
D.TreeandQueriestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouhavearootedtreeconsistingofnvertices.Eachvertexofthetreehassomecolor.Wewillassumethatthetr
2997ms
·
2020-08-15 16:22
Codeforces
搜索-深搜
莫队算法
Codeforce
s_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
Codeforce
s 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
线段树
Codeforce
s Round #Pi (Div. 2) B. Berland National Library
B.BerlandNationalLibrarytimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputBerlandNationalLibraryhasrecentlybeenbuiltinthecapitalofBerland.Inaddition,inthelibra
相知无悔
·
2020-08-15 16:17
思考题
cf
Codeforce
s Round #206 (Div. 2) B. Vasya and Public Transport
B.VasyaandPublicTransporttimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVasyaoftenusespublictransport.Thetransportinthecityisoftwotypes:trolleysandbuses.The
相知无悔
·
2020-08-15 16:16
cf
数论
Codeforce
s Round #199 (Div. 2) E. Xenia and Tree (非正规解法 分情况dfs)
E.XeniaandTreetimelimitpertest5secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputXeniatheprogrammerhasatreeconsistingofnnodes.Wewillconsiderthetreenodesindexedfrom1ton.Wewilla
utobe67
·
2020-08-15 15:12
搜索
Codeforce
s Round #610 (Div. 2) E The Cake Is a Lie(拓扑排序)
题目链接:https://
codeforce
s.com/contest/1282/problem/E题目大意: 有一个n边形,将其分割成n-2个三角形,给出这n-2个三角形,要求顺时针或者逆时针输出这个
smilestruggler
·
2020-08-15 15:30
拓扑排序
Tanks
CodeForce
s - 920D(DP)
Petyasometimeshastowaterhisfield.Towaterthefield,PetyaneedsatankwithexactlyVmlofwater.PetyahasgotNtanks,i-thoftheminitiallycontainingaimlofwater.Thetanksarereallylarge,anyofthemcancontainanyamountofwa
tomjobs
·
2020-08-15 15:58
#
codeforces
#
线性dp
CodeForce
s-1A Theatre Square【水题】
A.TheatreSquaretimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheatreSquareinthecapitalcityofBerlandhasarectangularshapewiththesizen × mmeters.Ontheoccasion
海岛Blog
·
2020-08-15 15:25
#
ICPC-备用二
#
ICPC-水题题解三
#
ICPC-CodeForces
Codeforce
s 1282 E The Cake Is a Lie —— 拓扑
Thisway题意:现在有一个正n边型的蛋糕,每次都会在蛋糕的点上切下一个三角形,现在给你每个三角形的三个点的下标,问你这个蛋糕下标排列的顺序以及按照什么顺序切下这些三角形的。题解:由于最外面的边只会出现一次,切割边会出现两次,所以我们计算每条边出现的次数,然后做一个dfs就可以求出下标排列的顺序。我们可以发现每次切下一个三角形的时候一定有一个点在接下来只出现一次,于是我们只需要做一个拓扑排序即可
天翼之城*
·
2020-08-15 15:53
想法
dfs
拓扑排序
CodeForce
s 39F Pacifist frogs
http://
codeforce
s.com/problemset/problem/39/F模拟具体看代码#include#include#include#includeusingnamespacestd
threeh20
·
2020-08-15 15:18
模板
codeforces
Codeforce
1202E You Are Given Some Strings.. 后缀自动机
先给一个串t再给n个串s将俩s拼接(可以相同)求t中有多少个这样的串的和我们把问题转化为这样对于把他分割成两部分也就是求设前半部分的后缀是多少个S乘以后半部分的前缀是多少个S的和我们看样例11*22*11*1所以答案就是5将字符串转置,这两个问题也就是一个问题利用后缀自动机处理pos[i]代表着字符串的第i位在SAM中对应的状态也就是前i+1位的状态(前缀)cnt[i]代表着在状态i下的有多少个后
wind_bow
·
2020-08-15 15:43
字符串算法
CF1200E Compress Words KMP or Hash
这个题就是求字符串拼接后的字符串,中间重复的不要https://
codeforce
s.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
codeforce
s-Petr
wind_bow
·
2020-08-15 15:34
其他
Educational
Codeforce
s 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年周训练赛
Codeforce
s-Round-#357-(Div.-2)-Economy-Game
EconomyGametimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputKolyaisdevelopinganeconomysimulatorgame.Hismostfavouritepartofthedevelopmentprocessisin-gametestin
Azson
·
2020-08-15 15:32
BASE-数论
BASE-水题
CodeForce
s 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
CodeForce
s1ADescriptionTheatreSquareinthecapitalcityofBerlandhasarectangularshapewiththesizen
sdjzping
·
2020-08-15 15:39
欧拉回路
Codeforce
s723E One-Way Reform
传送门:点击打开链接题意:给你无向图,现在给无向图定向,使得最多的点,入度等于出度。思路:首先,对于无向图,奇数度的点,肯定是不能使得入度等于出度的。对于一个有向图欧拉回路,我们可以知道,欧拉回路上所有的点的入度等于出度。然后,我们还能知道一个性质,对于一个图,度为奇数的个数,一定是偶数。所以我们把度为奇数的点分成很多组,每组2个点,然后把每组内部的2个点连一条边。这样的话,整个图,就只有度为偶数
逍遥丶綦
·
2020-08-15 15:22
ACM_图论
线性基
Codeforce
s724G 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_线性基
Omkar and Last Class of Math
CodeForce
s - 1372B rat1300
InOmkar’slastclassofmath,helearnedabouttheleastcommonmultiple,orLCM.LCM(a,b)isthesmallestpositiveintegerxwhichisdivisiblebybothaandb.Omkar,havingalaudablycuriousmind,immediatelythoughtofaprobleminvolv
我不是手机
·
2020-08-15 15:49
cf800--1200
CodeForce
s - 888D Almost Identity Permutations
本题用到错排的知识点!组合数学思路:听SCX大佬讲的啊,题意至少有n-k个数是正好Pi=i;也就是说,我们只要枚举从2—k的数,看看他们有多少种错排的方案,在乘上k有多少种取法,最后加一(排序正常的那一种),就可解决。#includeusingnamespacestd;typedeflonglongll;llans[]={0,0,1,2,9};lln;llC(inty){llrz=1;for(in
Wolfgang114
·
2020-08-15 15:48
ACM
CodeForce
s - 593B B - Anton and Lines
B-AntonandLinesTheteachergaveAntonalargegeometryhomework,buthedidn’tdoit(asusual)asheparticipatedinaregularroundon
Codeforce
s.Inthetaskhewasgivenasetofnlinesdefinedbytheequationsy
Wolfgang114
·
2020-08-15 15:16
ACM
Codeforce
s Round #655 (Div. 2) B. Omkar and Last Class of Math(LCM)
传送门我自己是没有找到规律的,但是这种题放在第二题,要么暴力要么有规律,因此我们可以先对前几十个数暴力打表,然后就找到规律了,其证明如下,感谢Layton#include#include#include#include#include#include#include#include#include#include#include#include#includeusingnamespacestd;#
Happig丶
·
2020-08-15 15:10
Codeforces
Codeforce
s Round #610 (Div. 2) B题
KforthePriceofOne(HardVersion)Thisisthehardversionofthisproblem.Theonlydifferenceistheconstraintonk—thenumberofgiftsintheoffer.Inthisversion:2≤k≤n.VasyacametothestoretobuygoodsforhisfriendsfortheNewYe
不拿牌不改名
·
2020-08-15 15:39
#
codeforces上分记录
#
思维
Codeforce
s Round #604 (Div. 2) B题
BeautifulNumbersYouaregivenapermutationp=[p1,p2,…,pn]ofintegersfrom1ton.Let’scallthenumberm(1≤m≤n)beautiful,ifthereexiststwoindicesl,r(1≤l≤r≤n),suchthatthenumbers[pl,pl+1,…,pr]isapermutationofnumbers1
不拿牌不改名
·
2020-08-15 15:39
#
codeforces上分记录
树形结构
Codeforce
s Round #629 (Div. 3) E题
TreeQueriesYouaregivenarootedtreeconsistingofnverticesnumberedfrom1ton.Therootofthetreeisavertexnumber1.Atreeisaconnectedundirectedgraphwithn−1edges.Youaregivenmqueries.Thei-thqueryconsistsofthesetofk
不拿牌不改名
·
2020-08-15 15:39
#
树形结构
Binary String To Subsequences
Codeforce
s Round #661 (Div. 3)
题目链接思路:找每个0去匹配前面离他最近的1,每个1去匹配前面离他最近的0,如果1,0前面没有可以匹配的,那么就以自己独立开头开始匹配。#include#include#include#include#include#include#include#includeusingnamespacestd;typedeflonglongll;#defineSISstd::ios::sync_with_st
Ray.C.L
·
2020-08-15 15:35
CF
Codeforce
s Round #629 (Div. 3) E. Tree Queries(树上倍增lca求公共祖先)
链接:https://
codeforce
s.com/problemset/problem/1328/E题意:一棵n个节点树,m次询问,每次询问k个点,问k个节点是否在根节点的路线上或者距离这条路线距离为
AIRBOYONE
·
2020-08-15 15:34
ACM算法
上一页
122
123
124
125
126
127
128
129
下一页
按字母分类:
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
其他