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
【
CodeForces
1249D2 --- Too Many Segments [hard version]】
【
CodeForces
1249D2---TooManySegments[hardversion]】DescriptionTheonlydifferencebetweeneasyandhardversionsisconstraints.YouaregivennsegmentsonthecoordinateaxisOX.Segmentscanintersect
私忆一秒钟
·
2020-09-13 19:27
ACM
Password
CodeForces
- 126B【KMP深度理解题】
KMP学习更新日志题目链接题意:给你一串字符串,我们要找到这样的一串子字符串,让他满足既是前缀又是后缀,并且还在中间出现过的最长子字符串,如果没有就输出题目给的那一串东西。因为我们知道前缀的next[]开始都是从0开始的,所以我们可以不考虑它,然后从后缀看,后缀的next[]不能为0,因为那样就说明不存在这样的答案,所以,我们知道的是后缀肯定在不为0的情况下才有解的可能,接下来,我们向前看,看看中
Andres_Lionel
·
2020-09-13 19:54
KMP算法
DSU on tree——令人惊叹的想法
DSUontree用于解决静态树上众数问题,比如说
Codeforces
600E题目大意给你一棵树,每个节点有一种颜色,问你每个子树x的颜色数最多的那种颜色,如果颜色数相同,那么种类数相加。
XSamsara
·
2020-09-13 19:22
信息学相关知识
Dsu
on
tree
省选算法集合
Codeforces
Round #578 (Div. 2) E. Compress Words(kmp求最长相同前后缀)
【题解】题意:依次合并两个单词,每次合并将删去最长相同前后缀,输出结果。思路:用kmp跑出每个需要被连接的单词的next数组,与之前的单词进行匹配,跑出最长前后缀的长度并更新结果。【代码】#includeusingnamespacestd;constintmaxn=1e6+10;intnet[maxn];intmain(){ios::sync_with_stdio(0);cin.tie(0);st
芋圆西米露
·
2020-09-13 19:50
Codeforces
Round #578 (Div. 2) Hotelier(模拟)+ Block Adventure(贪心)+ Round Corridor(思维)
目录【A:Hotelier】【B:BlockAdventure】【C:RoundCorridor】【A:Hotelier】题解:按题意模拟即可。#includeusingnamespacestd;#definelllonglongconstintmaxn=1e5+10;inta[15];chars[maxn];intmain(){intn;scanf("%d",&n);scanf("%s",s);
芋圆西米露
·
2020-09-13 19:49
CF-1252H-Twin Buildings(扫描线+线段树)
题目链接:https://
codeforces
.com/contest/1252/problem/H题目大意:给出n个矩形小岛,每个小岛有两个属性:长和宽。我们要建两座相同的房子,要求房子的面积最大。
永远鲜红の幼月
·
2020-09-13 19:44
线段树
Gym 101864 题解
英文题解:http://
codeforces
.com/blog/entry/61127A-ACriminal约瑟夫环+枚举题意:给出三个整数X,L,N。
A_root_A
·
2020-09-13 19:12
gym
codeforces
1041C Coffee Break
题目链接:http://
codeforces
.com/contest/1041/problem/C题目大意:有一位工作人员想利用喝咖啡来休息,所以他给了我们一个数组a,表示他想喝咖啡的时间点(假设她喝咖啡的时间不计
csdn180910
·
2020-09-13 19:59
codeforces
Gym - 101502F- Building Numbers (规律以及前缀和)
题目链接:http://
codeforces
.com/gym/101502/problem/F题目:Inthisproblem,youcanbuildanewnumberstartingfrom1,byperformingthefollowingoperationsasmuchasyouneed
Accept_1
·
2020-09-13 19:21
#
规律题(思维题)
CodeForces
-691E Xor-sequences(矩阵快速幂)
E.Xor-sequencestimelimitpertest3secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivennintegersa1, a2, ..., an.Asequenceofintegersx1, x2, ..., xkiscalleda"xor-seq
丿残念灬
·
2020-09-13 19:07
矩阵快速幂
矩阵快速幂
Lomsat gelral
CodeForces
- 600E(树上启发式合并)
Lomsatgelral
CodeForces
-600EYouaregivenarootedtreewithrootinvertex1.Eachvertexiscolouredinsomecolour.Let
.帅帅.
·
2020-09-13 19:04
树上启发式合并
600E
Lomsat
gelral
Codeforces
Beta Round #11-B. Jumping Jack
原题链接B.JumpingJacktimelimitpertest1secondmemorylimitpertest64megabytesinputstandardinputoutputstandardoutputJackisworkingonhisjumpingskillsrecently.Currentlyhe'slocatedatpointzeroofthenumberline.Hewoul
天夏123
·
2020-09-13 19:26
数学
codeforces
725A Jumping Ball(水)
A.JumpingBalltimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputInanewversionofthefamousPinballgame,oneofthemostimportantpartsofthegamefieldisasequenceofnbumpe
neversayno_yl
·
2020-09-13 19:50
Coderforces
&
BestCoder
codeforces
F - Maximum Weight Subset
好题但我不会。求树上最大权值点集,要求点集中任意两点距离大于kkk(边长为1)dp[u][dep]dp[u][dep]dp[u][dep]表示uuu为根节点的子树中,选择的点集中距离uuu的深度至少为depdepdep的最大价值。说实话,第一次见这么设置dpdpdp的,不过限定了一部分确实方便孩子结点之间处理,方便处理,令k=k+1k=k+1k=k+1对于选择uuu结点的情况,孩子结点为根节点的子
mxYlulu
·
2020-09-13 19:12
coderforce
[
codeforces
1372D] Omkar and Circle 圆上区间动归
Codeforces
Round#655(Div.2)参与排名人数15842天天熬夜打比赛,身体吃不消,作了一个充满幸福感的决定,赛后第二天再刷[
codeforces
1372D]OmkarandCircle
mrcrack
·
2020-09-13 19:40
codeforces
Codeforces
276E Little Girl and Problem on Trees【线段树+Bfs序+Dfs序】好题!
E.LittleGirlandProblemonTreestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAlittlegirllovesproblemsontreesverymuch.Here'soneofthem.Atreeisanundirectedconn
mengxiang000000
·
2020-09-13 19:02
搜索
思维
线段树
Codeforces
276E
Codeforces
Round #665 (Div. 2) D. Maximum Distributed Tree 题解(贪心+易错)
题目链接题目大意给你一课树,要你给每一条边分权值,每条边的权值大于0,他们的乘积等于k,而且要使得n-1条边1的数量尽可能少,定义f(u,v)为u到v的边权和求max∑i=1i=n∑j=1j=nf(i,j)\max\sum_{i=1}^{i=n}\sum_{j=1}^{j=n}f(i,j)max∑i=1i=n∑j=1j=nf(i,j)k为m个质因子的乘积题目思路这显然是一个求贡献的裸题,但是里面
_hunxuewangzi
·
2020-09-13 19:22
贪心
Codeforces
Round #667 (Div. 3) D. Decrease the Sum of Digits 题解(思维)
题目链接题目大意就是给你一个正整数n看你加多少使得数位和少于s题目思路原来这么简单,直接模拟进位即可。代码#include#include#include#include#include#include#include#include#include#include#include#include#definefifirst#definesesecond#definedebugprintf("Ia
_hunxuewangzi
·
2020-09-13 19:22
思维
Codeforces
Round #666 (Div. 2) C. Multiples of Length题解(构造)
题目链接题目大意给你一个长为n的数组,要你进行三次操作使得整个数组变为0.操作定义为:每次选择[l,r]的区间,然后输入一个长为r-l+1的数组b[i],使得每个a[i]+=b[i],要求b[i]是r-l+1的倍数题目思路当n=1的时候显然可以前两次操作加0,最后一次操作-a[1]否则可以第一次操作为[1,n-1]每次元素都加上(n-1)*a[i],第二次操作为第n个元素加上(n-1)a[n],最
_hunxuewangzi
·
2020-09-13 19:22
构造
【题解】
Codeforces
1238E. Keyboard Purchase 状压DP/子集DP
给定n(1e5),m(20),一个长为n,字符集在m以内的字符串S。现在要求找到1到m的一个排列,使得Σ∣PSi−PSi+1∣\Sigma|P_{S_i}-P_{S_{i+1}}|Σ∣PSi−PSi+1∣最小,其中PcP_cPc表示字符c在排列中出现的位置。求最小代价。猜到是dp->猜到是状压dp->算法假了->白给80分钟,dp好菜啊,还是做的少。首先预处理一个cnt数组,cnt[i][j]cn
Little_Fall
·
2020-09-13 19:49
题解
codeforces
1140E Palindrome-less Arrays
考场上想得太简单了很显然,奇数位和偶数位上的分开后,相邻位置的数字不相同就是good了然后考场上直接乘法原理了。。。其实不然,因为1-1-11这种跟2-1-11这种答案是不相同的,但是我考场上没考虑到就把样例全过了。所以需要讨论,奇数位偶数位分开后,单独对其中一条数列讨论,分为左右都没有限制,只有左边有限制,只有右边,两边都有但数字不同,两边都有单数字相同这5种情况,分别对每种情况求出所有长度的答
二分抄代码
·
2020-09-13 19:59
计数
递推
Educational
Codeforces
Round 62 (Rated for Div. 2) E. Palindrome-less Arrays(DP+瞎搞)
题目链接题意给你一个长为nnn的数组,和一个值kkk,你能改变−1-1−1为1−k1-k1−k中的任意值,求字串不是回文串(长度大于111,且长度为奇数)的方案数,膜998244353998244353998244353思路第一步比较好想,如果一个串满足上述回文串,那么其长度为3的中心字串必定回文,所以只要使所有长度为3的子串不是回文串即满足。进一步简化,存在回文串,等价于,存在iii满足ai==
ToRe.
·
2020-09-13 19:13
#
瞎搞
codeforces
Gym - 101485 D Debugging (2015-2016 Northwestern European Regional Contest (NWERC 2015))
题目描述:点击打开链接这题题意其实很不好理解,你有一个n行的程序,现在程序运行了r时间之后停止了运行,证明此处有一个bug,现在你需要在程序中加printf来调试找到bug所在的位置,你每次加一个printf所需的时间为p,为你在最坏的情况下最少需要多少时间找到bug。首先考虑何为最坏情况,我理解的是,无论此时你在哪里加了一个printf你的程序都需要再运行r时间,也就是说无论你怎么用printf
hyesuixin
·
2020-09-13 19:22
DP
51nod 1535 深海探险(并查集判联通块)
1535深海探险题目来源:
CodeForces
基准时间限制:1秒空间限制:131072KB分值:40难度:4级算法题收藏关注很久很久以前的一天,一位美男子来到海边,海上狂风大作。
信仰..
·
2020-09-13 18:08
图论
gym 101908F Music Festival 背包DP
http://
codeforces
.com/gym/101908/problem/F刚刚做了这个题,感觉有点套路,也有点烦。
foreyes_1001
·
2020-09-13 18:46
动态规划
[
codeforces
1200E]Compress Words
timelimitpertest:1secondmemorylimitpertest:256megabytes分数:2000,但是我觉得这个题挺神的。Amugaehasasentenceconsistingofnnnwords.Hewanttocompressthissentenceintooneword.Amugaedoesn’tlikerepetitions,sowhenhemergestwo
dxyinme
·
2020-09-13 18:51
[
codeforces
][gym101873]2017-2018 ACM-ICPC German Collegiate Programming Contest (GCPC 2017)
队内训练6题:CDFGIKC.有n(n#defineLiangJiaJunmain#definelllonglong#defineINF1999122700000000LL#definepapairusingnamespacestd;queueq;intX,ti,n,m,ne,h[1004];structedge{intto,nt;}e[20004];voidadd(intu,intv){e[++
dxyinme
·
2020-09-13 18:51
深搜
二分图匹配
递推
spfa
最短路
Codeforces
刷题
Codeforces
100套刷题
Codeforces
Round#506(Div.3)Educational
Codeforces
Round49(RatedforDiv.2)AIMTechRound5(rated
dawu1461
·
2020-09-13 18:06
codeforces
1041C Coffee Break
CoffeeBreaktimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputRecentlyMonocarpgotajob.Hisworkingdaylastsexactlymmminutes.Duringwork,Monocarpwantstodrinkcoffeea
cloudy_happy
·
2020-09-13 18:17
codeforces
Codeforces
612B HDD is Outdated Technology 【水题】
B.HDDisOutdatedTechnologytimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputHDDharddrivesgroupdatabysectors.Allfilesaresplittofragmentsandeachofthemarewrittenin
笑着走完自己的路
·
2020-09-13 18:36
codeforces
水题
The Maximum Subtree
原题链接:https://
codeforces
.com/contest/1238/problem/F分析这道题,构造出最后这棵树的形状是一条主链,链上每个结点可以带叶子结点(在原树中可能不是叶子结点),
bensanhuan
·
2020-09-13 18:54
Codeforces
gym 101102 D 单调栈
Rectanglestimelimitpertest5secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputGivenanR×Cgridwitheachcellcontaininganinteger,findthenumberofsubrectanglesinthisgridthatcontainonl
black_miracle
·
2020-09-13 18:24
单调栈
codeforces
1238D 【思维】
题目分析正难则反考虑不是GOODstring的情况,只有ABB…BBBBAA…AAAAAA…AABBBB…BBA然后用n*(n-1)/2减去不满足的情况就可以啦代码详情#includeusingnamespacestd;typedeflonglongll;intmain(){intn;cin>>n;strings;cin>>s;lllen=s.size();llcta=0,ctb=0;intfa=
beckyUp
·
2020-09-13 18:50
脑洞
Gym - 101147E E. Jumping —— bfs
题目链接:http://
codeforces
.com/gym/101147/problem/E题意:当人在第i个商店时,他可以向左或向右跳di段距离到达另一个商店(在范围之内),一个商店为一段距离。
alince20008
·
2020-09-13 18:02
Codeforces
Round #364 (Div. 2) E. Connecting Universities(从一棵树上挑出n*2个点,两两匹配,求总距离的最大值)
E.ConnectingUniversitiestimelimitpertest3secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTreelandisacountryinwhichtherearentownsconnectedbyn - 1two-wayroadsuchthatit'spossib
_zidaoziyan
·
2020-09-13 18:28
codeforces
Codeforces
-722D-Generating Sets(贪心、set)
转载于:https://www.cnblogs.com/GrowingJlx/p/6642738.html
abcd12341abcd1234
·
2020-09-13 18:55
codeForces
198B.Jumping on Walls(DFS+技巧)
D-JumpingonWalls
CodeForces
-198BVasyaplaysacomputergamewithninjas.AtthisstageVasya'sninjashouldgetoutofadeepcanyon.Thecanyonconsistsoftwoverticalparallelwalls
张松超
·
2020-09-13 18:16
【递归/搜索】
codeforce 1091
题目连接:http://
codeforces
.com/contest/1091A:#includeusingnamespacestd;intmain(){inty,b,r;cin>>y>>b>>r;coutusingnamespacestd
XerxesSimon
·
2020-09-13 18:09
cf
之路
CodeForces
- 1108F MST Unification
http://
codeforces
.com/contest/1108/problem/FYouaregivenanundirectedweightedconnectedgraphwithnnverticesandmmedgeswithoutloopsandmultipleedges.Theii-thedgeisei
a-free-man
·
2020-09-13 18:37
MST
Codeforces
【
codeforces
Gym - 100187K】+ 构造 + 贪心
K.PerpetuumMobiletimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheworldfamousscientistInnokentiyalmostfinishedthecreationofperpetuummobile.Itsmainpartisth
楚江枫
·
2020-09-13 18:35
codeforces
贪心
构造
CF GYM 2018 USP-ICMC I题
CFGYM2018USP-ICMCI题题目链接:http://
codeforces
.com/gym/101875/problem/I题目描述:输入输出:样例:题目大意:有n个人,m个询问,这n个人的编号为
The_cat_
·
2020-09-13 18:03
Codeforces
Round #666(Div.2)A~D题题解
A.JugglingLetters题目传送门JugglingLetters题意给你n个字符串,字符串si中的任意一个字母可以插入到任意一个字符串(包括自己)的任意位置,问是否能构成n个完全相同的字符串。思路思路很清晰,只需每种字母的数量%n==0即可ACCode#includeusingnamespacestd;charch[1005];intmain(){intt;cin>>t;intnum[3
小新卖蜡笔orz
·
2020-09-13 18:58
Codeforces
CF1041C Coffee Break
原题链接:http://
codeforces
.com/contest/1041/problem/CCoffeeBreakRecentlyMonocarpgotajob.Hisworkingdaylastsexactlymmmminutes.Duringwork
ShadyPi
·
2020-09-13 18:26
two
pointers
Codeforces
-GYM101873:Water Testing(皮克定理)
思路:利用皮克定理2∗S=2∗n+m−22∗S=2∗n+m−2。其中n表示多边形内部的整点数,m表示多边形边界上的整点数,S表示多边形的面积。还有就是线段2点(x1,y1)(x1,y1)与(x2,y2)(x2,y2)之间的整点数是gcd(x1−x2,y1−y2)gcd(x1−x2,y1−y2)。#includeusingnamespacestd;constintMAX=1e5+10;typedef
Mitsuha_
·
2020-09-13 18:12
计算几何
Codeforces
-199D:Jumping on Walls(DFS+思维)
D.JumpingonWallstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVasyaplaysacomputergamewithninjas.AtthisstageVasya'sninjashouldgetoutofadeepcanyon.Thecanyon
Mitsuha_
·
2020-09-13 18:42
BFS//DFS
C. Round Corridor
链接:https://
codeforces
.com/problemset/problem/1200/CAmugaeisinaverylargeroundcorridor.Thecorridorconsistsoftwoareas.Theinnerareaisequallydividedbynnsectors
龍木
·
2020-09-13 18:08
codeforces
gcd
ACM
CodeForces
- 635D Factory Repairs —— 点更新 区间查询
题意:工厂生产产品,开始时每天生产b个,维修连续的k天后变成每天生产a个第di天有需求量为ai的订单,每个订单只能当天生产,不能今天生产的明天卖问若从某天开始维修,能完成的订单里的产品总数思路:用线段树维护,每个节点里分别记录这个区间内修理之前和修理之后能完成的产品总数,询问时分别查询修理前和修理后要注意订单是可以叠加的,点更新时不是赋值是累加#include#include#include#in
Lngxling
·
2020-09-13 18:04
Codeforce
线段树
[
Codeforces
Round #509 (Div. 2)] 解题分析
Codeforces
传送门A.Heist题目描述Therewasanelectronicstoreheistlastnight.Allkeyboardswhichwereinthestoreyesterdaywerenumberedinascendingorderfromsomeintegernumberxxx.Forexample
LPA20020220
·
2020-09-13 18:02
Codeforces
AB-string
CodeForces
- 1238D 字符串——思维题
问题:Thestringt1t2…tkt1t2…tkisgoodifeachletterofthisstringbelongstoatleastonepalindromeoflengthgreaterthan1.Apalindromeisastringthatreadsthesamebackwardasforward.Forexample,thestringsA,BAB,ABBA,BAABBBAA
HXX904
·
2020-09-13 18:20
字符串
Codeforces
#509 div2 1041 ABCD
A.Heist商店里的键盘都是从某个数开始连续编号的,有一些键盘被盗了,现在给你剩下的键盘编号,求最少被盗了多少个键盘排个序检查一下就好了。。。#include#include#include#include#includeusingnamespacestd;#definedebug(x)cerr#include#include#includeusingnamespacestd;#definede
Zolrk
·
2020-09-13 18:43
Codeforces
上一页
62
63
64
65
66
67
68
69
下一页
按字母分类:
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
其他