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
709D】Recover the String——大水题
题目:点击进入描述:对一个01字符串,给出他的四个描述:00、01、10、11子串的个数,求是否能构造出这样的一个串,不能则输出Impossible。01串长度不超过1e6,子串数不超过1e9.题解:通过计数我们可以得出,如果一个串的0的个数是num0,那么00子串的个数就是n*(n-1)/2(1+……+n-1),11子串同理。而且每个子串的个数不超过1e9,那么解一元二次不等式就可以知道0/1的
CFhM_R
·
2020-08-23 23:08
c++
水题
Codeforces
Round #495 (Div. 2) C. Sonya and Robots(模拟)
原题地址:http://
codeforces
.com/contest/1004/problem/C题意:给你n个数字,询问你有多少对(i(iusingnamespacestd;typedeflonglongll
yiqzq
·
2020-08-23 22:12
ACM_模拟
Codeforces
Round #382 (Div. 2) ABCD题解
自古卖席的睡光床,你看我这学数学的就从来不会做数论的题。(事实上,啥都不会。)快速版题解:A、B、C水题,D哥德巴赫猜想。A题意:地图有n格,一次跳k步,问从G到T能不能走,路上不能踩到#思路:简单的判断一下代码:382AB题意:从n个数中选两组数,第一组n1个,第二组n2个。求两组平均值的最大和。思路:如果你选了某个x,反正要算平均数,要x/n1或者x/n2。贪心一把代码:382BC题意:n个人
青城废人
·
2020-08-23 20:50
E. Permutation Separation
文章目录[E.PermutationSeparation](https://
codeforces
.com/contest/1295/problem/E)题目大意解题思路代码E.PermutationSeparationE.PermutationSeparationtimelimitpertest
浅眠流转
·
2020-08-23 18:41
线段树
codeforces
1196D2 RGB Substring (hard version)
codeforces
1196D2RGBSubstring(hardversion)题目链接难版和简易版唯一的区别是数据的范围,简易版可以直接暴力,难版需要用DP(动态规划)题目:Youaregivenastringsconsistingofncharacters
麦基yo
·
2020-08-23 18:43
算法
枚举
Sonya and Robots
CodeForces
- 1004C(思维)
C.SonyaandRobotstimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputSinceSonyaisinterestedinroboticstoo,shedecidedtoconstructrobotsthatwillreadandrecognizenumber
JIA-YAO
·
2020-08-23 18:57
水题
Sonya and Robots
codeforces
1004 -csdn博客
SinceSonyaisinterestedinroboticstoo,shedecidedtoconstructrobotsthatwillreadandrecognizenumbers.Sonyahasdrawnnnumbersinarow,aiislocatedinthei-thposition.Shealsohasputarobotateachendoftherow(totheleftof
i-Curve
·
2020-08-23 18:28
codeforces
1004
Sonya and Robots
http://
codeforces
.com/problemset/problem/1004/CSinceSonyaisinterestedinroboticstoo,shedecidedtoconstructrobotsthatwillreadandrecognizenumbers.Sonyahasdrawnnnumbersinarow
G-Howe
·
2020-08-23 17:49
思维题
【
codeforces
13 C】【DP + 离散化 + 贪心+滚动数组 】C. Sequence【用最小代价把序列变成非严格递增序列】
传送门:C.Sequence描述:C.Sequencetimelimitpertest1secondmemorylimitpertest64megabytesinputstandardinputoutputstandardoutputLittlePetyalikestoplayverymuch.Andmostofallhelikestoplaythefollowinggame:Heisgivena
QiufengWang424
·
2020-08-23 16:11
online
judge
Codeforces
------多维杂类DP
------离散化
------贪心
Codeforces
Round #371 (Div. 2) E 【DP+离散化 LIS 】用最小代价把序列变成严格递增序列
传送门:
codeforces
714E.SonyaandProblemWihtoutaLegend描述:E.SonyaandProblemWihtoutaLegendtimelimitpertest5secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputSonyawasunabletothinkofast
QiufengWang424
·
2020-08-23 16:11
online
judge
Codeforces
------多维杂类DP
------离散化
CodeForces
302C(数学)
题目链接:
CodeForces
302C解题思路:操作要求是选n个数,改变它们的符号,使得所有数的和最大。
vufw_795
·
2020-08-23 16:17
CodeForces
算法
Codeforces
Round #625 (Div. 2, based on Technocup 2020 Final Round)(A-C)
比赛链接:https://
codeforces
.ml/contest/1321A:ContestforRobots题意:共有n场比赛,A,B两人参赛,0表示本场比赛不得分,1表示得分。
东曦哥哥
·
2020-08-23 11:42
c++语言
其他
Planning -
Codeforces
- 854C
PlanningHelenworksinMetropolisairport.Sheisresponsibleforcreatingadepartureschedule.Therearenflightsthatmustdeparttoday,thei-thofthemisplannedtodepartatthei-thminuteoftheday.Metropolisairportisthemain
xiyue_jiang
·
2020-08-23 08:11
贪心
Make Palindrome -
Codeforces
- 600C
MakePalindromeAstringiscalledpalindromeifitreadsthesamefromlefttorightandfromrighttoleft.Forexample"kazak","oo","r"and"mikhailrubinchikkihcniburliahkim"arepalindroms,butstrings"abb"and"ij"arenot.Youar
xiyue_jiang
·
2020-08-23 08:10
贪心
模拟
Queries about less or equal elements -
Codeforces
- 600B
QueriesaboutlessorequalelementsYouaregiventwoarraysofintegersaandb.Foreachelementofthesecondarraybjyoushouldfindthenumberofelementsinarrayathatarelessthanorequaltothevaluebj.InputThefirstlinecontainst
xiyue_jiang
·
2020-08-23 08:10
二分
STL
树状数组
数据结构
Extract Numbers -
Codeforces
- 600A
ExtractNumbersYouaregivenstrings.Let'scallwordanylargestsequenceofconsecutivesymbolswithoutsymbols','(comma)and';'(semicolon).Forexample,therearefourwordsinstring"aba,123;1a;0":"aba","123","1a","0".Aw
xiyue_jiang
·
2020-08-23 08:10
模拟
string
codeforces
numbers
word
codeforces
Round#377
codeforces
Round#377表示还是只会水题:虽然这次做出了三题,但是前三题都是思维题吧,到了D题就不会了,还好吧,昨晚涨了100多分;A.BuyaShovel题意:有若干个单位是10的和一个单位是
Lazines_by
·
2020-08-23 08:27
——题解——
http://
codeforces
.com/problemset/problem/1295/B
http://
codeforces
.com/problemset/problem/1295/BB.InfinitePrefixestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenstringsoflengthnconsistingof0
weekness
·
2020-08-23 08:31
循环节利用
字符串
Codeforces
Round #459 (Div. 2):D. MADMAX(记忆化搜索+博弈论)
D.MADMAXtimelimitpertest1secondmemorylimitpertest256megabytesProblemDescriptionAsweallknow,Maxisthebestvideogameplayeramongherfriends.Herfriendsweresojealousofhers,thattheycreatedanactualgamejusttopro
weixin_38166793
·
2020-08-23 08:51
水题都切不动了
题目A-BearandElectionsTimeLimit:1000MSMemoryLimit:262144KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForces
574ADescriptionLimakisagrizzlybearwhodesirespowerandad
weixin_30725315
·
2020-08-23 07:54
数据结构与算法
[
Codeforces
Round #310 (Div. 2)] #ABC题解
题目链接:
Codeforces
Round#309(Div.2)A.CaseofZerosandOnes[Description]给定一个01串,相邻的0和1可以消掉,问最终这个串最短可以消到多长。
Codeplay0314
·
2020-08-23 07:47
codeforces
Codeforces
Beta Round #51 D. Beautiful numbers 题解(数位dp+离散化)
题目链接题目大意就是求区间内能被所有位上的数字(!0)整除的数的个数题目思路首先这很明显是一个数位DP满足被所有位上的数字(!0)整除的数其实就是满足被这些位数的lcm整除然后就是怎么处理一个数在不断变化中还要对lcm{xi}取模呢这时候就要仔细思索其中的奥妙也是本题最重要的一点.首先lcm{1~9}=2520;想到每个数都是1~9中某些数字的lcm所以他们一定能整除2520因为若a≡b(modm
_hunxuewangzi
·
2020-08-23 06:53
dp
推荐的OI资源
AllthegoodtutorialsfoundforCompetitiveProgramminghttp://
codeforces
.com/blog/entry/57282。
努力的老周
·
2020-08-23 06:33
OI
一个奇奇怪怪的数学问题
题目传送门http://
codeforces
.com/contest/709/problem/D题解传送门http://blog.csdn.net/ceerrep/article/details/52314378
ceerrep
·
2020-08-23 05:10
数学
构造
Codeforces
Round #219 (Div. 2) Counting Kangaroos is Fun
Therearenkangarooswithpockets.Eachkangaroohasasize(integernumber).Akangaroocangointoanotherkangaroo'spocketifandonlyifthesizeofkangaroowhoholdthekangarooisatleasttwiceaslargeasthesizeofkangaroowhoishe
bingsanchun
·
2020-08-23 05:51
Binary
Search
Codeforces
1082 毛毛虫图构造&最大权闭合子图
A#includeusingnamespacestd;typedeflonglongll;constintMAXN=55,MAXM=1000;//intto[MAXM'9'){if(c=='-'){p=-1;}c=getchar();}while(c>='0'&&cusingnamespacestd;typedeflonglongll;constintMAXN=55,MAXM=1000;//int
baichuan9723
·
2020-08-23 05:38
Codeforces
1216E2 枚举位数+二分
两个二分枚举位数#include#defineMOD1000000007usingnamespacestd;typedeflonglongll;llten[15];llcheck1(llx){llans=0;lll,r;for(lli=1;i>1;if(check1(mid)>1;if(check2(mid)0){xxx/=10LL;len++;}len-=n;if(len<0){continue
baichuan9723
·
2020-08-23 05:08
Codeforces
Round #588 (Div. 1) C. Konrad and Company Evaluation
直接建反边暴力复杂度分析见https://blog.csdn.net/Izumi_Hanako/article/details/101267502#includeusingnamespacestd;typedeflonglongll;constintMAXN=100005;llout[MAXN],in[MAXN];vectorG[MAXN];intmain(){intn,m;scanf("%d%d
baichuan9723
·
2020-08-23 05:08
CodeForces
- 1221E Game With String 分类讨论
首先分析A能获胜的情况A能获胜当且仅当A拿完后所有剩下的都=2*b时如果是B先手则B可以构造出一个大小刚好为b的来赢得胜利所以如果有两个及以上的X>=2*b后手必胜当有且仅有一个X>=2*b时A肯定要先操作这块来获得胜利A能获胜当且仅当A拿完后的块只能在[1,b)和[a,2*b)这个范围内因为一旦出现[b,a)或者[2*b,无穷)这两个范围内的块A必输所以我们只要暴力枚举看是否存在A取完后[a,2
baichuan9723
·
2020-08-23 05:08
CodeForces
- 681C 【优先队列】
传送门优先队列在语法(推入,删除)上与普通队列一样,不同在于声明时要这样:priority_queue,greater>q;优先队列中默认出来的top值为该队列中的最小的数.这道题就是一道模拟优先队列的题.(被人看来是水题,而我却。)代码如下:#include#include#includeusingnamespacestd;constintmaxn=1000005;structnode{char
Anxdada
·
2020-08-23 04:23
Codeforces
280C Game on Tree 树形期望dp
题目链接题意:给出一棵树,每次可以拆掉一颗子树,问拆完整棵树次数的期望。思路:删掉x点,将x点的贡献记为1,将x的后辈结点贡献记为0。换句话说如果x点是作为根结点删掉的那么贡献为1,否则贡献为0。现在的问题就是求∑f(i)=∑p(i)∗1+(1−p(i))∗0其中p(i)=1/depth(i)#include#include#include#include#include#include#incl
PoemK
·
2020-08-23 04:13
ACM_动态规划
树形dp
概率dp
codeforces
950D. A Leapfrog in the Array
链接:http://
codeforces
.com/contest/950/problem/D题意:现在给你一个n然后一个序列102030405060708现在每次讲后边第一个非零的数移到后边第一个为零的位置
yjt9299
·
2020-08-23 04:10
思维
Codeforces
1181D. Irrigation
https://
codeforces
.com/contest/1181/status/DMishawasinterestedinwaterdeliveryfromchildhood.That'swhyhismothersenthimtotheannualInnovativeOlympiadinIrrigation
SomeOtherTime
·
2020-08-23 04:34
Codeforces
Codeforces
#493 div.2(A, B, C)
A.模拟#include#include#includeusingnamespacestd;intmain(){intn,sum=0;;inta[15],pos[1005];scanf("%d",&n);for(inti=1;i#include#include#includeusingnamespacestd;intn,B;inta[105],b[105];ints[105];intco[105]
elorole
·
2020-08-23 04:03
Codeforces
codeforces
914D(线段树)
题意:1单点更新2查询[l,r]区间的值最多改变一个能不能使得区间的gcd等于给出的x,但是此改变不改变原来的值。思路:线段树维护gcd,很简单。查询的时候可以维护一个cnt的值,表示为当一个点的值不整除x的时候,对数进行改变的个数。当cnt>1的时候,直接结束函数。#includeusingnamespacestd;constintmaxn=5e5+10;typedeflonglongll;#d
Lazines_by
·
2020-08-23 04:10
线段树
codeforces
949B :A Leapfrog in the Array
B.ALeapfrogintheArraytimelimitpertest2secondsmemorylimitpertest512megabytesinputstandardinputoutputstandardoutputDimaisabeginnerprogrammer.Duringhisworkingprocess,heregularlyhastorepeatthefollowingope
AC之路有笑有泪
·
2020-08-23 04:07
Codeforces
codeforces
两道(dp、思维)(C.Ivan the Fool and the Probability Theory)( E. By Elevator or Stairs?)
传送:https://
codeforces
.com/contest/1248/problem/C题目:nxm的网格(10^5),给网格涂上白黑两色,要求一种颜色网格最多有一个相同颜色的网格和它相邻,问总共有多少种涂色方案
wwwlps
·
2020-08-23 03:57
dp
acm
Codeforces
280C Game on Tree
题目链接http://
codeforces
.com/problemset/problem/280/C分析设随机变量XXX表示操作次数,XiX_iXi表示节点iii是否被直接操作(“是”为111,“否”为
Brute Force Kevin
·
2020-08-23 03:28
算法
CodeForces
- 914F Substrings in a String
(∣s∣,q,Σ∣t∣≤105)(|s|,~q,~\Sigma|t|\leq10^5)(∣s∣,q,Σ∣t∣≤105)链接:https://
codeforces
.com/prob
freeze up
·
2020-08-23 03:42
字符串
Codeforces
Round #495 (Div. 2)
题目链接:
Codeforces
Round#495(Div.2)A:最左边和最右边是一定就可以放的,枚举中间的每个间距,特判间距为2*d的情况即可。
青烟绕指柔!
·
2020-08-23 03:03
Codeforces
CodeForces
- 1176C 题解
CodeForces
-1176C题目分析代码传送门题目Youaregivenanarrayaconsistingofnintegers.Eachaiisoneofthesixfollowingnumbers
浪妖雪
·
2020-08-23 03:25
Candy Box (easy version)
CodeForces
- 1183D 题解
@[TOC](CandyBox(easyversion)
CodeForces
-1183D)题目
CodeForces
-1183DThisproblemisactuallyasubproblemofproblemGfromthesamecontest.Therearencandiesinacandybox.Thetypeofthei-thcandyisai
浪妖雪
·
2020-08-23 03:55
Codeforces
949B A Leapfrog in the Array(数学,规律)
B.ALeapfrogintheArraytimelimitpertest2secondsmemorylimitpertest512megabytesinputstandardinputoutputstandardoutputDimaisabeginnerprogrammer.Duringhisworkingprocess,heregularlyhastorepeatthefollowingope
TRZNDP_Z
·
2020-08-23 03:51
解题报告
codeforces
888G Xor-MST Sollin算法求最小生成树,0-1异或True
G.Xor-MSTtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenacompleteundirectedgraphwithnvertices.Anumberaiisassignedtoeachvertex,andtheweightofaned
phython96
·
2020-08-23 03:35
ACM-ICPC训练题解
CODEFORCES训练记录
【
CodeForces
】914 F. Substrings in a String bitset
【题目】F.SubstringsinaString【题意】给定小写字母字符串s,支持两种操作:1.修改某个位置的字符,2.给定字符串y,查询区间[l,r]内出现y多少次。|s|,Σ|y|<=10^5,time=6s。【算法】Bitset【题解】假设S的长度为n,那么对每个字符建一个长度为n的bitset,1表示该位置为该字符,修改时直接修改。查询的时候将字符串y所有的字符的bitset,按顺序错位
weixin_34247299
·
2020-08-23 03:22
数据结构与算法
Codeforces
546 E:士兵的旅行 最大网络流
E.SoldierandTravelingtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputInthecountrytherearencitiesandmbidirectionalroadsbetweenthem.Eachcityhasanarmy.Armyofthe
weixin_33981932
·
2020-08-23 03:37
ACM核武器
详细看这里,我直接粘贴过来有些代码没贴过来http://wuyiqi.net/house/acm_weapons各种强大的编辑器+
codeforces
平台+topcoder平台有什么问题欢迎留言。
weixin_33800463
·
2020-08-23 03:59
分组背包的运用
上面就是分组背包的基本介绍了,就是n个物品,被分成k组,每组中只能选一件,或者不选,下面我们来看看
codeforces
上的一题分组背包的运用,题目连接:http://
codeforces
.com/contest
weixin_33755847
·
2020-08-23 03:56
【
CodeForces
】Gargari and Bishops
依据贪心能够知道,放置的教主必须不能相互攻击到(也就是不在一条对角线上)才干够使得结果最大化。依据观察能够得到教主相互不攻击的条件是他的坐标和互为奇偶(x+y)之后直接暴力,处理每一个坐标对角线的和就好时间复杂度0(n^2)#include#include#includeusingnamespacestd;typedeflonglongLL;constintmaxn=2005;LLsum_l[ma
weixin_33774883
·
2020-08-23 03:56
Codeforces
- 914F bitset 维护字符串匹配个数
题意:给你一个串,支持两种操作,1修改某个点的字符,2询问[l,r]内模式串P与原串的匹配个数bitset的写法是真的6啊,简直是优雅暴力的典范bs[i]表示\(T_i\)与\(P\)匹配与否,具体地,每次错位按位与依次表示\(T_i,T_{i+1}...T_{i+len2-1}\)与\(P_1,P_2...P_{len2}\)匹配与否注意的是最后去除重复部分的起始下标应该是\((r-len2+1
weixin_30780221
·
2020-08-23 03:12
上一页
94
95
96
97
98
99
100
101
下一页
按字母分类:
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
其他