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
869c(组合数)
C.TheIntriguingObsessiontimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutput—Thisisnotplayingbutdutyasalliesofjustice,Nii-chan!—Notalliesbutjusticeitself,Onii-ch
yyPurpose_forever
·
2020-08-24 22:41
数论
数学
codeforces
159D D. Palindrome pairs( manacher+dp )
题目链接:
codeforces
159D题目大意:给出一个字符出,求取这个字符串中互相不覆盖的两个回文子串的对数。
黎辰
·
2020-08-24 22:38
codeforces的dp专题
Pasha and Stick
Codeforces
610A
DescriptionPashahasawoodenstickofsomepositiveintegerlengthn.Hewantstoperformexactlythreecutstogetfourpartsofthestick.Eachpartmusthavesomepositiveintegerlengthandthesumoftheselengthswillobviouslyben.Pa
q923714892
·
2020-08-24 22:16
基础水题
Codeforces
Round #320 (Div. 2) B. Finding Team Member
timelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputThereisaprogramingcontestnamedSnakeUp,2npeoplewanttocompeteforit.Inordertoattendthiscontest,peopleneedtoform
miao_2cm
·
2020-08-24 22:07
杂七杂八
codeforces
codeforces
- 735C -
LINK:http://
codeforces
.com/contest/735/problem/C题意:有n个人比赛,比赛规则是淘汰制,而且一个人只能和和他比赛次数相差1以内的人比,问赢的人最多比了几场。
horihori_
·
2020-08-24 22:33
codeforces
Codeforces
Round #337 (Div. 2) A. Pasha and Stick (水)
A.PashaandSticktimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPashahasawoodenstickofsomepositiveintegerlengthn.Hewantstoperformexactlythreecutstogetfourpart
AnICoo1
·
2020-08-24 22:58
技巧
CodeForces
Gym 100803A 模拟,贪心
模拟,贪心的搞,从第一位开始,如果需要交换就从后面找个最近的交换就行#include#include#include#include#include#include#include#includeusingnamespacestd;#definelllonglong#definemaxn100005intN,M;ints1[20];ints2[20];ints3[20];intmain(){//f
sky-edge
·
2020-08-24 21:19
模拟题
CodeForces
CodeForces
Gym 100735E
给你一个矩阵,他们本来是,每行,每列,两条对角线,的和都是一样的,现在把主对角线的元素都挖去,让你求主对角线上各是什么以5*5举例吧,假设为a,b,c,d,e,每行的和是sum,然后将所有行加起来就有,a+b+c+d+e+4sum=5sum,然后sum就能求出来,然后根据每行和为sum,所以每行的那个未知数就能求出来,然后就可以了#include#include#include#include#i
sky-edge
·
2020-08-24 21:19
水题
CodeForces
Codeforces
610A Pasha and Stick 【水题】
A.PashaandSticktimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPashahasawoodenstickofsomepositiveintegerlengthn.Hewantstoperformexactlythreecutstogetfourpart
笑着走完自己的路
·
2020-08-24 21:43
codeforces
水题
Codeforces
gym 101350F 想法
MonkeyingAroundtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputWhenthemonkeyprofessorleaveshisclassforashorttime,allthemonkeysgobananas.Nmonkeysarelinedupsi
black_miracle
·
2020-08-24 21:26
想法
ZeptoLab Code Rush 2015
源地址:http://
codeforces
.com/contest/526最近做题实在是没有感觉,,略颓废。。
ThinkingLion
·
2020-08-24 21:59
codeforces
【
codeforces
】gym 101741 A - Three Arrays(二分做法)
题目链接http://
codeforces
.com/gym/101741/problem/A题目大意给定三个序列a,b,c都是从小到大依次排列然后问你有多少个三元组(i,j,k)满足|a[i]- b[j
Tannidy
·
2020-08-24 21:27
二分
CodeForces
762C Two strings
今天补一下前天的一道题,我果然是太菜了TAT题面如下:C.TwostringsYouaregiventwostringsaandb.Youhavetoremovetheminimumpossiblenumberofconsecutive(standingoneafteranother)charactersfromstringbinsuchawaythatitbecomesasubsequenceo
Messhiro
·
2020-08-24 21:33
题解
Codeforces
D1/D2. Prefix-Suffix Palindrome (字符串hash) /详解
D1.Prefix-SuffixPalindrome(Easyversion)D2.Prefix-SuffixPalindrome(Hardversion)题意:对于给出的字符串,可截取其前缀和后缀,求能组成的最长回文串。思路:正常来说暴力的思路是先匹配前缀pre和后缀suf,找到第一个不匹配的l和r,然后在由l开始从左向右求最长的回文串palindrome,以及由r开始从右向左求最长的回文串pa
我不会DP
·
2020-08-24 21:49
Codeforces
Gym 101142 F. Folding
题意对于原W×H的矩形纸,最少折叠几次能成为w×h的矩形纸片。解题思路反向模拟,w×h的纸张展开一次最大变成2w×h或w×2h,判断最小几次使得w>=W且h>=H即可。需要注意的是纸张可以展开,故长宽可对调。代码#includeusingnamespacestd;constintINF=1e9+7;longlongW,H;intsolve(longlongw,longlongh){if(w>W||
ffutop
·
2020-08-24 21:32
Codeforces
Gym
[
Codeforces
17E]Palisection
题意求一个字符串的所有有交集的回文子串有多少对题解直接做貌似是做不了的,考虑到正难则反我们设回文串的总数是sumsum⇒ans=(sum2)−⇒ans=(sum2)−没有交集的回文串对数考虑怎么算没有交集的回文串对数我们考虑答案可以是∑i∑i以ii结尾的回文串个数×i×i后面的回文串个数以ii结尾的回文串个数就是ii这个点在failfail树上的深度ii后面的回文串个数=∑j>i=∑j>i以jj开
Kelin__
·
2020-08-24 21:48
回文自动机
CodeForces
Gym100935 水题专场
CodeForces
Gym100935比赛链接:
CodeForces
Gym100935ATime水题~#include#include#include#include#include#include#include
Xingw-Xiong
·
2020-08-24 21:38
ACM____套
题
ACM____水
题
【解题总结】SWERC 2019(
Codeforces
Gym 102501)
我解决的:B(1WA)、I、J、A(3WA)、D(1WA,1TLE)。没看的:无。旁观的:C、F、K、G、H。看了但没做出来的:E、L。IRats简单题,略。BBiodiversity简单题,略。CAnts简单题,略。AEnvironment-FriendlyTravel最短路,略。本来应该一次过的题目,但写错了好几个地方,简直丢人。FIcebergs题意:给定几个简单多边形,计算其面积的和。计算
zqy1018
·
2020-08-24 21:05
解题总结
关于
codeforces
的比赛规则
Codeforces
简称:cf(所以谈论cf的时候经常被误会成TX的那款游戏).网址:
codeforces
.com这是一个俄国的算法竞赛网站,由来自萨拉托夫州立大学、由MikeMirzayanov领导的一个团队创立和维护
Top_Spirit
·
2020-08-24 21:21
知识点
acm
codeforces
Codeforces
28D
l+r+c相同的列车才能一起mp[i][j]表示l+r+c=i&&l=j的最大权的位置#include#include#include#includeusingnamespacestd;constintN=1e5+100;structP{intv,c,l,r,s;}p[N];intsta[N],top;intsta1[N],top1;mapmp[N];intpre[N];intmain(){#if
After0514
·
2020-08-24 18:40
dp
拓扑排序入门
话不多少,例题来见
CodeForces
-510CFoxCielis
回忆过往-静夜思-勿颓废
·
2020-08-24 17:23
Codeforces
- D. Make The Fence Great Again
D.MakeTheFenceGreatAgaintimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouhaveafenceconsistingofnverticalboards.Thewidthofeachboardis1.Theheightofthei-thbo
青烟绕指柔!
·
2020-08-24 17:43
Codeforces
动态规划
Codeforces
1005D(dp)
传送门题面:D.PolycarpandDiv3timelimitpertest3secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPolycarplikesnumbersthataredivisibleby3.Hehasahugenumberss.Polycarpwantstocutfromitth
Chen_Jr_
·
2020-08-24 17:04
CodeForces
思维
dp
Codeforces
Round #257 (Div. 2) D题:Jzzhu and Cities 删特殊边的最短路
D.JzzhuandCitiestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputJzzhuisthepresidentofcountryA.Therearencitiesnumberedfrom1toninhiscountry.City1isthecapitalo
zzm_
·
2020-08-24 17:28
CodeForces
28D Don't fear, DravDe is kind dp
主题链接:点击打开链接为了让球队后,删除是合法的。也就是说,对于每一个车辆,l+r+c一样,按l+r+c分类。然后dp一下。#include#include#include#include#include#include#include#includeusingnamespacestd;#definellint#defineN100005structnode{intv,c,l,r;intnum;}
weixin_34194317
·
2020-08-24 17:01
[
Codeforces
28D] Do not fear,DravDe is kind
BriefIntro:对于四元组(v,c,l,r),求其子序列中v最大的和,并使其满足:1、Ci+Li+Ri相同2、L1=0,Rn=03、Li=Sigma(C1...Ci-1)Solution:算是有条件约束的DP吧设dp[k]为选到k且选k的最大值对于每个条件,我们这样处理:1、将所有数据按Ci+Li+Ri的和进行分组处理2、当Li=0时,将其视为起点;当Ri=0时,用dp[i]去更新res3、
weixin_30340617
·
2020-08-24 16:13
Codeforces
546C:Soldier and Cards
DescriptionTwoboredsoldiersareplayingcardwar.Theircarddeckconsistsofexactlyncards,numberedfrom1ton,allvaluesaredifferent.Theydividecardsbetweentheminsomemanner,it’spossiblethattheyhavedifferentnumbero
wb129945130
·
2020-08-24 16:25
ACM-数据结构
CodeForces
986A-Fair 最短路
题目大意在无向无权连通图G=中,每一个结点都有一个不超过k的编号(保证1~k每个编号至少出现一次)。试求从每一个结点出发,遍历到k个编号中的s个所需要经过的最短路径之和。数据范围1#include#include#include#include#include#includeusingnamespacestd;intn,m,k,s;vectorG[100008];intdist[100008][1
Heart_Taylor
·
2020-08-24 16:02
White Lines
CodeForces
- 1200D (前缀和,思维)
题目大意给定一个n*n的红黑格子,然后你可以选一个点把以这个点为左上角的k*k的区域都变为白的,问最多多少个一行或一列都为白。思路前缀和思路,预处理出每一行的前缀和cr[i][j],然后对每一行来说,在算一个每个黑格的贡献,贡献就是如果涂白这行j到j+k-1的网格这行变为全白,那么这个格子的贡献就为1(c[i][j]==1),每一列同样的预处理,之后求出每个c[i][j]对于行的前缀和,这样就可以
sunmaoxiang
·
2020-08-24 16:14
莫队
题目链接:
CodeForces
-617E题目描述:Bobhasafavoritenumberkandaioflengthn.Nowheasksyoutoanswermqueries.Eachqueryisgivenbyapairliandriandasksyoutocountthenumberofpairsofintegersiandj
qqxqhd0YiEcu1Wzp
·
2020-08-24 15:50
莫队算法
codeforces
1221D DP
个人博客链接:https://blog.nuoyanli.com/2020/03/25/cf1221d/链接https://
codeforces
.com/problemset/problem/1221/
nuoyanli
·
2020-08-24 15:32
ACM
#
DP
#
codeforces
codeforces
731C (并查集 水)
题目链接:点击这里题意:给出n只袜子的颜色,每天选择两只袜子,每次能把一只袜子染色。问最少染色几只袜子能使的每天的袜子颜色一样。给每天穿的两只袜子连边,很显然一个分量的袜子要一起考虑,并查集维护分量就好了。然后搜出最多的颜色,把分量的点都染成这个颜色即可。#include#include#include#include#include#includeusingnamespacestd;#defin
morejarphone
·
2020-08-24 15:14
并查集
codeforces
28C (概率DP)
题目链接:点击这里题意:m个房间n个人,每个人随机走进一个房间,每个房间排ai个队伍,走进这个房间的人平均排队,问最长的一个队伍的长度期望。用dp[i][j][k]表示i个房间剩下j个人最长队伍是k的概率。转移的时候就枚举当前房间的人数,概率乘上所有剩下的人中选择这么多人并且他们都进这个房间的概率.期望就是∑ni=1dp[m][0][i]∗i。#include#include#include#in
morejarphone
·
2020-08-24 15:14
概率DP
CodeForces
-740A (分类)
题目:http://
codeforces
.com/problemset/problem/740/A题意:给定n,a,b,c分别表示:目前已经买了n本书书的价格:a元可买1本书,b元可买2本书,c元可买3
旷野虽远
·
2020-08-24 15:42
codeforces
Codeforces
182 div2
退役好久了,闲来无事,和wiking大神solo了一盘CF,稍微写下解题报告。ProblemA水题。#include#include#include#include#includeusingnamespacestd;inta[200005];intmain(){inti,j,n,m,x,y,p,q;scanf("%d%d",&n,&m);x=y=0;for(i=0;i=(q-p+1)/2&&y>=
magicnumber
·
2020-08-24 15:53
Codeforces
#664(Div.2) A~C
A题题解的方案挺好的要形成回文,最后的r,g,b,w中,三偶一奇或者全为偶两步:1、验证初始的r,g,b,w是否满足2、验证变色一次后的r,g,b,w是否满足(前提r>0,g>0,b>0)(变色两次(>0偶次)后,所有数字的奇偶没有变,没有意义变色三次(>1奇次)后,得到的数字的奇偶与变一次相同,没意义)B题C题c1|c2…cn=A,则,对任意的i(1~n),ci|A=A枚举ans[0,511],
雷德梅恩
·
2020-08-24 15:19
Codeforces
codeforces
519D dp
D.AandBandInterestingSubstringstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAandBarepreparingthemselvesforprogrammingcontests.Afterseveralyearsofdoingspo
hackssssss
·
2020-08-24 14:40
动态规划
codeforces
167 Div2 A
A.DimaandFriendstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputDimaandhisfriendshavebeenplayinghideandseekatDima'splaceallnight.Asaresult,Dima'splacegotmes
didi3076
·
2020-08-24 14:07
codeforces
161 Div2 B
B.Squarestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVasyahasfoundapieceofpaperwithacoordinatesystemwrittenonit.Therearendistinctsquaresdrawninthiscoord
didi3076
·
2020-08-24 14:06
codeforces
166 Div2 A
A.BeautifulYeartimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputItseemsliketheyearof2013cameonlyyesterday.Doyouknowacuriousfact?Theyearof2013isthefirstyearaf
didi3076
·
2020-08-24 14:06
codeforces
164 Div2 A
A.Gamestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputManaoworksonasportsTV.He'sspentmuchtimewatchingthefootballgamesofsomecountry.Afterawhilehebegantonotic
didi3076
·
2020-08-24 14:06
codeforces
159 Div2 B
B.PlayingCubestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPetyaandVasyadecidedtoplayalittle.Theyfoundnredcubesandmbluecubes.Thegamegoeslikethat:theplaye
didi3076
·
2020-08-24 14:06
codeforces
166 Div2 C
C.Secrettimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheGreatestSecretEverconsistsofnwords,indexedbypositiveintegersfrom1ton.Thesecretneedsdividingbetwee
didi3076
·
2020-08-24 14:06
ui
CodeForces
165B - Burning Midnight Oil(二分)
B.BurningMidnightOiltimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputOnedayahighlyimportanttaskwascommissionedtoVasya—writingaprograminanight.Theprogramconsi
coco430
·
2020-08-24 13:53
CodeForces
二分
CodeForces
165C - Another Problem on Strings
C.AnotherProblemonStringstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAstringisbinary,ifitconsistsonlyofcharacters"0"and"1".Stringvisasubstringofstringwi
coco430
·
2020-08-24 13:21
杂题
CodeForces
CodeForces
160B - Unlucky Ticket
B.UnluckyTickettimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputEachofyouprobablyhasyourpersonalexperienceofridingpublictransportationandbuyingtickets.Aftera
coco430
·
2020-08-24 13:21
杂题
CodeForces
codeforces
628D 数位dp
题意是给你两个长度相等的串,长度为n,求两串间满足条件的串的个数。一个串满足条件当且仅当奇数位不为d,偶数为为d,且串对应的数字可以被m整除。很典型的数位dp。手残调了一个小时…老是忘掉取模思路:dp[i][j][1]表示前i位形成的数字,模m为j,且到达串前缀的上限的个数,dp[i][j][0]表示没有达到前缀的上限然后按位数转移,讨论奇偶的情况。#include#include#include
buptbh
·
2020-08-24 13:36
dp
codeforces
#165 div2
//div2A#includeintmain(){inti,j,n,T;scanf("%d",&T);while(T--){scanf("%d",&n);if(n>=180||nintx[100005];intmain(){//freopen("input.txt","r",stdin);intn,i;scanf("%d",&n);intsum=0;for(i=0;i=0;i--)if(x[i]>
jkxqj
·
2020-08-24 13:38
【编程题】
训练日记7.23
一、训练赛B-
Codeforces
1216A.Prefixes(AC)题意:给一个字符串(只包含字符‘a’,‘b’),要求a和b相邻,问最少改变多少次,病输出改变后的字符串思路实现:看完题就能出思路,直接暴力模拟
xh_Dopamine
·
2020-08-24 13:19
阶段总结
Codeforces
648div2B
Codeforces
648div2B原题:Ashishhasnelementsarrangedinaline.Theseelementsarerepresentedbytwointegersai—thevalueoftheelementandbi—thetypeoftheelement
Luo_Xubo
·
2020-08-24 13:48
Codeforces
上一页
82
83
84
85
86
87
88
89
下一页
按字母分类:
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
其他