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 1059 D. Nature Reserve(几何+二分)
题目:http://
codeforce
s.com/contest/1059/problem/D题意:给出n个点,要求做一个圆,使得所有点在圆内或圆上,并且该圆与x轴相切。
- Passerby ゛
·
2020-08-24 11:38
二分
几何
codeforce
s 1076 D. Edge Deletion(dijsktra+堆优化)
D.EdgeDeletiontimelimitpertest2.5secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenanundirectedconnectedweightedgraphconsistingofnnverticesandmmedges.Let’sdenotethe
- Passerby ゛
·
2020-08-24 11:38
最短路
模板
Codeforce
s - 845G - Shortest Path Problem?(DFS + 线性基)
题目链接:https://
codeforce
s.com/contest/845/problem/G7.1题意给定一个n(1≤n≤105)n(1\len\le10^5)n(1≤n≤105)个节点和m(n−
Nitrogens Xu
·
2020-08-24 11:29
图论
-
树
图论
-
最短路
数学
-
线性基
CodeForce
s Round#627 D. Pair of Topics
原题链接题目D题意现在有两个数组a[1…n],b[1…n]。定义一个goodgoodgood概念:a[i]+a[j]>b[i]+b[j](ib[i]+b[j](ib[i]+b[j](i−a>-a>−a。对于小于000的差,思路是类似的。所以我们要找出每个差的对应goodgoodgood的选择范围内有多少记录,求和就可以。每一列的差我们可以在O(n)O(n)O(n)求出来,O(nlogn)O(nlo
夏弥耶
·
2020-08-24 11:54
CodeForce
s Round#627 E. Sleeping Schedule
原题链接题目E题意每天有hhh个小时,定义一个goodgoodgood的概念:入睡时间在[l,r][l,r][l,r]范围内(0≤l≤rusingnamespacestd;constintMAX_N=2020;constintMAX_H=2020;intn,h,l,r;inta[MAX_N];intdp[MAX_N][MAX_H];intans;intmain(){cin>>n>>h>>l>>r;
夏弥耶
·
2020-08-24 11:54
CodeForce
s - 570D Tree Requests (树上启发式合并)
CodeForce
s-570D题目大意:给出一个节点u问,节点u的子树中在深度为h的节点能不能组成一个回文串。解题思路:寒假训练赛的一个题目,当时也不会,补题的时候用dfs序+二分写的。
_leon1999
·
2020-08-24 11:45
树上启发式合并
Educational
Codeforce
s Round 54 D. Edge Deletion
文章目录Educational
Codeforce
sRound54D.EdgeDeletion题意:分析:参考代码Educational
Codeforce
sRound54D.EdgeDeletion题意:
海边拾贝的言
·
2020-08-24 11:30
Codeforces
codeforce
s839D Winter is here 数论,莫比乌斯反演
D.Winterisheretimelimitpertest3secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputWinterishereattheNorthandtheWhiteWalkersareclose.JohnSnowhasanarmyconsistingofnsoldiers.Whilet
phython96
·
2020-08-24 11:25
ACM-ICPC训练题解
数论与组合数学系列
CODEFORCES训练记录
Codeforce
s Round #263 (Div. 1) A B C
Codeforce
sRound#263(Div.1)A:贪心。排个序,然后从后往前扫一遍,计算后缀和。之后在从左往右扫一遍计算答案B:树形DP。0表示没有1,1表示有1,0遇到0必定合并。
weixin_34415923
·
2020-08-24 11:52
Codeforce
s Round #330 (Div. 1) C. Edo and Magnets 暴力
C.EdoandMagnetsTimeLimit:20SecMemoryLimit:256MB题目连接http://
codeforce
s.com/contest/594/problem/CDescriptionEdohasgotacollectionofnrefrigeratormagnets
weixin_34343689
·
2020-08-24 11:47
Codeforce
s Round #245 (Div. 2) C. Xor-tree DFS
C.Xor-treeTimeLimit:1SecMemoryLimit:256MB题目连接http://
codeforce
s.com/contest/430/problem/CDescriptionIahubisveryproudofhisrecentdiscovery
weixin_34341229
·
2020-08-24 11:16
Codeforce
s 567A. Lineland Mail
Codeforce
s567A的传送门AllcitiesofLinelandarelocatedontheOxcoordinateaxis.Thus,eachcityisassociatedwithitspositionxi—acoordinateontheOxaxis.Notwocitiesarelocatedatasinglepoint.Linelandresidentslovetosendle
weixin_34176694
·
2020-08-24 11:31
Asia Yokohama Regional Contest 2018 B题 - Arithmetic Progressions(dp)
https://
codeforce
s.com/gym/102082题意给定一些数,可以重新排序,求其中最长的等差数列的长度思路d[i][j]表示以a[i]和a[j]为开头的等差数列的最大长度,具体见代码
weixin_34054931
·
2020-08-24 10:51
Asia Yokohama Regional Contest 2018 C题 - Arithmetic Progressions(思维)
https://
codeforce
s.com/gym/102082题意求所有人从电影院的座位上逃出去的最快时间题解显然,所有人从电影院的座位上逃出去的最快时间取决于最慢的那个人,那我们可以先把每个人最快
weixin_34023863
·
2020-08-24 10:50
CodeForce
s - 1059D(二分+误差)
链接:
CodeForce
s-1059D题意:给出笛卡尔坐标系上n个点,求与x轴相切且覆盖了所有给出点的圆的最小半径。题解:二分半径即可。
weixin_33754913
·
2020-08-24 10:01
【
CodeForce
s】889 C. Maximum Element 排列组合+动态规划
【题目】C.MaximumElement【题意】给定n和k,定义一个排列是好的当且仅当存在一个位置i,满足对于所有的j=[1,i-1]&&[i+1,i+k]有a[i]>a[j],求长度为n的好的排列数。n=n-k,那么位置j前的数字一定constintmaxn=1000010,MOD=1e9+7;intn,k,fac[maxn],fav[maxn],D[maxn],h[maxn];voidgcd(
weixin_33709219
·
2020-08-24 10:58
Codeforce
s 868E Policeman and a Tree
题意简述给你一颗有n个点的树,每条边有边权,有一个警察一开始在点S,他的速度是1,即通过一条长度为x的边要花x单位时间。有m个罪犯,一开始第i个在点x[i],他们的速度无限快。如果罪犯和警察到达同一个点,那么罪犯会被抓住。现在罪犯们想最大化最后一个被抓的时间,警察想最小化抓的时间。求警察抓住所以罪犯的时间的最小值题解思路dpdp[u][v][x][y]表示从u走向v,以v为根的子树有x个罪犯,其余
weixin_30919429
·
2020-08-24 10:23
Balanced Ternary String
CodeForce
s - 1102D (贪心+思维)
Youaregivenastringssconsistingofexactlynncharacters,andeachcharacteriseither'0','1'or'2'.Suchstringsarecalledternarystrings.Yourtaskistoreplaceminimumnumberofcharactersinthisstringwithothercharacterst
weixin_30915951
·
2020-08-24 10:53
CodeForce
s Round #320 Div2
A.RaisingBacteria计算一下x的bitcount就是答案。1#include2#include3#include4#include5usingnamespacestd;67intbitcount(intx)8{9intans=0;10while(x)11{12if(x&1)ans++;13x>>=1;14}15returnans;16}1718intmain()19{20intx;s
weixin_30907523
·
2020-08-24 10:52
codeforce
s 1102D Balanced Ternary String(贪心+思维)
https://
codeforce
s.com/contest/1102/problem/D主要是满足字典序最小的时候。
weixin_30879833
·
2020-08-24 10:51
codeforce
s 667C C. Reberland Linguistics(dp)
题目链接:C.ReberlandLinguisticstimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputFirst-ratespecialistsgraduatefromBerlandStateInstituteofPeaceandFriendship.Youareo
weixin_30871905
·
2020-08-24 10:20
Codeforce
s 235 E Number Challenge
DiscriptionLet'sdenoted(n)asthenumberofdivisorsofapositiveintegern.Youaregiventhreeintegersa,bandc.Yourtaskistocalculatethefollowingsum:Findthesummodulo1073741824(230).InputThefirstlinecontainsthreesp
weixin_30852367
·
2020-08-24 10:20
CF572_Div2_D2
题意http://
codeforce
s.com/contest/1189/problem/D2思考显然地,如果出现度数为2且两条出边边权不相同的情况,是无法构造合法方案的。
weixin_30819163
·
2020-08-24 10:47
Array K-Coloring -
codeforce
题意给\(n\)个位置染色,有\(k\)种颜色。每个位置有一个数字\(a_i\),注意:数字相同的位置的颜色不能相同,然后\(k\)种颜色都要用上。随便输出一种染色方案。题解排序,然后依次染色就行。代码constintN=100005;intn,k;intcnt[N],ans[N];Pp[6000];intmain(){cin>>n>>k;Rep(i,1,n){cin>>p[i].first;p[
weixin_30745553
·
2020-08-24 10:43
Codeforce
s-1059D:Nature Reserve问最大的圆包含全部点
参考https://blog.csdn.net/Mitsuha_/article/details/82950366亮点是从每个点来猜这个圆心,不断缩小这个线段的长度,最终得到一个点。实在是高。转载于:https://www.cnblogs.com/LandingGuy/p/9769919.html
weixin_30733003
·
2020-08-24 10:42
CodeForce
s 196B Infinite Maze
B.InfiniteMazetimelimitpertest:2secondsmemorylimitpertest:256megabytesinput:standardinputoutput:standardoutputWe'vegotarectangularn × m-cellmaze.Eachcelliseitherpassable,orisawall(impassable).Alittleb
weixin_30709635
·
2020-08-24 10:12
Codeforce
s Round #263 Div.1 B Appleman and Tree --树形DP【转】
题意:给了一棵树以及每个节点的颜色,1代表黑,0代表白,求将这棵树拆成k棵树,使得每棵树恰好有一个黑色节点的方法数解法:树形DP问题。定义:dp[u][0]表示以u为根的子树对父亲的贡献为0dp[u][1]表示以u为根的子树对父亲的贡献为1现在假设u为白色,它的子树有x,y,z,那么有dp[u][1]+=dp[x][1]*dp[y][0]*dp[z][0]+dp[x][0]*dp[y][1]*dp
weixin_30636089
·
2020-08-24 10:35
Codeforce
s Round #319 (Div. 2) C. Vasya and Petya's Game 数学题
C.VasyaandPetya'sGametimelimitpertest1secondmemorylimitpertest256megabytesVasyaandPetyaareplayingasimplegame.Vasyathoughtofnumberxbetween1andn,andPetyatriestoguessthenumber.Petyacanaskquestionslike:"I
weixin_30627381
·
2020-08-24 10:34
Codeforce
s.871D.Paths(莫比乌斯反演 根号分治)
题目链接\(Description\)给定\(n\),表示有一张\(n\)个点的无向图,两个点\(x,y\)之间有权值为\(1\)的边当且仅当\(\gcd(x,y)\neq1\)。求\(1\simn\)任意两点之间的最短路长度的和是多少。两个点不连通最短路长度为\(0\)。\(n\leq10^7\)。\(Solution\)具体看这里吧,前面也挺重要的但我不抄了就简单记一下了(好像反而写的很详细了
weixin_30566063
·
2020-08-24 10:29
CodeForce
s 377A Maze(dfs)
A.Mazetimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPavellovesgridmazes.Agridmazeisann × mrectanglemazewhereeachcelliseitherempty,orisawall.Youcangofromon
weixin_30562507
·
2020-08-24 10:29
Codeforce
s 450B div.2 Jzzhu and Sequences 矩阵快速幂or规律
Jzzhuhasinventedakindofsequences,theymeetthefollowingproperty:Youaregivenxandy,pleasecalculatefnmodulo1000000007(109 + 7).InputThefirstlinecontainstwointegersxandy(|x|, |y| ≤ 109).Thesecondlinecontain
weixin_30505225
·
2020-08-24 10:25
Codeforce
s Round #481 (Div. 3) 全题解
A题,题目链接:http://
codeforce
s.com/contest/978/problem/A解题心得:题意就是让你将这个数列去重,重复的数只保留最右边的那个,最后按顺序打印数列。
weixin_30457465
·
2020-08-24 10:53
Codeforce
s 889C Maximum Element(DP + 计数)
题目链接MaximumElement题意现在有这一段求序列中最大值的程度片段:(假定序列是一个1-n的排列)intfast_max(intn,inta[]){intans=0;intoffset=0;for(inti=0;iusingnamespacestd;#definerep(i,a,b)for(inti(a);i=(b);--i)constintN=1e6+10;constintmod=1e
weixin_30415113
·
2020-08-24 10:20
Codeforce
s 570D Tree Requests
D.TreeRequeststimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputRomanplantedatreeconsistingofnvertices.EachvertexcontainsalowercaseEnglishletter.Vertex1isther
weixin_30414635
·
2020-08-24 10:49
Codeforce
s Round #277.5 (Div. 2) --E. Hiking (01分数规划)
http://
codeforce
s.com/contest/489/problem/EE.Hikingtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAtravelerisplanningawaterhikealongtheriver.Henotedthesuita
weixin_30360497
·
2020-08-24 10:16
codeforce
s #530 D(Sum in the tree) (树上贪心)
Mityahasarootedtreewithnnverticesindexedfrom11tonn,wheretheroothasindex11.Eachvertexvvinitiallyhadanintegernumberav≥0av≥0writtenonit.ForeveryvertexvvMityahascomputedsvsv:thesumofallvalueswrittenonthev
weixin_30349597
·
2020-08-24 10:45
E - Nature Reserve
CodeForce
s - 1059D
传送门Thereisaforestthatwemodelasaplaneandlivennrareanimals.Animalnumberiihasitslairinthepoint(xi,yi)(xi,yi).Inordertoprotectthem,adecisiontobuildanaturereservehasbeenmade.Thereservemusthaveaformofacircl
R芮R
·
2020-08-24 10:43
CodeForce
s - 1365
CodeForce
s-1365A-MatrixGame可用的行和可用的列的最小值就是两个人总共可以进行的回合数inta[maxn][maxn],t,n,m,row[maxn],col[maxn];intmain
w_uxidixi
·
2020-08-24 10:54
Codeforces
Codeforce
s Round #498 (Div.3)
目录A-AdjacentReplacementsB-Polycarp'sPracticeC-ThreePartsoftheArrayD-TwoStringsSwapsE-MilitaryProblemF-Xor-PathsA-AdjacentReplacements题意:有一个含有n个元素的数列,1#include#includeusingnamespacestd;constintmaxn=1e3
vloai
·
2020-08-24 10:52
深度优先遍历
Codeforces
[
codeforce
s#438 E题]Policeman and a Tree
基于边的树形DP+DP转移一个神奇的二分。二分要从罪犯的角度去理解,之前一直在纠结一个警察和罪犯的极大极小博弈,没想到可以有这么一个神奇的二分。写完AC,但感觉理解得不够深刻。#include#include#include#includeusingnamespacestd;#defineINF0x7f000000#defineN55structEDGE{intu,v,w;EDGE(intu=0,
vcvycy
·
2020-08-24 10:48
ACM模板
C. Ayoub and Lost Array(思维dp)
Codeforce
sRound#533(Div.2)分析:用dp做,从一位开始递推,取余0,取余1,取余2,互相组合。然后逐渐到n。
vagrancy7
·
2020-08-24 10:47
题目
dp
codeforce
--Vasya and Petya's Game
网址:http://
codeforce
s.com/contest/576/problem/AA.VasyaandPetya'sGametimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVasyaandPetyaareplayingasimplegame.Vasyath
蜗牛蜗牛慢慢爬
·
2020-08-24 10:09
杂题水题
Codeforce
s Round #585 (Div. 2) F. Radio Stations
题意2−SAT2-SAT2−SAT多了一个边的范围,其实只需要把点的范围加上去就行了即:第iii个点(l[i],r[i])(l[i],r[i])(l[i],r[i]),那么构造点jjj,kkk对应l[i]l[i]l[i],r[i]+1r[i]+1r[i]+1。j=l[i]val>=l[i]val>=l[i]与val=r[i]+1val>=r[i]+1val>=r[i]+1与valusingname
hqwhqwhq
·
2020-08-24 10:38
CF
[数论]
Codeforce
s 819D R #421 D.Mister B and Astronomers & 516E R #292 E. Drazil and His Happy Friends
两道类似的题819D考虑一个人应该能够观察的位置ti,(ti+S)modT,(ti+2S)modT⋯这个应该是形成gcd(S,T)个环,每个环是长度Tg然后把同一个环的一起处理,把点放到环上,那么沿环的方向到下一个点为止应该都是归到这个点答案里面的#include#include#include#includeusingnamespacestd;typedeflonglongll;typedefp
里阿奴摩西
·
2020-08-24 10:37
数论
Codeforce
s Round #277.5 (Div. 2)-D
题意:求该死的菱形数目。直接枚举两端的点,平均意义每个点连接20条边,用邻接表暴力计算中间节点数目,那么中间节点任选两个与两端可组成的菱形数目有r*(r-1)/2.代码:#include#include#include#include#include#include#definerep(i,a,b)for(inti=(a);i=(b);i--)#defineclr(a,x)memset(a,x,s
A_Happyer
·
2020-08-24 10:36
图论
Codeforce
s Round #349 (Div. 2) C. Reberland Linguistics
First-ratespecialistsgraduatefromBerlandStateInstituteofPeaceandFriendship.Youareoneofthemosttalentedstudentsinthisuniversity.Theeducationisnoteasybecauseyouneedtohavefundamentalknowledgeindifferentar
RJ28
·
2020-08-24 10:32
ACM
易错
Codeforce
s Round #411 (Div. 1) D. Expected diameter of a tree(树的直径)
PashaisagoodstudentandoneofMoJaK'sbestfriends.Healwayshaveaproblemtothinkabout.Todaytheyhadatalkaboutthefollowingproblem.Wehaveaforest(acyclicundirectedgraph)withnverticesandmedges.Thereareqquerieswes
RJ28
·
2020-08-24 10:32
ACM
易错
好题
图论
codeforce
s #235 D. Roman and Numbers 题解
转载请注明:http://blog.csdn.net/jiangshibiao/article/details/23100595【原题】D.RomanandNumberstimelimitpertest4secondsmemorylimitpertest512megabytesinputstandardinputoutputstandardoutputRomanisayoungmathematic
阿蒋
·
2020-08-24 10:25
codeforces
题解
Codeforce
s Round #263 (Div. 1) C. Appleman and a Sheet of Paper
题目地址:http://
codeforce
s.com/contest/461/problem/C题目大意:见原题。算法分析:启发式暴力,每次把短的纸带折到长的纸带中,在全局记一个rev标记。注意细节。
Charlie-Pan
·
2020-08-24 10:55
Codeforces
Codeforce
s Round #263 (Div. 2)B. Appleman and Card Game
#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusingnam
QQQUQ
·
2020-08-24 10:21
Greedy
上一页
86
87
88
89
90
91
92
93
下一页
按字母分类:
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
其他