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 215D Hot Days(贪心)
题目链接:http://
codeforce
s.com/problemset/problem/215/DDescriptionTheofficialcapitalandtheculturalcapitalofBerlandareconnectedbyasingleroadrunningthroughnregions.Eachregionhasauniqueclimate
adr5970
·
2020-09-14 18:00
Andrew Stankevich Contest 38 , J-Jackpot
http://
codeforce
s.com/gym/100490J-Jackpot给你一个图,两个人轮流按节点下标从小到大顺序进行黑白染色,要求任意时刻有边相连的节点之间颜色必须不同,问谁赢?
acerlawson
·
2020-09-14 18:28
数据结构
codeforces
图论
[
Codeforce
s 545E] Paths and Trees
[题目链接]https://
codeforce
s.com/contest/545/problem/E[算法]首先求u到所有结点的最短路记录每个节点最短路径上的最后一条边答案即为以u为根的一棵最短路径生成树时间复杂度
a576969381
·
2020-09-14 18:22
CodeForce
s - 893E Counting Arrays 【组合数】
题意:给出一个在正整数x,一个正整数y,求有多少个阵列,使得阵列里面有y个元素,且所有元素乘起来等于x。思路:根据整数的唯一分解定理,对于任意正整数都有且只有一种方式写出其素因子的乘积表达式,即:A=(p1^k1)*(p2^k2)*(p3^k3)*......*(pn^kn)其中pi均为素数。所以对于x可已将其分解为若干个质数相乘,如果不够y个其余补1,超过y个可以将这些质因子相乘来减少个数。比如
啊傻给_^
·
2020-09-14 18:17
Codeforce
1059A. Cashier
有个店,来了N个客人,每个客人t时刻来,要服务l时间,然后就把他L时间的上班时间占用掉了一部分,然后求剩下时间里能摸多少次雨,摸一次鱼a时间。A.Cashiertimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVasyahasrecentlygotajobasaca
Ziwen.紫闻
·
2020-09-14 18:16
ACM
Codeforce
Codeforce
s Round #497 (Div. 2) A. Romaji
A.Romajitimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVityahasjuststartedlearningBerlaneselanguage.ItisknownthatBerlaneseusestheLatinalphabet.Vowelletters
Zeolim
·
2020-09-14 18:44
题目
CodeForce
s 19A World Football Cup (简单题)
题目类型简单题题目意思输入n(1中文简洁版|STLinACM|英文完全版第一部分英文完全版第二部分参考代码-有疑问的地方在下方留言看到会尽快回复的#include#include#include#include#include#includeusingnamespacestd;charstr[100][100];chars[100];chars1[100],s2[100];structP{stri
yunyouxi0
·
2020-09-14 18:12
简单题
Codeforce
s 1016E. Rest In The Shades (二分查找、简单几何)
原题链接:http://
codeforce
s.com/contest/1016/problem/E题意简述:平面上有一个点光源,它以每秒1单位长度的速度从点移动到点。
韵意丶布丁公主
·
2020-09-14 18:11
CodeForce
s - 873B Balanced Substring
B.BalancedSubstringtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenastringsconsistingonlyofcharacters0and1.Asubstring[l, r]ofsisastringslsl + 1sl
YinJianxiang
·
2020-09-14 18:11
STL
【
Codeforce
s B. Balanced Substring】
B.BalancedSubstringtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenastringsconsistingonlyofcharacters0and1.Asubstring[l, r]ofsisastringslsl + 1sl
楚江枫
·
2020-09-14 18:38
codeforces
思维
CodeForce
s - 358D Dima and Hares
DimalikedthepresenthegotfromInnaverymuch.HelikedthepresenthegotfromSeryozhaevenmore.DimafeltsogratefultoInnaaboutthepresentthathedecidedtobuyhernhares.Innawasveryhappy.Shelineduptheharesinarow,numbere
UncleJokerly
·
2020-09-14 18:06
ACM
DP一般看规律
CodeForce
s 396 B.On Sum of Fractions(数论)
Description定义v(n)为不大于n的最大素数,u(n)为大于n的最小素数,求Input第一行一整数T表示用例组数,每组用例输入一整数n(T#include#include#include#include#include#include#include#include#includeusingnamespacestd;typedeflonglongll;#defineINF0x3f3f3f
v5zsq
·
2020-09-14 18:06
Code
Forces
数论
Codeforce
s Round #480 (Div. 2)
A.LinksandPearlsDescription:Anecklacecanbedescribedasastringoflinks(’-’)andpearls(‘o’),withthelastlinkorpearlconnectedtothefirstone.Youcanremovealinkorapearlandinsertitbetweentwootherexistinglinksorpe
Tony5t4rk
·
2020-09-14 18:34
codeforce
509C (很有趣的贪心模拟构造)
C.SumsofDigitstimelimitpertest2secondsmemorylimitpertest256megabytesVasyahadastrictlyincreasingsequenceofpositiveintegersa1,...,an.Vasyausedittobuildanewsequenceb1,...,bn,wherebiisthesumofdigitsofai's
_TCgogogo_
·
2020-09-14 18:01
模拟
ACM
(
CodeForce
s) D. Kefa and Dishes (状压dp)
传送门题目大意:有n个菜,每个菜只能吃一次,最多吃m个,每盘菜都有一个快乐值,吃菜的先后顺序也会增加快乐值。解题思路:一开始尝试用最小费用最大流,最后建了一个很复杂的图,发现并不是很好建出来,遂放弃,后来看了别人的写法状压dp,太菜了啊。dp[i][j],i二进制代表现在吃的菜的状态,1代表吃了,0代表没吃,j代表最后吃的j,这样达到的最高快乐值。由当前的dp[s][j],可以去更新后面的状态,在
给我一瓶AC钙
·
2020-09-14 18:28
CodeForces
动态规划
Kefa and Dishes
CodeForce
s - 580D (dp 状态压缩)
WhenKefacametotherestaurantandsatatatable,thewaiterimmediatelybroughthimthemenu.Therewerendishes.Kefaknowsthatheneedsexactlymdishes.Butatthat,hedoesn'twanttoorderthesamedishtwicetotasteasmanydishesasp
日月火山
·
2020-09-14 18:27
dp
codeforce
s 523D 优先队列
题意:给你N个任务单和k个机器,每个任务单有两个变量开始的时间,完成所需要的时间,问你最优去做的话,每个订单的结束时间是?题解:题目保证了数据是递增排序的,那么我们就不用sort了,直接做。然后这里有个小套路:因为题目可以有k个机器,那我们可以先用k个0进去一个优先队列以达到模拟k个优先队列的作用,然后计算他们的完成时间,再放回去优先队列。这道题就做完了。#include#include#incl
Start_to_crazy
·
2020-09-14 18:55
codeforces
CF1399D Binary String To Subsequences
原题链接:http://
codeforce
s.com/problemset/problem/1399/DBinaryStringToSubsequencesYouaregivenabinarystringsconsistingofnzerosandones.Yourtaskistodividethegivenstringintotheminimumnumberofsubsequencesinsuc
ShadyPi
·
2020-09-14 18:51
杂============
贪心
模拟
★【16.6.2】
Codeforce
s Round #356 (Div. 2) C. Bear and Prime 100
C.BearandPrime100timelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputThisisaninteractiveproblem.Intheoutputsectionbelowyouwillseetheinformationaboutflushingtheou
SatenRuiko
·
2020-09-14 18:49
日常刷题
Codeforce
s 991C 二分
C.Candiestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAfterpassingatest,Vasyagothimselfaboxofnncandies.Hedecidedtoeatanequalamountofcandieseachmorningunti
PiscesCrab
·
2020-09-14 18:38
codeforce
1073 C. Vasya and Robot 二分
codeforce
1073C.VasyaandRobot给定N个操作和一个终止点(x,y)求改变最小的区间操作区间R-L+1,使N个操作之后到达终止节点二分区间长度mid,预处理区间位置偏移量,尺取每个长度为
qianyri
·
2020-09-14 18:05
二分
Educational
Codeforce
s Round 48 (Rated for Div. 2) D. Vasya And The Matrix(思维/构造)
D.VasyaAndTheMatrix传送门emmm,想不出来C,最后15mins溜出来写个D的题解●3●题意:给你每行每列的异或让你去构造这个矩阵.其实很简单,首先我们可以发现n和m都很小,那么排除算法题,肯定是往暴力的方向想。那么我们暴力什么呢?题目给的是连续异或,那么最后结果的每一位的0/1肯定是取决于原矩阵对应行每个数对应位的0或者1的和奇偶。那么就很简单啦,暴力每个数的每一个二进制位,看
Murphyc
·
2020-09-14 18:59
codeforce
Codeforce
s 713C Sonya and Problem Wihtout a Legend(离散化dp)
给你一个数列,对于每个数字你都可以++或者−−然后花费就是你修改后和原数字的差值,然后问你修改成一个严格递增的,最小花费如果不是严格递增的,那么就是很多数字可以取相同的而且只有可能是出现的这n个数字的取值为什么呢,如果你取的是两个值中间的一个没有出现的值然后有x个值,修改成这个,肯定没有上下两个端点的值来的更优所以这样考虑的话,对于不严格递增的要求dp[i][j]=abs(b[i]−a[j])+m
Miracle_ma
·
2020-09-14 18:26
Codeforce
s D. 0-1-Tree (树形dp)
https://
codeforce
s.com/contest/1156/problem/D题意:给你一颗树,同时给每一条边定义一个属性0和1,定义(x,y)表示x到y,其中我们经过1边后不能经过0边,求有多少对
KXL5180
·
2020-09-14 18:19
ACM题解
动态规划
codeforce
s 827D(kruskal+倍增+并查集)
传送门题解:先求出最小生成树,用倍增LCA求出不在最小生成树中的边的答案,同时再用这个答案它去更新最小生成树中的边的答案。为了提高更新这一操作的效率,枚举有序(从小到大)的边集,更新过的用并查集连在一起(由于从小到大,小的最优,下条边一定不会再次更新它们),下一次直接往上跳即可。#include#include#include#includeusingnamespacestd;constintMA
嘉伟森的猫
·
2020-09-14 18:18
OI-图论
kruskal
倍增
并查集
codeforce
s 732D Exams(贪心+二分)
题目链接:http://
codeforce
s.com/problemset/problem/732/D题目大意:每组数据第一行包括两个数n,m,第二行是n个数,表示每i天可以通过哪一门考试(0表示这天不能通过任何一门考试
JXR_12355
·
2020-09-14 18:18
ACM
codeforce
s900D 2100分莫比乌斯反演
题目传送门题意:正整数序列,序列的是,并且序列之和是。问这样的序列个数,答案取模。数据范围:。题解:容易发现存在这样的序列等价于。简化一下题意,这样的序列是是,并且序列之和是。是,并且序列之和是的函数是不好求的。序列之和是的函数是很好求的。这样就考虑莫比乌斯反演了。想一想会发现,。反演一下,。通过插板法可以知道。感受:容斥题,可以考虑莫比乌斯反演。代码:#includeusingnamespace
敲代码的欧文
·
2020-09-14 18:18
#
莫比乌斯反演
codeforce
s 743 C. Vladik and fractions(构造)
C.Vladikandfractionstimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVladikandChloedecidedtodeterminewhoofthemisbetteratmath.Vladikclaimedthatforanypositivein
HandsomeHow
·
2020-09-14 18:16
构造
[
codeforce
s 580D]Kefa and Dishes
n很小,很容易想到状态压缩dp,用dp[set][i]表示结尾是i,用了set里的元素的最大值,枚举set和i来更新下一个元素即可。#include#include#include#includeusingnamespacestd;longlongval[20],dp[300000][20];longlongn,m,k;sets;longlongmax(longlongx,longlongy){r
MaticsL
·
2020-09-14 18:44
DP
codeforce
s 653E. Bear and Forgotten Tree 2 连通问题
E.BearandForgottenTree2timelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAtreeisaconnectedundirectedgraphconsistingofnverticesandn - 1edges.Verticesarenumbe
swust_fangfangfang
·
2020-09-14 18:39
图论
Codeforce
s Round #504 (Div. 1 + Div. 2)
Contests链接:
Codeforce
sRound#504(Div.1+Div.2)过题数:3排名:1013/7459A.SingleWildcardPatternMatching题意给定两个字符串ss
Dmaxiya
·
2020-09-14 18:33
Codeforces
CodeForce
s - 1030D Vasya and Triangle (思维题-构造+数论)
题目给定n,m,k,求平面上0=2,有2*n/t#include#include#includeusingnamespacestd;typedeflonglongll;lln,m,k;voidsolve(llgcd){if(2*n*m%k){puts("NO");return;}puts("YES");puts("00");//固定原点if(2*n%k==0)printf("%I64d%I64d\
Code92007
·
2020-09-14 18:33
构造
思维题
Codeforce
s Round #507 (Div. 1)C. Network Safety
题意:给个n个点m条边的图每个点有个权值c范围(0,2^k-1)如果边的两个定点的权值不同那么他们的连接就是安全的现在有一个病毒他的值x在上述范围内随机存在一个集合,int>前面是点集后面病毒值x如果x感染了前面的点集的所有点后(攻击就是c=c^x)原来的连接仍然是安全的就是合法的让你求有多少个合法的集合思路:攻击后连接不安全的条件是a^x==b^x则有a^b==x符合这个条件的ab要么同时在点集
哒哒哒哒哒嘭
·
2020-09-14 18:32
ACM
union_find
sets
math
Educational
Codeforce
s Round 48 (Rated for Div. 2)——A. Death Note ##
ACcode:#includeusingnamespacestd;constintN=2e5+6;typedeflonglongll;lla[N],ans[N];intn,m;intmain(){ios::sync_with_stdio(false);cin.tie(0);cin>>n>>m;for(inti=1;i>a[i];for(inti=1;i<=n;i++){intx=a[i]%m;a[
图南1204
·
2020-09-14 18:59
codeforces
模拟题目
Codeforce
s 1266C Diverse Matrix 题解
博客观赏效果更佳题意简述构造一个r行c列的矩阵,r,c=2r,c>=2r,c>=2,而连续的两个(或以上)个正整数之间,gcdgcdgcd肯定是111。所以我们只要让第iii行为ccc个连续正整数即珂。列同理。稍加思索,我们令第iii行第jjj列为:i∗(j+r)i*(j+r)i∗(j+r)。这样,对于任意的iii,第iii行所有数都是iii乘上ccc个连续的正整数;对于任意的iii,第III列所
LightningUZ
·
2020-09-14 18:59
Codeforce
s 545E【最小树形图】
/*Iwillwaitforyou*/#include#include#include#include#include#include#include#include#include#include#include#include#include#include#definemakemake_pair#definefifirst#definesesecondusingnamespacestd;ty
Lethelody
·
2020-09-14 18:59
图论
codeforce
s 1058D.Vasya and Triangle(数论?)
VasyaandTriangletimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVasyahasgotthreeintegersnn,mmandkk.He'dliketofindthreeintegerpoints(x1,y1)(x1,y1),(x2,y2)(x2,
Amovement
·
2020-09-14 18:58
Educational
Codeforce
s Round 44 (Rated for Div. 2) C - Liebig's Barrels
C.Liebig'sBarrelstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouhavem = n·kwoodenstaves.Thei-thstavehaslengthai.Youhavetoassemblenbarrelsconsistingofkst
HanChen.log
·
2020-09-14 18:57
codeforces
C. Link Cut Centroids(求树的重心)
https://
codeforce
s.com/contest/1406/problem/C做这个题前提是要知道树的重心。百度拉了一下。
小菜鸡加油
·
2020-09-14 18:56
树形dp
树的dfs
Codeforce
s140C
题意:给你n个数,问你最多能从里面取几组3个不同的数。思路:把数组元素计数,然后每次拿个数最多的3个数组合,用优先队列每次取大即可。但是1usingnamespacestd;typedeflonglongLL;constintN=1e5+10;structNode{intnum;intw;booloperatornum;}};priority_queueq;structasd{ints,m,t;}
keyboarder_zsq
·
2020-09-14 18:07
codeforces
贪心
Codeforce
s627A【数学·有意思】
题意:求有多少对(a,b),a+b=s,a^b=x.(正整数)思路:a+b=a^b+a&b*2;#include#include#include#include#includeusingnamespacestd;typedef__int64LL;intmain(){LLs,x;scanf("%I64d%I64d",&s,&x);LLt=(s-x)/2;if(s>=1;}ans+=(1LL<
keyboarder_zsq
·
2020-09-14 18:07
codeforces
CodeForce
s540E【树状数组+二分】
思路:1:变换的做一次树状数组求逆序就好了2:然后就是对于变换的求前面有多少个比他大,后面有多少个比他小具体:对于当前位置,前面有多少比他大,然后减去被占多少位置(二分就好)对于后面位置,后面有多少比他小,然后减去被占多少位置(二分就好)然后就是模拟了。。然后就过了~#includeusingnamespacestd;#definemem(a,b)memset(a,b,sizeof(a))#def
keyboarder_zsq
·
2020-09-14 18:07
BIT树状数组
二分
Codeforce
s 275D Zero Tree 树形DP+贪心
点击打开链接题意:n个结点的树,每个结点有权值v[i],操作:选以1为根的子树,使子树上的点全部+1/-1.nusingnamespacestd;typedeflonglongll;constintN=2e5+20;constllmod=1e9+7;vectore[N],tmp,t;lln,a[N],deg[N],fa[N];llsum[N];//sum[u]uµ½rootËùÔÚµÄÁ´±»²Ù
Masamiiiii
·
2020-09-14 18:34
CODEFORCES_
Dynamic
Programming
Codeforce
s 796D Police Stations 构造+BFS
点击打开链接题意:n个点的树,k个为黑色,law:任意点距离d内都有黑点,n,k,dv,若v已经被某个黑点访问过,则v,u的最小距离黑点不是同一个,u-v可以删除#includeusingnamespacestd;constintN=6e5+20;typedefpairii;intn,k,d,ans;vectore[N];//toidqueueq;//u,fromintvis[N],mk[N];v
Masamiiiii
·
2020-09-14 18:34
CODEFORCES_
Constructive
&
BruteForce
Codeforce
s 831D Office Keys 二分+贪心
题意:n个人在一条直线上,有终点p和k把钥匙,每把钥匙只能拿一次.n,kusingnamespacestd;typedeflonglongll;typedefpairii;constintN=2e3+20;lln,k,p,vis[N];lla[N],b[N];vectorseg;boolcheck(llx){seg.clear();for(inti=1;ix)returnfalse;lladd=(
Masamiiiii
·
2020-09-14 18:34
CODEFORCES_
Binary
Search
&&
Greedy
CodeForce
s 1047C思维
题意:Mr.Fhasnnpositiveintegers,a1,a2,…,an.Hethinksthegreatestcommondivisoroftheseintegersistoosmall.Sohewantstoenlargeitbyremovingsomeoftheintegers.Butthisproblemistoosimpleforhim,sohedoesnotwanttodoitb
ivan_zcy
·
2020-09-14 18:02
codeforce
s 743D Chloe and pleasant prizes 树形dp
D.Chloeandpleasantprizestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputGeneroussponsorsoftheolympiadinwhichChloeandVladiktookpartallowedalltheparticipantst
Marcus-Bao
·
2020-09-14 18:29
树形dp
codeforces
Codeforce
s Global Round 3
A.AnotherOneBitesTheDusttimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputLet’scallastringgoodifandonlyifitconsistsofonlytwotypesofletters—‘a’and‘b’andeverytwo
MekakuCityActors
·
2020-09-14 18:29
Codeforce
s 754 D Fedor and coupons
D.Fedorandcouponstimelimitpertest4secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAllourcharactershavehobbies.ThesameistrueforFedor.Heenjoysshoppingintheneighboringsupermark
HandsomeHow
·
2020-09-14 18:57
数据结构
codeforce
s 743 A Vladik and flights(水题)
A.Vladikandflightstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVladikisacompetitiveprogrammer.ThisyearheisgoingtowintheInternationalOlympiadinInformatics
HandsomeHow
·
2020-09-14 18:57
杂题
上一页
58
59
60
61
62
63
64
65
下一页
按字母分类:
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
其他