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
1385E] Directing Edges 变形的拓扑排序
Codeforces
Round#656(Div.3)参与排名人数11542早睡早起身体好[
codeforces
1385E]DirectingEdges变形的拓扑排序总目录详见https://blog.csdn.net
mrcrack
·
2020-08-24 09:25
codeforces
[
codeforces
1365E] Maximum Subsequence Value 或运算+为什么选三个元素对应最大值
Codeforces
Round#648(Div.2)参与排名人数13231[
codeforces
1365E]MaximumSubsequenceValue或运算+为什么选三个元素对应最大值总目录详见https
mrcrack
·
2020-08-24 09:54
codeforces
[
codeforces
1350C] Orac and LCM 最大公约数+最小公倍数+公式推导
Codeforces
Round#641(Div.2)参与排名人数11937[
codeforces
1350C]OracandLCM最大公约数+最小公倍数+公式推导总目录详见https://blog.csdn.net
mrcrack
·
2020-08-24 09:54
codeforces
[
codeforces
1365D] Solve The Maze 遍历矩阵的深搜dfs+隔断的设置
Codeforces
Round#648(Div.2)参与排名人数13231[
codeforces
1365D]SolveTheMaze遍历矩阵的深搜+隔断的设置总目录详见https://blog.csdn.net
mrcrack
·
2020-08-24 09:54
codeforces
[
codeforces
1372C] Omkar and Baseball 错排问题
Codeforces
Round#655(Div.2)参与排名人数15842天天熬夜打比赛,身体吃不消,作了一个充满幸福感的决定,赛后第二天再刷[
codeforces
1372C]OmkarandBaseball
mrcrack
·
2020-08-24 09:54
codeforces
[
codeforces
1355D] Game With Array 极端的构造
Codeforces
Round#643(Div.2)参与排名人数11475[
codeforces
1355D]GameWithArray极端的构造总目录详见https://blog.csdn.net/mrcrack
mrcrack
·
2020-08-24 09:54
codeforces
[
codeforces
1355B] Young Explorers 题意难懂
Codeforces
Round#643(Div.2)参与排名人数11475[
codeforces
1355B]YoungExplorers题意难懂总目录详见https://blog.csdn.net/mrcrack
mrcrack
·
2020-08-24 09:54
codeforces
Codeforces
Round #665 (Div. 2) C. Mere Array(数学)
题目传送题意:给你n个元素的数组,现在规定如果gcd(a,b)==Min(数组中的最小值),那么则可以交换a,b的值,现在问,是否能通过这个操作,使得数组不递减思路:1.我们先对改数组排个序,然后进行操作后的数组必须和现在排序后的数组一样。2.然后我们把没排序的数组与排了序的数组相对应,看看相同的位置上,那些数不同,那么不同的数的位置是肯定被交换了的。3.在这些肯定被交换了的数上,我们只需要判断g
要无愧于人
·
2020-08-24 09:21
codeforces
数论
数学
Codeforces
Round #665 (Div. 2) A. Distance and Axis(思维,数学)
题目传送题意:给你一个点A(n,0),现在要求你找到一个整数x,使得abs(x-(abs(n-x))==k,给出n和k,现在你可以进行操作n+1,或者n-1多次,问最少多少次操作使得有非负整数x的存在思路:1.当n都小于k的时候,那么在n前面找一个点使得上述等式成立那是必不可能的,所以我们只有将n一直加到k,然后x选择0即可2.当n大于x的时候,有等式x-(n-x)==k,(因为是对称的,所以这里
要无愧于人
·
2020-08-24 09:21
codeforces
数论
数学
思维
Codeforces
Global Round 10 C. Omkar and Waterslide(思维)
题目传送题意:给你一个大小为n的数组,现在你可以进行操作,使得数组不递增。操作:你可以选择连续的子片段使得,他们的值加一,现在要求你求得最小的使用操作数,使得数组不递减思路:例:1096372420我们先考虑这个例子,怎么使得其操作数最少呢?我们肯定是要把963724这一段变成10就是操作数最少的了再推:我们就要把63724先变成9再推:先把63和24变成7再推:先把3变成6,把2变成4这样的话我
要无愧于人
·
2020-08-24 09:21
codeforces
思维
Codeforces
Global Round 10 D. Omkar and Bed Wars(思维,分块)
题目传送题意:n个人站成一圈,每个人有一个朝向(L或R)。每次操作可以改变一个人的朝向。输入每个人初始的朝向,输出至少经过多少次操作。使得一个人只被一个人攻击时,这个人与攻击他的人必须相互攻击,当一个人被俩个人同时攻击时,这个人可以任意攻击一个人思路:分块思想,先把连续的朝向相同的人分成一块一块的。如:RLLLLRRLLRLR分成:R|LLLL|RR|LL|R|L|R每一块的长度为len,则每一块
要无愧于人
·
2020-08-24 09:21
codeforces
思维
分治
Codeforces
Global Round 10 B. Omkar and Infinity Clock(数学)
题目传送题意:给你一个大小为n的数组a,还有一个正整数k,问进行k次操作后,数组是什么样,一次操作:对于每一个位置i用数组中的最大值-ai替换思路:现在的数组中肯定是有一个最大值的,那么在一次操作后,Max(最大值)的位置一定会变成0,然后又会形成一个新的最大值,此时数组中肯定有Max和0的存在,然后进行操作后,Max变成0,0变成Max,继续下去这就是一个循环。例:5-1420第一次变06135
要无愧于人
·
2020-08-24 09:20
数论
数学
codeforces
Codeforces
Round #643 (Div. 2) D. Game With Array (思维,贪心)
题目链接题意:让你用n个正整数去构成和为S的数组(n,S将给出),问是否存在一个k(1usingnamespacestd;#defineNewNode(TreeNode*)malloc(sizeof(TreeNode))#defineMem(a,b)memset(a,b,sizeof(a))constintN=5e5+5;constintINF=0x3f3f3f3f;constdoubleEPS=
要无愧于人
·
2020-08-24 09:20
codeforces
思维
贪心
Codeforces
Round #648 (Div. 2) C. Rotation Matching(思维)
题目传送题意:给你俩个大小为n的排列,现在你可以任意的选择一个排列,使其全部元素同时向右或者向左平移k(k任选)个单位,问最多能有多少个:当i==j(俩个排列中的位置下标一样时),ai==bj(相同位置的元素值相同)。思路:既然是平移,那么向右或者向左平移的结果是一样的,那么我们何不枚举一下,枚举当前向右平移一个单位,俩个单位,直到n个单位时,那种情况最多。但是这样一来时间复杂度就高了,所以我们要
要无愧于人
·
2020-08-24 09:20
codeforces
思维
CodeForces
- 450B Jzzhu and Sequences 规律
Jzzhuhasinventedakindofsequences,theymeetthefollowingproperty:Youaregivenxandy,pleasecalculatefnmodulo1000000007(109 + 7).InputThefirstlinecontainstwointegersxandy(|x|, |y| ≤ 109).Thesecondlinecontain
mmk27
·
2020-08-24 09:49
数学
CodeForces
- 245C Game with Coins
TwopiratesPolycarpusandVasilyplayaveryinterestinggame.Theyhavenchestswithcoins,thechestsarenumberedwithintegersfrom1ton.Chestnumberihasaicoins.PolycarpusandVasilymoveinturns.Polycarpusmovesfirst.Durin
mmk27
·
2020-08-24 09:49
思维
CodeForces
- 1076D Edge Deletion 最短路标记边
Youaregivenanundirectedconnectedweightedgraphconsistingofnnverticesandmmedges.Let'sdenotethelengthoftheshortestpathfromvertex11tovertexiiasdidi.Youhavetoerasesomeedgesofthegraphsothatatmostkkedgesrema
mmk27
·
2020-08-24 09:49
最短路
codeforces
864D 莫比乌斯反演
简略题意:给出n个数,任选k个数,若gcd(a1,a2...ak)>1,他们对答案的贡献是k∗gcd(a1,a2...ak),问所有可能的方案的总贡献是多少。枚举gcd,那么我们要计算的就是当前gcd对答案的贡献。令f(i)为所有方案中gcd=i对答案的贡献,F(i)表示i|gcd对答案的贡献。假若有x个数为i的倍数,则:F(i)=1∗C(x,1)+2∗C(x,2)+3∗C(x,3)+...+x∗
meopass
·
2020-08-24 09:44
莫比乌斯反演
Codeforces
430C Xor-tree【Dfs+思维】
A.Xor-treetimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputIahubisveryproudofhisrecentdiscovery,propagatingtrees.Rightnow,heinventedanewtree,calledxor-tree.Af
mengxiang000000
·
2020-08-24 09:43
思维
搜索
Codeforces
Round #277.5(Div. 2) D. Unbearable Controversy of Being【暴力】
D.UnbearableControversyofBeingtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTomashkeepswanderingoffandgettinglostwhileheiswalkingalongthestreetsofBerland.I
mengxiang000000
·
2020-08-24 09:43
搜索
暴力枚举
Codeforces
Round #277.5(Div. 2) B. BerSU Ball【二分匹配】
B.BerSUBalltimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheBerlandStateUniversityishostingaballroomdanceincelebrationofits100500-thanniversary!nboysandmgi
mengxiang000000
·
2020-08-24 09:43
二分匹配
CodeForces
- 245C
CodeForces
-245CGamewithCoinsTwopiratesPolycarpusandVasilyplayaveryinterestinggame.Theyhavenchestswithcoins
mandiheyanyu
·
2020-08-24 09:04
Codeforces
Round #643 (Div. 2) D. Game With Array 题解(构造)
题目链接题目大意要你构造一串长度为n总和为s的数组,求其是否满足一段连续的数组和为k或者s-k,0=2*n,那么就可以n-1个数全部为2,另外一个为s-2n+2,则当k=1,肯定就不满足。代码#includeusingnamespacestd;constintmaxn=1e6+5;typedeflonglongll;intn,s;intmain(){scanf("%d%d",&n,&s);if(s
_hunxuewangzi
·
2020-08-24 09:59
构造
Codeforces
Round #643 (Div. 2) B. Young Explorers 题解(贪心)
题目链接题目大意每个人都有一个缺乏经验值,值为ei的人只能加入大于等于ei个人的团,求最多能组成多少个团,有的人可以不用组团题目思路其实就是一个简单贪心,我好菜啊qwq,这都不会写,直接看代码吧代码#include#include#include#includeusingnamespacestd;typedeflonglongll;constintmaxn=3e5+5;intt,n,a[maxn]
_hunxuewangzi
·
2020-08-24 09:58
贪心
Codeforces
Round #643 (Div. 2) C. Count Triangles 题解(思维)
题目链接题目思路显然是找x+y>z即可,其实只要枚举x+y即可,自己好菜qwq代码#include#includeusingnamespacestd;typedeflonglongll;inta,b,c,d;llans;intmain(){scanf("%d%d%d%d",&a,&b,&c,&d);for(inti=max(a+b,c);i<=b+c;i++){//枚举x+yintl=max(a,
_hunxuewangzi
·
2020-08-24 09:58
思维
D - Count Triangles
CodeForces
- 1355C
CodeForces
-1355CLikeanyunknownmathematician,Yurihasfavouritenumbers:AA,BB,CC,andDD,whereA≤B≤C≤DA≤B≤C≤
伊莎贝拉•狗剩
·
2020-08-24 09:57
刷题
CodeForces
C - Game With Array
CodeForces
- 1355D
传送PetyaandVasyaarecompetingwitheachotherinanewinterestinggameastheyalwaysdo.AtthebeginningofthegamePetyahastocomeupwithanarrayofNNpositiveintegers.SumofallelementsinhisarrayshouldbeequaltoSS.ThenPetya
伊莎贝拉•狗剩
·
2020-08-24 09:57
刷题
CodeForces
Codeforces
Round #320 DIV.2
分析:细菌每次一天一分为二,给定希望看到的细菌个数,求需要放多少个细菌。1,2,4,8,16.......细菌个数每天加倍增长。#includeusingnamespacestd;intmain(){intx;cin>>x;intflag=1;while(x>1){if(x%2==1)flag++;//如果x是奇数,就需要放一个细菌来补齐,x=x>>1;//求前一天细菌个数,直到x=1,第一天的}
01的世界
·
2020-08-24 08:56
Codeforces
codeforces
1213G Path Queries
https://
codeforces
.com/problemset/problem/1213/G把询问离线,对于每个询问,我们把比他的要求小的边全部加进树中。
二分抄代码
·
2020-08-24 08:36
离线
并查集
Nature Reserve
CodeForces
- 1059D(二分+精度)
传送门:QAQ题意:给你n个动物的坐标,让你画个圆将所有的动物包括在内并且与y轴相切,问你是否存在这样的圆,并输出最小的圆半径。思路:很简单的二分形式,但是要怎么去检查这个半径是否可行呢。因为这个圆是和y轴相切的,所以对于每个点我们都可以算出圆心的x轴范围,然后记录一下是否有共用范围就行了。精度有点问题,突然发现浮点数运算的奥秘。代码:#include#include#include#includ
liexss
·
2020-08-24 08:26
CodeForces
- 1060D E - Social Circles
题目链接思路:将左边最大和右边最大的合并,再放入重新考虑,知道没有人为止,因为可以有多个圆桌,所以可以简化为下列代码。#include#include#include#include#include#include#include#include#include//#includetypedeflonglongLL;usingnamespacestd;intl[100010],r[1000010]
leo_10
·
2020-08-24 08:18
贪心
CodeForces
1102B--Array K-Coloring--思维
Youaregivenanarrayaaconsistingofnnintegernumbers.Youhavetocolorthisarrayinkkcolorsinsuchawaythat:Eachelementofthearrayshouldbecoloredinsomecolor;Foreachiifrom11tokkthereshouldbeatleastoneelementcolore
Preeee
·
2020-08-24 08:10
模拟
Codeforces
Round #503 (by SIS, Div. 2) C. Elections(贪心)
题目链接:http://
codeforces
.com/contest/1020/problem/C题意描述:有n个选民,m个政党(n,m#defineINF0x3f3f3f3f3f3f3f3f#definelllonglongusingnamespacestd
心照不必宣
·
2020-08-24 08:36
贪心
[cf] 1401 D.Maximum Distributed Tree
题目题目链接:https://
codeforces
.ml/contest/1401/problem/D思路计算每个边的经过次数,然后把最大的p分配给次数最多的即可。
kosf_
·
2020-08-24 08:33
CodeForces
- 275B (广搜)
Considerann × mgrid.Initiallyallthecellsofthegridarecoloredwhite.Lennyhaspaintedsomeofthecells(atleastone)black.Wecallapaintedgridconvexifonecanwalkfromanyblackcelltoanyanotherblackcellusingapathofsid
know_heng
·
2020-08-24 08:01
DFS
BFS
[dsu]
codeforces
375D. Tree and Queries
题意:给出一棵树,1是根节点,n个节点,每个节点有一种颜色。有m次询问,每次询问给出vk,求以v节点为根的子树中有多少种数量至少为k的颜色,一种颜色的数量就是该颜色的节点的数量。题解:离线,回答以v为根的询问时,如果暴力把整棵子树的颜色存进树状数组,复杂度是O(n2logn)。但是子树信息可以保留到父节点继续使用,如果要保留子树信息的话,容易发现处理两棵子树时,子树间会相互影响,所以先不保留地处理
kg20006
·
2020-08-24 08:56
ACM
题解
Codeforces
Round #532 (Div. 2) E. Andrew and Taxi(二分+拓扑排序)
题目链接题意给你一个图1-n标号,m条有向边。每条有向边有一个权值,代表翻转其方向所需代价。求使得图变成无环图,翻转边权的最大值最小。思路二分答案,判断权值大于答案的边集是否能成环,如果不能说明答案可以再小点,否则答案可以大点。关键是翻转哪些边比较难想,第一次感受到拓扑排序,排序二字用处。按拓扑排序的顺序,给每个点从小到大赋权,最后判断如果起点权值大于终点权值则需要翻转。关于评论疑惑,猜测拓扑排序
ToRe.
·
2020-08-24 08:21
#
二分
拓扑排序
Codeforces
Round #535 (Div. 3)C
题目来源:https://
codeforces
.com/problemset/problem/1108/CYouhaveagarlandconsistingof?
稳健的不二少年
·
2020-08-24 08:28
字符串问题
C. Choosing flowers(枚举+思维+二分)
原题链接:https://
codeforces
.com/problemset/problem/1379/C测试样例:Input24350142253524231Output1416样例解释:InthefirstexamplecaseVladimircanpick1flowerofthefirsttypeand3flowersofthesecondtype
叶的一生
·
2020-08-24 08:27
#
CF
#
2019级暑期第五场训练赛
思维
Distance and Axis(思维)
Codeforces
Round #665 (Div. 2)
原题链接:https://
codeforces
.com/contest/1401/problem/A测试样例:input6405801000000001010000001000000output031000000010
叶的一生
·
2020-08-24 08:26
#
CF
思维
Mere Array(排序+思维)
Codeforces
Round #665 (Div. 2)
原题链接:https://
codeforces
.com/contest/1401/problem/C测试样例:input418643662944567575224outputYESYESYESNO样例解释
叶的一生
·
2020-08-24 08:26
#
CF
思维
思维
Distinct Characters Queries(set处理)
Codeforces
Round #590 (Div. 3)
原题链接:https://
codeforces
.com/contest/1234/problem/D测试样例:Inputabacaba521414b15b246217Output312Inputdfcbbcfeeedbaea1516e14b261417b112c26821617c12f110a279110a114b11f2111Output52526
叶的一生
·
2020-08-24 08:26
#
CF
#
2019级暑期第二场训练赛
STL的使用
set
ACM-ICPC 2017 上海赛区ECFINAL I,M
题目链接:ChatGroup/**[链接]:https://
codeforces
.com/gym/101775/problem/A**[题意]:给出n,m。问:从n个人中至少选m个人的方案数。
布呗之路
·
2020-08-24 08:24
记录
Codeforces
Round #200 (Div. 1) C. Read Time 二分
/**
Codeforces
Round#200(Div.1)C.ReadTime二分链接:https://
codeforces
.com/contest/343/problem/C题意:n个刷子m个原点n个刷子同时左右进行刷问最少的时间使得
布呗之路
·
2020-08-24 08:24
CodeForces
ACM--二分
Codeforces
Round #643 (Div. 2)C
题目链接题意:x,y,z三个整数满足a#definelllonglongusingnamespacestd;intmain(){ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);lla,b,c,d,ans=0;cin>>a>>b>>c>>d;for(lli=a+b;i<=b+c;i++){llx=min(b,i-b)-max(a,i-c)+1,z=min
丶di
·
2020-08-24 08:44
codeforces题解
codeforces
1355a 纯思路
题意:输入了a1和k,满足a(n+1)=an+minDigit(an)⋅maxDigit(an).求出来ak。思路:先看这一个题给的条件的范围,(1≤a1≤1e18,1≤K≤1e16)。一看范围这么大,这题肯定不会是模拟,模拟肯定会超时,也不会是打表之类的,因为给的数据范围实在是太大了。这题一定会有规律的。这里就涉及到英语题面的理解了,HereminDigit(x)andmaxDigit(x)ar
equation_H
·
2020-08-24 08:06
Codeforces
D. Omkar and Bed Wars
D.OmkarandBedWarsOmkarisplayinghisfavoritepixelatedvideogame,BedWars!InBedWars,therearenplayersarrangedinacircle,sothatforalljsuchthat2≤j≤n,playerj−1istotheleftoftheplayerj,andplayerjistotherightofpla
henulmh
·
2020-08-24 08:34
CodeForces
245C Game with Coins
GamewithCoinshttp://
codeforces
.com/problemset/problem/245/Ctimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTwopiratesPolycarpusandVasilyplayaveryinteresting
hellohelloC
·
2020-08-24 08:02
未分类
Codeforces
1076E——回溯
题意:给出一棵以1为根的有根树,边权全部为1,点权初始全部为0,给出m个查询,每个查询给出三个变量vdx,表示将v节点的子节点(包括自己)中与v之间的距离usingnamespacestd;constintmaxn=3e5+10;typedeflonglongll;typedefpairP;intn,m;inttot,head[maxn];structEdge{intto,next;}edges[
hao_zong_yin
·
2020-08-24 08:22
数据结构
Codeforces
1076D Edge Deletion——最短路+dfs
题意:n个点m条边的无向连通图(无自环、重边),现在要删除一些边使得图最多剩下k条边,并且这样的点尽量多:这个点到1号节点的最短路不变思路:建出最短路树,统计边数,然后跑一遍dfs,在回溯的时候判断边数与k的关系,若边数>k就使边数减一,否则记录答案#includeusingnamespacestd;constintmaxn=3e5+10;typedeflonglongll;constllINF=
hao_zong_yin
·
2020-08-24 08:22
图论
上一页
88
89
90
91
92
93
94
95
下一页
按字母分类:
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
其他