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
Manthan, Codefest 19 (open for everyone, rated, Div. 1 + Div. 2)F. Bits And Pieces
多亏了橘子猫的博客,让我明白了,橘子猫NB,这里贴一手他的博客链接https://blog.csdn.net/ccsu_cat/article/details/100076916题目链接:https://
codeforces
.com
谁抢了我的happypeople
·
2020-09-16 15:18
codeforces
Codeforces
Round #590 (Div. 3)
Codeforces
Round#590(Div.3)A.EqualizePricesAgain题意:求平均值并且向上取整#include#definemset(a,b)memset(a,b,sizeof
谁抢了我的happypeople
·
2020-09-16 15:18
codeforces
D. Shortest Cycle(无向图求最小环) AND HDU6736 Forest Program
题目链接:https://
codeforces
.com/contest/1206/problem/D分析:经过思考,很容易发现若同一位的1的数量>=3,则答案直接为3,否则点的数量不会超过(2*64,除
谁抢了我的happypeople
·
2020-09-16 14:14
codeforces
Codeforces
Round #670 (Div. 2) A-D
题目:link题解连接:A.SubsetMexB.MaximumProductC.LinkCutCentroidsD.ThreeSequences学习连接:https://blog.csdn.net/zstuyyyyccccbbbb/article/details/108560772
OerUUU
·
2020-09-16 13:56
codeforces
Codeforces
Round #670 (Div. 2) C(树的重心)
题意:给你一棵树,你可以删除一条边,添加一条边(可以删除添加同一条),使得这棵树的重心唯一,输出删除的边,和添加的边。前置知识:树的重心及性质首先要知道什么是树的重心,树的重心就是:树中的一个节点,他满足,删除这个节点,剩下若干个连通块,这若干个连通块中最大的那个最小。重心一些基本性质有:删除重心后所得的所有子树,节点数不超过原树的1/2,一棵树最多有两个重心;树中所有节点到重心的距离之和最小,如
OerUUU
·
2020-09-16 13:56
树的重心
Codeforces
Round #669 (Div. 2) A (思维)
题意:给你一个长度为n(n是偶数)只包含0和1的串,让你删除不超过n/2个元素,使得原来的串,奇数位置的值的和等于偶数位置的和,输出删除后的串。题解:记录1的数目和0的数目,如果0的数目大于n/2,直接输出0的个数,否则就输出n/2个1。#includeusingnamespacestd;intmain(){intT;cin>>T;while(T--){intn;cin>>n;intx;intcn
OerUUU
·
2020-09-16 13:56
思维
Codeforces
Round #670 (Div. 2) B (枚举)
题意:给你一排数,有正有负,问你从中选择5个数,使得这五个数乘积最大,输出这个最大值。题解:先排序再枚举~一个正数和4个负数,2个正数和三个负数,等等。#include#definepbpush_back#definelllonglongusingnamespacestd;intmain(){intT;cin>>T;while(T--){intn;cin>>n;intflag=0;vectorz,
OerUUU
·
2020-09-16 13:56
枚举
Codeforces
Round #669 (Div. 2) D (单调队列转移dp)
题意:给你n根柱子,你在第一根柱子上,要跳到第n根柱子,问你最少要跳几下。能从一根柱子跳到另外一根柱子的条件是:这两根柱子严格比他们中间的所有柱子高这两根柱子严格比他们中间的所有柱子低前一根柱子跳到后一根柱子满足其中一个就可以了。题解:首先dp【i】代表的是从第一根柱子跳到第iii根柱子上,最少要跳几下。我们中后往前看,那么第三个条件的方程是:dp[i]=dp[i−1]+1dp[i]=dp[i-1
OerUUU
·
2020-09-16 13:55
单调队列
&
单调栈
codeforces
149d Coloring Brackets
ColoringBracketstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputOncePetyareadaproblemaboutabracketsequence.Hegaveitmuchthoughtbutdidn'tfindasolution.Todayyo
mousehao001
·
2020-09-16 12:37
动态规划
数位dp专辑
1.题目链接:
codeforces
55D【题意】一个数能被它每一位的数字整除(0除外)则为beautifulnumber,问[l,r]之间有多少个这样的数【思路】考虑到每一位的数字只能是1,2,,9,最小公倍数为
mousehao001
·
2020-09-16 12:05
动态规划
dp
CodeForces
- 160E Buses and People(线段树+三维偏序)
题目链接:点击查看题目大意:(网上复制一下别人的题意。。懒)有n辆公交车,每辆公交车有s(起始点),f(终点),t(发车时间)(行驶不需要时间)有m个人,每个人有l(起点),r(终点),t(出现时间)每个人出现后会选择最早经过他且可行的公交车(即满足s#include#include#include#include#include#include#include#include#include#i
Frozen_Guardian
·
2020-09-16 12:55
线段树
线段树
偏序问题
Codeforces
671B Robin Hood 二分答案
B.RobinHoodtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputWeallknowtheimpressivestoryofRobinHood.RobinHooduseshisarcheryskillsandhiswitstostealthemoneyfromr
HARD_UNDERSTAND
·
2020-09-16 11:35
Codeforces
二分/三分
想法题
codeforces
Codeforces
873 D Merge Sort 【分治】
题目:http://
codeforces
.com/contest/873/problem/D题意:子序列长度为n,归并排序,如果子序列不是有序的,那么就折半,再递归,直到子序列有序,总共递归k次。
HARD_UNDERSTAND
·
2020-09-16 11:35
Codeforces
搜索
Codeforces
#443 Div.2 C. Short Program 【位操作】
题目:http://
codeforces
.com/contest/879/problem/C题意:有一个函数,输入正整数x,经过n(n#include#include#include#include#include
HARD_UNDERSTAND
·
2020-09-16 11:35
Codeforces
构造
CodeForces
Gym 100187 A Potion of Immortality
http://
codeforces
.com/gym/100187/problem/AA.PotionofImmortalitytimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheworldfamousscientistInnokentiyhasjustsynth
Calm微笑
·
2020-09-16 07:56
思维
codeforces
Gym 100187A A. Potion of Immortality
A.PotionofImmortalityTimeLimit:20SecMemoryLimit:256MB题目连接http://
codeforces
.com/gym/100187/problem/ADescriptionTheworldfamousscientistInnokentiyhasjustsynthesizedthepotionofimmortality.Unfortunately
b10l07
·
2020-09-16 07:55
Codeforces
Round #Pi (Div. 2) D. One-Dimensional Battle Ships
AliceandBobloveplayingone-dimensionalbattleships.Theyplayonthefieldintheformofalineconsistingofnsquarecells(thatis,ona1 × ntable).AtthebeginningofthegameAliceputskshipsonthefieldwithouttellingtheirpos
weixin_30421809
·
2020-09-16 07:48
codeforces
-gym-100187-D【组合数】【逆元】
题目链接:点击打开链接D.Holidaystimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputEveryoneknowsthatthebattleofEndorisjustamythfabledbyGeorgeLucasforpromotionofhismovie.A
Somethingwll
·
2020-09-16 07:42
逆元
Codeforces
codeforces
-gym-100187-J【dfs】
题目链接:点击打开链接J.DeckShufflingtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheworldfamousscientistInnokentiycontinueshisinnovativeexperimentswithdecksofcards
Somethingwll
·
2020-09-16 07:42
DFS
Codeforces
codeforces
-gym-100187-E【bfs】
题目链接:点击打开链接E.TwoLabyrinthstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAlabyrinthistherectangulargrid,eachofthecellsofwhichiseitherfreeorwall,andit'sposs
Somethingwll
·
2020-09-16 07:11
BFS
Codeforces
codeforces
Gym 100187 A. Potion of Immortality
A.PotionofImmortalitytimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheworldfamousscientistInnokentiyhasjustsynthesizedthepotionofimmortality.Unfortunately
AnICoo1
·
2020-09-16 07:05
数学问题
【
Codeforces
Gym - 100187J】 + DFS
J.DeckShufflingtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheworldfamousscientistInnokentiycontinueshisinnovativeexperimentswithdecksofcards.Nowhehasad
楚江枫
·
2020-09-16 07:09
codeforces
BFS+DFS
CF——
Codeforces
Round #432 (Div. 2, based on IndiaHacks Final Round 2017)
[C.FiveDimensionalPoints](http://
codeforces
.com/contest/851/problem/C)1.2D时设原点为好点,所以最多周围有4个点,x,y正负轴上;
Tawn0000
·
2020-09-16 07:08
数学数论
Gym - 100187E E - Two Labyrinths —— bfs
题目链接:http://
codeforces
.com/gym/100187/problem/E题解:一开始做的时候是将两幅图合并,然后直接bfs看是否能到达终点。
DOLFAMINGO
·
2020-09-16 07:56
BFS
Codeforces
Round #Pi (Div. 2) —— D One-Dimensional Battle Ships
题目的意思是:现在有一个长度为n,宽为1的方格,在上面可以放大小为1*a船,然后输入为n,k,a;分别为平地的大小,船的数量,船的长度。一个叫alice的人已经在地图上摆好了船的位置。然后bob总共可以有m次攻击的机会,然后他每次攻击的点为xi,但是alice并不会告诉它有没有打中(也就是说每次都认为他是miss的),问你,bob可以在第几次攻击的时候推测出alice在撒谎,如果推测不出来则输出-
ACMer_hades
·
2020-09-16 06:51
cf
Codeforces
Round #374 (Div. 2) A. One-dimensional Japanese Crossword —— 基础题
题目链接:http://
codeforces
.com/contest/721/problem/AA.One-dimensionalJapaneseCrosswordtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputRecentlyAdaltikdiscoveredja
DOLFAMINGO
·
2020-09-16 06:48
基础题
Gym - 100187A A - Potion of Immortality —— 贪心
题目链接:http://
codeforces
.com/gym/100187/problem/A题解:光题意就想了很久:在最坏情况下的最小兔子数。其实就是至少用几只兔子就一定能找出仙药(答案存在的话)。
DOLFAMINGO
·
2020-09-16 06:42
贪心
CodeForces
448C(分治)
题意:有n个长度不一样的木板(竖着放),刷子宽度是1,每次只能横着刷或者竖着刷。求能刷完全部木板的最小次数。题记:我们每次都先打横刷(即在这一组木板中找到最短的木板),每次都与全部打竖刷取最小值。之后递归即可。例如:53122首先打横刷一次,就变成了:42011这时我们递归左边(4,2)+右边(1,1)+1,每次递归的值都要与竖着刷的情况取最小值,就像左边(4,2)的情况,打横刷是3次(两次横一次
夏日橙子
·
2020-09-16 04:44
数据结构与算法
动态规划
动态规划
数据结构
Labs_test1 A - Fedya and Maths 欧拉定理
欧拉定理A-FedyaandMathsTimeLimit:1000MSMemoryLimit:262144KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForces
456BDescriptionFedyastudiesinagymnasium.Fedya'smathshometaskistoc
weixin_30722589
·
2020-09-16 04:32
Codeforces
894A QAQ
标签:模拟题目题目传送门“QAQ”isawordtodenoteanexpressionofcrying.Imagine“Q”aseyeswithtearsand“A”asamouth.NowDiamondhasgivenBortastringconsistingofonlyuppercaseEnglishlettersoflengthn.Thereisagreatnumberof“QAQ”int
yjjr
·
2020-09-16 03:21
codeforces
模拟
字符串
OI成长历程
【
codeforces
894A】QAQ
A.QAQtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutput"QAQ"isawordtodenoteanexpressionofcrying.Imagine"Q"aseyeswithtearsand"A"asamouth.NowDiamondhasgivenBorta
codancer
·
2020-09-16 02:07
思维
算法--字符串
codeforces
894 A题 QAQ
A.QAQtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutput"QAQ"isawordtodenoteanexpressionofcrying.Imagine"Q"aseyeswithtearsand"A"asamouth.NowDiamondhasgivenBorta
aboc43983
·
2020-09-16 02:09
Codeforces
Round #447 A. QAQ
A.QAQtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutput"QAQ"isawordtodenoteanexpressionofcrying.Imagine"Q"aseyeswithtearsand"A"asamouth.NowDiamondhasgivenBorta
NicoleYWJ
·
2020-09-16 02:58
Codeforces
894.A QAQ
“QAQ”isawordtodenoteanexpressionofcrying.Imagine“Q”aseyeswithtearsand“A”asamouth.NowDiamondhasgivenBortastringconsistingofonlyuppercaseEnglishlettersoflengthn.Thereisagreatnumberof“QAQ”inthestring(Dia
AC__GO
·
2020-09-16 02:20
cf
所以啊,泥为什么要挖坑啊qaq
http://
codeforces
.com/gym/101741/problem/Jhttp://
codeforces
.com/gym/101741hdu5528hdu5545cf294E2015北京c2015
qkoqhh
·
2020-09-16 02:51
杂类
Codeforces
- 1106D. Lunar New Year and a Wander(图简单题)
Codeforces
-1106D.LunarNewYearandaWander(图简单题)题目链接题目给你一张图,n、m分别代表n个顶点和m条边,然后给你无向图的m条边,要你从1开始,找到一个遍历图的最小的字典序序列
zxzxin
·
2020-09-16 00:17
图论
ACM
Codeforces
- 1106B. Lunar New Year and Food Ordering (模拟)
Codeforces
-1106B.LunarNewYearandFoodOrdering(模拟)题目链接题目一个饭店,有n种食物,每种食物一开始的数量存在rc数组中,每种食物每一份的花费存在sc数组中,
zxzxin
·
2020-09-16 00:17
模拟
ACM
Codeforces
Round#350(Div. 2) 670A Holidays
问题描述A.HolidaysOntheplanetMarsayearlastsexactlyndays(therearenoleapyearsonMars).ButMartianshavethesameweeksasearthlings—5workdaysandthen2daysoff.Yourtaskistodeterminetheminimumpossibleandthemaximumposs
zsdostar
·
2020-09-16 00:43
Codeforces
Codeforces
Global Round 10题解ABCD
A.OmkarandPassword题目传送门OmkarandPassword题目大意给你一个长度为n的数组,每次可以合并两个相邻且不同的数,问最后数组最小的长度思路其实答案只有1或者n,因为全部一样肯定是n,如果有一个不一样,它可以和其他的结合到最后为1ACCode#include#include#includeusingnamespacestd;#defineendl'\n'#defineIN
Kurihada
·
2020-09-16 00:03
codeforces
codeforces
codeforces
gym101572 H Hyacinth 贪心+构造
https://vjudge.net/problem/Gym-101482H题目大意:给一棵树,每个节点可以有两个valuevaluevalue,但是任意相邻的两个节点,最起码要有111个valuevaluevalue是相等的。且这个相等的valuevaluevalue可以计算到贡献里面,问怎么构造使得贡献最大。思路:贪心的想一下,假设父节点是a、ba、ba、b,那么儿子节点要有111个和它相等的
csu_xiji
·
2020-09-16 00:29
比赛补题
贪心
构造法
Graph Without Long Directed Paths
CodeForces
- 1144F
初步思考每条边有两个点,而且要是这个图路径不大于一的话,所有的边都会经过一个点,而每个边只有两个点,且没有重复边和反向边,那只要找到那个点,然后逐个比较就可以了。但是错在了test2。附错误代码:#includeusingnamespacestd;intu[200005],v[200005];stringans="";chartemp;intmain(){intn,m,i,x=0;scanf("%
REAL_BJXLS
·
2020-09-16 00:39
算法
ACM 算法竞赛总结及模板 ------ (拓扑排序)
拓扑排序-邻接矩阵HDU-1285确定比赛名次(拓扑排序-邻接矩阵)(模板)拓扑排序-邻接表HDU-2647Reward(拓扑排序-邻接表)(模板)拓扑排序-队列优化
Codeforces
919DSubstring
Fushicho_XF
·
2020-09-16 00:59
My_ACM模板库
Codeforces
C. Destroying Array
C.DestroyingArraytimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenanarrayconsistingofnnon-negativeintegersa1, a2, ..., an.Youaregoingtodestroyinteg
一定要早睡的小龙
·
2020-09-16 00:10
并查集
思维
Codeforces
Zip-line 650D 345Div1D(LIS)
传送门大意:给出一个序列,求修改一个数过后的最长上升子序列。思路:可以用主席树在线搞,也可以用树状数组离线搞,明显后者好写得多。我们首先读取所有的询问,然后就把询问绑在给出的位置,然后我们正向做一遍LIS,反向做一遍LDS,然后就可以解决这个问题了。#include#include#include#defineMAXN400005usingnamespacestd;inlinevoidGET(in
weixin_33856370
·
2020-09-16 00:07
codeforces
185B - Mushroom Scientists ( 三分搜索)
题意:四个数sabc均为非负,求x,y,z使得x^a*y^b*z^c值最大其中s>=x+y+z这个题用拉格朗日函数可以证明一个结论在s=x+y+z时x=s/(a+b+c),y=s/(a+b+c),z=s/(a+b+c)最大x^a*y^b*z^c的值最大证明很关键啊,翻了高数课本搞弄明白,伤不起啊据某大牛说可以用三分搜索搞定,但是由于精度卡死了不少孩纸。。。你妹,精度小了,WA,精度大了,居然卡边界
weixin_30822451
·
2020-09-16 00:51
Codeforces
Round #350 (Div. 2)(670C)
今天对着算法进阶指南,学了一下离散化。大概对桶排这样的算法优化比较好吧。离散化:就是把无穷大的集合中若干个元素映射为有限集合以便于统计的方法。例如在很多时候,问题范围定义为整数集合Z,但涉及的元素只有m个。(桶排优化)此时,我们就可以把这些整数与(1-m)建立起映射关系,再去掉重复的元素。先排序,再删去相同的元素(也可以用unique函数)voiddiscrete(){intm=0;sort(a+
weixin_30408739
·
2020-09-16 00:27
Codeforces
Round #118 (Div. 2)
A.ComparingStrings判断不同的位置个数以及交换后是否相等。B.GrowingMushrooms模拟。C.Plant矩阵+快速幂D.MushroomScientists题解:AM-GMinequality\[x^ay^bz^c=a^ab^bc^c\frac{x}{a}^a\frac{y}{b}^b\frac{z}{c}^c\lea^ab^bc^c\lgroup\frac{a\frac
weixin_30359021
·
2020-09-16 00:55
CodeForces
44H - Phone Number-dp
http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=20079题意:给你一个电话号码,根据这个号码生成一个新的号码。生成的规则就是新号码的第一个数任意选(0-9),然后之后的每一个新号码都按照以下规则生成:第i个新号码=(第i-1个新号码+第i个老号码的和)/2,这里如果乘除,则新号码i唯一,否则新号码i可以向上或向下取整;求总共
yuhong_liu
·
2020-09-15 23:35
dp-----------
Educational
Codeforces
Round 7 题解
A.InfiniteSequencetimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputConsidertheinfinitesequenceofintegers:1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5….Theseque
woshishabi_2014
·
2020-09-15 23:29
codeforces
题解
codeforces
【
CodeForces
】240F - TorCoder 线段树
传送门:【
CodeForces
】240F-TorCoder题目大意:给你一个长度为n的字符串(下标从1~n)。
poursoul
·
2020-09-15 23:18
线段树
上一页
48
49
50
51
52
53
54
55
下一页
按字母分类:
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
其他