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
Round #136 (Div. 2) B. Little Elephant and Numbers
B.LittleElephantandNumberstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheLittleElephantlovesnumbers.Hehasapositiveintegerx.TheLittleElephantwantstofindt
risker_2013
·
2020-08-25 04:39
CF
C/C++
158B_Taxi
原题链接:http://
codeforces
.com/problemset/problem/158/B分析:题意分析:有n组人,每组人个人只为4,3,2,1;没辆车最多载4个人,问最少用几辆车把人都装走
徵羽調_xiao賤
·
2020-08-25 04:07
codeforces
KMP||扩展KMP(
Codeforces
535D - Tavas and Malekas )
D.TavasandMalekasTavasisastrangecreature.Usually"zzz"comesoutofpeople'smouthwhilesleeping,butstringsoflengthncomesoutfromTavas'mouthinstead.TodayTavasfellasleepinMalekas'place.Whilehewassleeping,Malek
u010660276
·
2020-08-25 04:05
KMP
codeforces
Codeforces
715A & 716C Plus and Square Root【数学规律】 (
Codeforces
Round #372 (Div. 2))
C.PlusandSquareRoottimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputZStheCoderisplayingagame.Thereisanumberdisplayedonthescreenandtherearetwobuttons,' + '(pl
Coolxxs
·
2020-08-25 04:04
题解
Codeforces
数论—数学相关
规律
Codeforces
Round #157 (Div. 1)B. Little Elephant and Elections 数位dp好
B.LittleElephantandElectionsTherehaverecentlybeenelectionsinthezoo.Overalltherewere7mainpoliticalparties:oneofthemistheLittleElephantPoliticalParty,6otherpartieshavelesscatchynames.Politicalpartiesfin
u010660276
·
2020-08-25 04:34
数位dp
Codeforces
Round #661 (Div. 3) B.C
今天补了一下cf题,发现昨天有一场比赛结果忘记参加了(懊悔),于是今天除了做了以前的比赛之外,还补了一下昨晚的题目。B.GiftsFixingtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouhavenngiftsandyouwanttogiveallofthe
tianyuanzhidian
·
2020-08-25 04:46
Codeforces
991E. Bus Number
题目:点击打开链接题意:题意:给你一个数字序列A(长度不超过18位),问有多少个序列B满足①A中所有数字都一定要在B中出现过;②B中所有数字也一定要在A中出现过;③序列B不能以0开头分析:爆搜所有数字出现情况,然对于每种情况求出非0开头的全排列数量1、记录每个数字出现的次数cnt[i]2、将出现过的数字i从1到cnt[i]遍历。(ifrom0to9)3、得到要使用的数字次数数组tp[]。4、对于每
Self-Discipline
·
2020-08-25 04:46
ACM
codefoces
B. Birthday
B.Birthdayhttp://
codeforces
.com/group/HD13CEfWEl/contest/239779/problem/Btimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputCowboyVladhasabirthdaytoday
一只大秀逗
·
2020-08-25 04:00
蓝桥杯
cf
Palindromic Paths
CodeForces
- 1366C(思维+贪心)
Youaregivenamatrixwithnrows(numberedfrom1ton)andmcolumns(numberedfrom1tom).Anumberai,jiswritteninthecellbelongingtothei-throwandthej-thcolumn,eachnumberiseither0or1.Achipisinitiallyinthecell(1,1),andi
starlet_kiss
·
2020-08-25 04:54
XXXXX
CodeForces
- 1364A(思维)
Ehablovesnumbertheory,butforsomereasonhehatesthenumberx.Givenanarraya,findthelengthofitslongestsubarraysuchthatthesumofitselementsisn’tdivisiblebyx,ordeterminethatsuchsubarraydoesn’texist.Anarrayaisas
starlet_kiss
·
2020-08-25 04:23
思维
贪心算法
Dreamoon Likes Coloring
CodeForces
- 1330C(贪心+思维)
Dreamoonlikescoloringcellsverymuch.Thereisarowofncells.Initially,allcellsareempty(don’tcontainanycolor).Cellsarenumberedfrom1ton.Youaregivenanintegermandmintegersl1,l2,…,lm(1≤li≤n)Dreamoonwillperformm
starlet_kiss
·
2020-08-25 04:23
Two Divisors
CodeForces
- 1366D(数论)
Youaregivennintegersa1,a2,…,an.Foreachaifinditstwodivisorsd1>1andd2>1suchthatgcd(d1+d2,ai)=1(wheregcd(a,b)isthegreatestcommondivisorofaandb)orsaythatthereisnosuchpair.InputThefirstlinecontainssinglein
starlet_kiss
·
2020-08-25 04:23
Codeforces
Round #280 (Div. 2) 解题报告(A B C D E)
A.VanyaandCubes思路:累加计算叠到每个高度至少需要多少方块,然后找最后一个满足的即可。#include#include#include#include#include#include#include#includeusingnamespacestd;#definelllonglong#defineINF1000000000intmain(){intn;while(cin>>n){in
squee_spoon
·
2020-08-25 04:21
解题报告
线性基 求区间异或和最大值
本题和https://
codeforces
.com/c
sinat_41719390
·
2020-08-25 04:12
模板
codeforces
158B Taxi(贪心)
AfterthelessonsngroupsofschoolchildrenwentoutsideanddecidedtovisitPolycarpustocelebratehisbirthday.Weknowthatthei-thgroupconsistsofsifriends(1 ≤ si ≤ 4),andtheywanttoGotoPolycarpustogether.Theydecided
竟然有人也叫Webwei
·
2020-08-25 04:38
codeforces
Codeforces
Round #456 (Div. 2) - (A,B,D)
这场
codeforces
打的非常惨,B题被HACK成功了两次,终于明白为什么比赛时通过了叫pratestpassed而不是Accepeted,B题我思路还不对时就能通过两次,说明
codeforces
是故意留给
菜圾
·
2020-08-25 04:22
Codeforces
ACM比赛练习
Educational
Codeforces
Round 52 (Rated for Div. 2) C. Make It Equal
C.MakeItEqualThereisatoybuildingconsistingofnntowers.Eachtowerconsistsofseveralcubesstandingoneachother.Theii-thtowerconsistsofhihicubes,soithasheighthihi.Let'sdefineoperationsliceonsomeheightHHasfoll
1615925431
·
2020-08-25 04:49
Codeforces
Codeforces
Round #465 (Div. 2) C. Fifa and Fafa
C.FifaandFafaFifaandFafaaresharingaflat.Fifalovesvideogamesandwantstodownloadanewsoccergame.Unfortunately,Fafaheavilyusestheinternetwhichconsumesthequota.FifacanaccesstheinternetthroughhisWi-Fiaccessp
1615925431
·
2020-08-25 04:49
Codeforces
Codeforces
Round #519 by Botan Investments C. Smallest Word
C.SmallestWordIAhassomanycolorfulmagnetsonherfridge!Exactlyoneletteriswrittenoneachmagnet,'a'or'b'.Shelovestoplaywiththem,placingallmagnetsinarow.However,thegirlisquicklyboredandusuallythinkshowtomake
1615925431
·
2020-08-25 04:19
Codeforces
Educational
Codeforces
Round 53 (Rated for Div. 2) B. Vasya and Books
B.VasyaandBooksVasyahasgotnnbooks,numberedfrom11tonn,arrangedinastack.Thetopmostbookhasnumbera1a1,thenextone—a2a2,andsoon.Thebookatthebottomofthestackhasnumberanan.Allnumbersaredistinct.Vasyawantstomo
1615925431
·
2020-08-25 04:19
Codeforces
Codeforces
Round #514 (Div. 2) C. Sequence Transformation
C.SequenceTransformationLet'scallthefollowingprocessatransformationofasequenceoflengthnn.Ifthesequenceisempty,theprocessends.Otherwise,appendthegreatestcommondivisor(GCD)ofalltheelementsofthesequencet
1615925431
·
2020-08-25 04:19
Codeforces
Educational
Codeforces
Round 53 (Rated for Div. 2) A. Diverse Substring
consistingofnnlowercaseLatinletters.Asubstringofstringssisacontinuoussegmentoflettersfromss.Forexample,"defor"isasubstringof"
codeforces
"and"fors"isnot.Thelengtho
1615925431
·
2020-08-25 04:19
Codeforces
Codeforces
Round #465 (Div. 2) B. Fafa and the Gates
B.FafaandtheGatesTwoneighboringkingdomsdecidedtobuildawallbetweenthemwithsomegatestoenablethecitizenstogofromonekingdomtoanother.Eachtimeacitizenpassesthroughagate,hehastopayonesilvercoin.Theworldcanb
1615925431
·
2020-08-25 04:18
Codeforces
Codeforces
934A A Compatible Pair
A.ACompatiblePairNianisamonsterwhichlivesdeepintheoceans.Onceayear,itshowsupontheland,devouringlivestockandevenpeople.Inordertokeepthemonsteraway,peoplefilltheirvillageswithredcolour,light,andcracking
1615925431
·
2020-08-25 04:18
Codeforces
Codeforces
Round #466 (Div. 2) A. Points on the line
A.PointsonthelineWe'vegotnotestcases.Abigolympiadiscomingup.Buttheproblemsetters'numberonepriorityshouldbeaddinganotherproblemtotheround.Thediameterofamultisetofpointsonthelineisthelargestdistancebetw
1615925431
·
2020-08-25 04:18
Codeforces
Codeforces
Round #661-C Boats Competition
题目描述:给出每个人的质量,要求两人一组分组,每组两人的重量和与其他组的重量和相等,求最多能分多少组。输入描述:第1行:t(1\(\leq\)t\(\leq\)1000)。表示测试的个数。第2行:n(1\(\leq\)n\(\leq\)50)。第一个测试中参赛者的个数。第3行:n个数字组成的数组w。表示n位参赛者的重量。(1\(\leq\)\(w_i\)\(\leq\)n)剩下的t-1个测试依此类
Acapplella
·
2020-08-25 04:35
Codeforces
1279A New Year Garland(鸽巢原理)
题目链接:
Codeforces
1279ANewYearGarland思路:简单的鸽巢原理思想代码:#includeusingnamespacestd;typedefpairP;typedeflonglongLL
Yuhan の Blog
·
2020-08-25 04:30
Codeforces
#
数学
Codeforces
Round #641 (Div. 2) C. Orac and LCM(gcd和lcm的重要理解)
传送门实际上不难发现序列中a1对应的lcm对为n-1对,a2对应的n-2对…以此类推,关键是如何化简如下的表达式:gcd{lcm(a1,a2),lcm(a1,a3),…,lcm(a1,an)}GCD和LCM在质因数分解下的意义假设a经过质因数分解后为P1k1*P2k2,…*Pnkn,b经过质因数分解为Q1t1*Q2t2,…*Qmtm假设质因子p为a和b共有的质因子,在a中p的幂次为k1,在b中p的
Happig丶
·
2020-08-25 04:28
Codeforces
数论
Codeforces
Round #608 (Div. 2)——A、B、C题解
题目传送门:https://
codeforces
.com/contest/1271/A.Suits(贪心)题目大意:第一个套餐是一条领带+一条夹克能赚e元,第二个套餐是一个背心+一个围巾+一件夹克能赚f
Friends.
·
2020-08-25 04:24
ACM
CodeForces
- 492A Vanya and Cubes【水题】
VanyaandCubestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVanyagotncubes.Hedecidedtobuildapyramidfromthem.Vanyawantstobuildthepyramidasfollows:thetoplevel
黑糖22
·
2020-08-25 04:20
Codeforces
刷题记录(知识点、链接、索引)不定时更新
此博客作为
codeforces
的刷题记录,以及回忆知识点时的索引带有G、H的题目自有其意义(想知道就私信博主)单击题目可跳转至题解界面题号题目知识点题解链接1312EArrayShrinking区间dphttps
一只酷酷光儿( CoolGuang)
·
2020-08-25 04:20
Codeforces
Round #531 (Div. 3) D - Balanced Ternary String
从前往后把0换够n/3;把1换够n/3;从后往前换2;从前往后变小,从后往前变大`#includeconstintN=300300;constlonglongmod=1e9+7;usingnamespacestd;intn;intc[4];strings;intmain(){ios_base::sync_with_stdio(0);//c++快速输入可和scanf达到一个层次的速度cin>>n>>
nobugexist
·
2020-08-25 04:20
Codeforces
Round #624 (Div. 3) E. Construct the Binary Tree(模拟二叉树)
Description:Youaregiventwointegersnnnandddd.Youneedtoconstructarootedbinarytreeconsistingofnverticeswitharootatthevertex111andthesumofdepthsofallverticesequalstoddd.Atreeisaconnectedgraphwithoutcycles
柠檬咕咕咕
·
2020-08-25 04:18
CodeBlocks
Codeforces
Round #665 (Div. 2) D. Maximum Distributed Tree(DFS+贪心)
题目链接:https://
codeforces
.ml/contest/1401/problem/D题意:n个点,n-1条边,一个数k拆分成若干个素因数将其放置在边上,f(i,j)表示从i顶点到j顶点的边权和
biuhongWA
·
2020-08-25 04:18
codeforces
数据结构
Codeforces
1350 C. Orac and LCM
题意;求所有对的最小公倍数组成新集合的最大公约数是多少?假设aia_iai没有222这个因子,且aja_jaj也没222这个因子,那么lcm(ai,aj)lcm(a_i,a_j)lcm(ai,aj)就不包含222这个因子那么ans=gcd{lcm(ai,aj))∣iv[N];voidinit(){vis[1]=1;rep(i,2,N-10){if(!vis[i])prime[++cnt]=i;fo
邵光亮
·
2020-08-25 04:17
CodeForces
Codeforces
Round #641 (Div. 1) C
C.OracandGameofLife题意:一张图,只有黑点白点,如果一个点旁边的点的颜色和他一样,那他下次就会变色,问一个点在第k次迭代后的颜色思路:直接BFS暴力,预处理一下每个点是从第几次迭代开始变色的就可以随便搞了代码附上:#pragmaGCCoptimize("Ofast","inline","-ffast-math")#pragmaGCCtarget("avx,sse2,sse3,ss
狐佑 怜
·
2020-08-25 04:46
BFS
搜索
题解
Codeforces
Round #615 (Div. 3) A、B、C、D、E
A.CollectingCoinstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPolycarphasthreesisters:Alice,Barbara,andCerene.They’recollectingcoins.Currently,Alicehasac
菜狗一枚
·
2020-08-25 04:45
cf
Educational
Codeforces
Round 92 (Rated for Div. 2) 题解 (A到G)
目录CF1389A-LCMProblemCF1389B-ArrayWalkCF1389C-GoodStringCF1389D-SegmentIntersectionsCF1389E-CalendarAmbiguityCF1389F-BicoloredSegmentsCF1389G-DirectingEdgesCF1389A-LCMProblem设z=LCA(x,y),l≤x,y,z≤rz=LCA(
g@2y
·
2020-08-25 04:03
题解
贪心 dp-
Codeforces
-1286A-Garland
题目链接题意:有n个数字分别问1~n,将这n个数字排成一个序列,如果序列中数字为0,代表该位置的数字未知,否则该位置的数字确定。如果相邻的数字奇偶性相同的话,那么算为一段,求该序列可能的最小段数。思路:以下给出(贪心)和dp两种做法…贪心还是别看了这道题题目中标了dp和greedy,然后我就毫不犹豫的往贪心上想…然后得出了贪心写法(我都不知道这是什么鬼思路,我瞎写了两百行代码错了好几次才过??但是
早晨OvO
·
2020-08-25 04:31
Codeforces
dp
贪心
Codeforces
Round #587 (Div. 3) E2. Numerical Sequence (hard version)(双重二分)
题目链接思路:这道题真的搞疯我了,各种细节各种bug,AC得很不容易,感觉还是码力不够得关系QAQ由于写得时候各种调式找问题,代码已经奇丑无比了,还是讲讲思路吧。。。。由于这里的k很大,我们已经无法向easy版本那么把b数组打表出来解决了,那么就换种思路,首先还是往当给出k的时候,判断k会落在那个数字这个方面想,我们可以一步步缩小范围,首先我们是可以确定k是在1-9、10-99、100-999、1
qq_42479630
·
2020-08-25 04:29
二分
Codeforces
Round #549 (Div. 2) D - The Beatles(暴力枚举)
题目大意:给一个环型序列一共n*k个点,从1号点开始,每隔k有一个饭店,初始的时候离某一个饭店为a,走一步后离某一个饭店为b(0usingnamespacestd;constintmaxn=1e5+10;typedeflonglongll;#definepllpairlonglongn,k;longlonga,b;llmi=1e18+10,mx=0;longlonggcd(longlonga,lo
猝死在学ACM的路上
·
2020-08-25 04:51
枚举
【
CodeForces
1366B--- Shuffle】
【
CodeForces
1366B---Shuffle】题目来源:点击进入【
CodeForces
1366B—Shuffle】DescriptionYouaregivenanarrayconsistingofnintegersa1
私忆一秒钟
·
2020-08-25 04:19
ACM
CodeForces
- 1009B Minimum Ternary String 思维
CodeForces
-1009BMinimumTernaryString题意:给你一串由012组成的字符串,相邻的0和1可以交换位置,相邻的1和2可以交换位置,输出最小的字符串。
柒月 流火
·
2020-08-25 04:47
思维
Educational
Codeforces
Round 47 (Rated for Div. 2)--B. Minimum Ternary String
B.MinimumTernaryStringtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenaternarystring(itisastringwhichconsistsonlyofcharacters'0','1'and'2').Youcan
短发--短发
·
2020-08-25 04:41
Codeforces
Round #587 (Div. 3)
A-Prefixes#include#definelllonglong#definescscanf#defineprprintfusingnamespacestd;chars[200005];intmain(){intn;sc("%d",&n);sc("%s",s);intans=0;for(inti=0;i#definelllonglong#definescscanf#defineprprint
JZK-Keven
·
2020-08-25 04:41
codeforces
C. Colorful Bricks 组合数学
C.ColorfulBrickshttp://
codeforces
.com/problemset/problem/1081/Ctimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputOnhisfreetime
ccsu_deer
·
2020-08-25 04:35
codeforce题解
Codeforces
Round #624 (Div. 3)(D暴力,E思维+复杂模拟,F线段树)
题目链接D.ThreeIntegers题意:给abc你现在可以对这三个数进行+1-1操作问最少操作后使得a整除bb整除c做法:暴力枚举a和b就可以了,注意范围容易被hack#include#definerep(i,a,b)for(inti=a;i#definemkmake_pairusingnamespacestd;typedeflonglongll;llgcd(lla,llb){returnb?
ccsu_deer
·
2020-08-25 04:04
codeforce题解
数据结构---线段树
[stl内的二分]Stairs and Elevators
CodeForces
- 967C
题意:n*m的楼房,cl个楼梯,ce个电梯,除了电梯的最大速度是v外,其他速度都是1。给出q次询问,回答(x1,y1)到(x2,y2),最少需要多少时间?顺序输入(有小到大);简短的。。。。。#include#include#include#include#include#include#includeusingnamespacestd;constintmaxn=1e5+5;intl[maxn];
ZHXU1998
·
2020-08-25 04:28
Codeforces
1009B Minimum Ternary String(模拟+思维) 题解
题目来源:http://
codeforces
.com/problemset/problem/1009/B题目描述:题目描述Youaregivenaternarystring(itisastringwhichconsistsonlyofcharacters
摇摇乐
·
2020-08-25 04:50
Codeforces
模拟
想法
Educational
Codeforces
Round 47 (Rated for Div. 2) B. Minimum Ternary String ( 贪心错误 )
Youaregivenaternarystring(itisastringwhichconsistsonlyofcharacters‘0’,‘1’and‘2’).Youcanswapanytwoadjacent(consecutive)characters‘0’and‘1’(i.e.replace“01”with“10”orviceversa)oranytwoadjacent(consecutiv
looooooogn
·
2020-08-25 04:49
上一页
76
77
78
79
80
81
82
83
下一页
按字母分类:
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
其他