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
Educational
Educational
Codeforces Round 4:(612A:枚举、 612B:水 、 612C:stack、612D:sort )
A.TheTextSplittingYouaregiventhestringsoflengthnandthenumbersp, q.Splitthestringstopiecesoflengthpandq.Forexample,thestring"Hello"forp = 2,q = 3canbesplittothetwostrings"Hel"and"lo"ortothetwostrings"H
efine_dxq
·
2016-01-28 20:00
枚举
sort
ACM
stack
codeforces
Educational
Codeforces Round 5 (D. Longest k-Good Segment)
D.Longestk-GoodSegmenttimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputThearrayawithnintegersisgiven.Let'scallthesequenceofoneormoreconsecutiveelementsinasegm
qq_26564523
·
2016-01-28 15:00
Educational
Codeforces Round 6 C
C.PearlsinaRowtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTherearenpearlsinarow.Let'senumeratethemwithintegersfrom1tonfromthelefttotheright.Thepearlnumb
半根毛线
·
2016-01-27 21:00
Educational
Codeforces Round 6 B
B.GrandfatherDovlet’scalculatortimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputOnceMaxfoundanelectroniccalculatorfromhisgrandfatherDovlet'schest.Henoticedtha
半根毛线
·
2016-01-27 19:00
Educational
Codeforces Round 6 A
A.ProfessorGukiZ'sRobottimelimitpertest0.5secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputProfessorGukiZmakesanewrobot.Therobotareinthepointwithcoordinates(x1, y1)andshouldg
半根毛线
·
2016-01-27 19:00
Educational
Codeforces Round 5 :(codeforces 616)
A.ComparingTwoLongIntegersYouaregiventwoverylongintegersa, b(leadingzeroesareallowed).Youshouldcheckwhatnumberaorbisgreaterordeterminethattheyareequal.Theinputsizeisverylargesodon'tusethereadingofsymb
efine_dxq
·
2016-01-25 10:00
C++
函数
ACM
codeforces
Educational
Codeforces Round 6 C. Pearls in a Row set
C.PearlsinaRowThereare n pearlsinarow.Let'senumeratethemwithintegersfrom 1 to n fromthelefttotheright.Thepearlnumber i hasthetype ai.Let'scallasequenceofconsecutivepearlsa segment.Let'scallasegment go
zxhl
·
2016-01-24 19:00
Educational
Codeforces Round 6 B. Grandfather Dovlet’s calculator 暴力
B.GrandfatherDovlet’scalculator OnceMaxfoundanelectroniccalculatorfromhisgrandfatherDovlet'schest.Henoticedthatthenumberswerewrittenwithseven-segmentindicators(https://en.wikipedia.org/wiki/Seven-segm
zxhl
·
2016-01-24 19:00
Educational
Codeforces Round 6 A. Professor GukiZ's Robot 水
A.ProfessorGukiZ'sRobot ProfessorGukiZmakesanewrobot.Therobotareinthepointwithcoordinates (x1, y1) andshouldgotothepoint (x2, y2).Inasinglesteptherobotcanchangeanyofitscoordinates(maybebothofthem)byon
zxhl
·
2016-01-24 19:00
Educational
Codeforces Round 6:(620)
A.ProfessorGukiZ'sRobotProfessorGukiZmakesanewrobot.Therobotareinthepointwithcoordinates(x1, y1)andshouldgotothepoint(x2, y2).Inasinglesteptherobotcanchangeanyofitscoordinates(maybebothofthem)byone(de
wangyaninglm
·
2016-01-24 12:00
Math
C++
ACM
codeforces
Educational
Codeforces Round 6 C. Pearls in a Row(贪心)
EducationalCodeforcesRound6C:http://codeforces.com/contest/620/problem/CC.PearlsinaRowtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputThereare n pearlsinaro
idealism_xxm
·
2016-01-24 12:00
codeforces
贪心
Educational
Codeforces Round 6 B. Grandfather Dovlet’s calculator(模拟)
EducationalCodeforcesRound6B:http://codeforces.com/contest/620/problem/BB.GrandfatherDovlet’scalculatortimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputOnceMa
idealism_xxm
·
2016-01-24 12:00
模拟
codeforces
Educational
Codeforces Round 6 总结
A.ProfessorGukiZ'sRobottimelimitpertest0.5secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputProfessorGukiZmakesanewrobot.Therobotareinthepointwithcoordinates (x1, y1) andshoul
zyx520ytt
·
2016-01-23 00:00
Educational
Codeforces Round 6 C. Pearls in a Row (分离序列+set)
C.PearlsinaRowtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTherearenpearlsinarow.Let'senumeratethemwithintegersfrom1tonfromthelefttotheright.Thepearlnumb
helloiamclh
·
2016-01-22 23:00
Educational
Codeforces Round 6 B. Grandfather Dovlet’s calculator (分解数字个位)
B.GrandfatherDovlet’scalculatortimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputOnceMaxfoundanelectroniccalculatorfromhisgrandfatherDovlet'schest.Henoticedtha
helloiamclh
·
2016-01-22 22:00
Educational
Codeforces Round 6 A. Professor GukiZ's Robot
A.ProfessorGukiZ'sRobottimelimitpertest0.5secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputProfessorGukiZmakesanewrobot.Therobotareinthepointwithcoordinates(x1, y1)andshouldg
helloiamclh
·
2016-01-22 22:00
Educational
Codeforces Round 6 E. New Year Tree(DFS序+线段树)
题目链接:点击打开链接题意:给你一棵树,编号1~n,告诉你根结点是1。每次有两个操作:1,将以v为根的子树的结点全部染成颜色c2,问以v为根的紫书的结点的颜色种类。思路:如果这是一条线段的话,那么这就是线段树的区间更新问题,而现在是一棵树。因为告诉了根结点是1,那么这棵树的任意一个结点的子树就是确定的,所以我们可以用DFS的先序遍历,将所有结点重新编号,因为先序遍历的话,任意一个结点和其子树的编号
weizhuwyzc000
·
2016-01-22 16:00
位运算
数据结构
线段树
DFS
codeforces
Codeforces
Educational
Codeforces Round 5
题目地址:http://codeforces.com/contest/616CodeForces616A题意:输入两个数字【最大为10^6位的非负整数】,判断大小,可能有前导0思路:模拟,先分别去掉前导0,然后判断位数,位数不相等的话,位数大的比较大位数相等的话,逐字符比较大小即可。#define_CRT_SECURE_NO_DEPRECATE #include #include #include
slime_kirito
·
2016-01-22 14:00
codeforces
cf
Educational
Codeforces Round 6 C Pearls in a Row
C.PearlsinaRowtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputThereare n pearlsinarow.Let'senumeratethemwithintegersfrom 1 to n fromthelefttotheright.Thepea
neuike
·
2016-01-22 13:00
Codeforce
Educational
Round 6
CodeforceEducationalRound6A:答案就是max(abs(x1-x2),abs(y1-y2)).B:打一张表就行了。C:题意:将一个序列尽量分成多的线段,线段两两不相交且每一条线段中都有且仅有一对权值相同的数。贪心即可,用map代替hash,每次找到2个就clear。#include #include #include #include #include #include #
jzhang1
·
2016-01-22 09:00
Educational
Codeforces Round 6 题解&&代码
A设坐标(x1,y1)(x2,y2)答案max(abs(x1-x2),abs(y1-y2))B预处理出来每个数字要用多少。。暴力就好如果是10^12也不难(可以数位dp)C贪心就好,每次发现重复的就重新计数写T了一次。。自己的程序弱可以被卡到n^2,考完才发现D大概就是暴力?还没写E维护一颗线段树,树上有60个标记,压到一个longlong里面可以少个log大概就是跑一边dfs记录子树在线段树中的
lcrtest
·
2016-01-22 09:00
题解
总结
codeforces
Educational
Codeforces Round 3 B.The Best Gift (数学)
EducationalCodeforcesRound3B:http://codeforces.com/contest/609/problem/BB.TheBestGifttimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputEmily'sbirthdayisnextwe
idealism_xxm
·
2016-01-20 13:00
模拟
codeforces
Educational
Codeforces Round 3 C.Load Balancing(模拟)
EducationalCodeforcesRound3C:http://codeforces.com/contest/609/problem/CC.LoadBalancingtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputIntheschoolcomputerro
idealism_xxm
·
2016-01-20 13:00
模拟
codeforces
Educational
Codeforces Round 3 D.Gadgets for dollars and pounds(贪心&&二分)
EducationalCodeforcesRound3D:http://codeforces.com/contest/609/problem/DD.Gadgetsfordollarsandpoundstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputNurawant
idealism_xxm
·
2016-01-20 13:00
codeforces
二分
贪心
Educational
Codeforces Round 2 E.Lomsat gelral(树形dp)
EducationalCodeforcesRound2E:http://codeforces.com/contest/600/problem/EE.Lomsatgelraltimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenarootedtree
idealism_xxm
·
2016-01-18 20:00
dp
codeforces
树形DP
Educational
Codeforces Round 2 D.Area of Two Circles' Intersection(计算几何)
EducationalCodeforcesRound2D:http://codeforces.com/contest/600/problem/DD.AreaofTwoCircles'Intersectiontimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouar
idealism_xxm
·
2016-01-18 15:00
codeforces
计算几何
Educational
Codeforces Round 5 [补F]
A.ComparingTwoLongIntegers题意:比较两个数的大小;注意点:数字最多有1e6位,而不是最大是1e6;#include constintmaxn=1e6+5; chara[maxn],b[maxn]; intmain() { while(scanf("%s%s",a,b)!=EOF) { intlen1=strlen(a); intlen2=strlen(b); intcnt
L_avender
·
2016-01-17 21:00
codeforces
Educational
Codeforces Round 2 C.Make Palindrome(贪心)
EducationalCodeforcesRound2B:http://codeforces.com/contest/600/problem/CC.MakePalindrometimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAstringiscalledpalin
idealism_xxm
·
2016-01-17 11:00
codeforces
贪心
Educational
Codeforces Round 2 B.Queries about less or equal elements(排序&&二分)
EducationalCodeforcesRound2B:http://codeforces.com/contest/600/problem/BB.Queriesaboutlessorequalelementstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYou
idealism_xxm
·
2016-01-16 22:00
排序
codeforces
二分
Educational
Codeforces Round 2 A.Extract Numbers(模拟)
EducationalCodeforcesRound2A:http://codeforces.com/contest/600/problem/AA.ExtractNumberstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenstring s.
idealism_xxm
·
2016-01-16 21:00
模拟
codeforces
Codeforces
Educational
round 5
A:比较字符串的大小,去除前导零,没啥说的…#include #include #include #include #include #include #include #include usingnamespacestd; intA,B,lens,lent; chars[1000010],t[1000010]; intmain() { gets(s+1); gets(t+1); A=1; B=1
jzhang1
·
2016-01-15 20:00
Educational
Codeforces Round 5 总结
A.ComparingTwoLongIntegerstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregiventwoverylongintegers a, b (leadingzeroesareallowed).Youshouldcheckwhatnu
zyx520ytt
·
2016-01-13 17:00
Educational
Codeforces Round 5 C. The Labyrinth (DFS **)
C.TheLabyrinthtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenarectangularfieldofn × mcells.Eachcelliseitheremptyorimpassable(containsanobstacle).
helloiamclh
·
2016-01-12 21:00
Educational
Codeforces Round 5 B. Dinner with Emma
B.DinnerwithEmmatimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputJackdecidestoinviteEmmaoutforadinner.Jackisamodeststudent,hedoesn'twanttogotoanexpensiveresta
helloiamclh
·
2016-01-12 17:00
Educational
Codeforces Round 5 A. Comparing Two Long Integers (水)
A.ComparingTwoLongIntegerstimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregiventwoverylongintegersa, b(leadingzeroesareallowed).Youshouldcheckwhatnumbe
helloiamclh
·
2016-01-12 17:00
Codeforces
Educational
Round 5
CodeforcesEducationalRound5通过数:4Standing:196/4176题目链接:http://codeforces.com/contest/616A:两个大数,可能有首0.问哪个数大#include #include #include #include #include #include #include usingnamespacestd; constintMAXN=
beihai2013
·
2016-01-12 11:00
Educational
Codeforces Round 2 B. Queries about less or equal elements (二分)
B.Queriesaboutlessorequalelementstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregiventwoarraysofintegers a and b.Foreachelementofthesecondarray bj yo
helloiamclh
·
2016-01-01 17:00
Educational
Codeforces Round 3 B. The Best Gift
B.TheBestGifttimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputEmily'sbirthdayisnextweekandJackhasdecidedtobuyapresentforher.Heknowsshelovesbookssohegoestothe
helloiamclh
·
2015-12-29 17:00
Educational
Codeforces Round 4 总结
A.TheTextSplittingtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregiventhestring s oflength n andthenumbers p, q.Splitthestring s topiecesoflength p an
zyx520ytt
·
2015-12-26 01:00
Codeforces
Educational
Round 3
CodeforcesEducationalRound3题目链接:http://codeforces.com/contest/609A:水题,一个数最少分几段使得可以放到一些长度区间里。#include #include #include #include #include #include #include usingnamespacestd; constintMAXN=100+5; inta[M
beihai2013
·
2015-12-25 11:00
【
Educational
Codeforces Round 3 E】【树链剖分】Minimum spanning tree for each edge 图构最小生成树,生成树必须包含第i条边
E.Minimumspanningtreeforeachedgetimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputConnectedundirectedweightedgraphwithoutself-loopsandmultipleedgesisgiven.Gra
snowy_smile
·
2015-12-23 20:00
codeforces
图论-最小生成树
数据结构-树链剖分
题库-CF
【
Educational
Codeforces Round 3 D】【二分答案 贪心排序】Gadgets for dollars and pounds m个物品n天价格买k个的最早天数
Gadgetsfordollarsandpoundstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputNurawantstobuy k gadgets.Shehasonly s burlesforthat.Shecanbuyeachgadgetfordollarso
snowy_smile
·
2015-12-23 20:00
codeforces
贪心
二分
题库-CF
有趣排序
【
Educational
Codeforces Round 3 C】【贪心 排序】Load Balancing 最小操作步数使得数字之差尽可能小
C.LoadBalancingtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputIntheschoolcomputerroomthereare n serverswhichareresponsibleforprocessingseveralcomputingtask
snowy_smile
·
2015-12-23 16:00
codeforces
贪心
题库-CF
【
Educational
Codeforces Round 3 B】【水题 基本容斥】The Best Gift n本书任选两个不能同一类型的方案数
B.TheBestGifttimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputEmily'sbirthdayisnextweekandJackhasdecidedtobuyapresentforher.Heknowsshelovesbookssohegoestothe
snowy_smile
·
2015-12-23 16:00
水题
codeforces
容斥
题库-CF
【
Educational
Codeforces Round 3 A】【水题 排序】USB Flash Drives 最少数量U盘存储m大小文件
A.USBFlashDrivestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputSeanistryingtosavealargefiletoaUSBflashdrive.Hehas n USBflashdriveswithcapacitiesequalto a1,
snowy_smile
·
2015-12-23 16:00
水题
codeforces
题库-CF
Educational
Codeforces Round 2 Edge coloring of bipartite graph
题意:输入一个二分图,用最少的颜色数给它的每条边染色,使得同一个顶点连的边中颜色互不相同。输出至少需要的颜色数和任意一种染色方案。分析:证明不会,只说一下(偷瞄巨巨代码学到的)做法。假设点的最大度数为\(M\),那么至少需要\(M\)种颜色。下面给出一种构造方法:对于一条边\((u,\,v)\),分别找出对于\(u\)和\(v\)还没用到的颜色\(c_1\)和\(c_2\)。如果\(c_1=c_2
AOQNRMGYXLMV
·
2015-12-22 23:00
Educational
Codeforces Round 3
这场要是算分的话估计就有机会涨到紫了,4个题1A。A题:#include #defineREP(i,a,b)for(inti=a;i>n>>m){ REP(i,1,n)scanf("%d",&a[i]); sort(a+1,a+n+1); intans=0; for(inti=n;i>=1;i--){ if(m #defineREP(i,a,b)for(inti=a;i=m||cur
__560
·
2015-12-20 17:00
Educational
Codeforces Round 2
A.ExtractNumbers【题意】给定一个字符串,把用逗号或分号隔开的子串称为一个word,第一行输出所有由整数组成的word(01,1.0不算整数),第二行输出剩余所有word。不改变word的前后顺序,并用逗号隔开。【分析】判断word是否为整数时需要注意。【代码】#include #include #include #include #include usingnamespa
Yukizzz
·
2015-12-06 15:00
codeforces
Educational
Codeforces Round 2
又是一场cf,依旧三题第一题和第三题比较有意义。A考察对字符串,操作‘,’ ‘;’作为分隔符....这题体现string方便,可以直接拼接,以后多使用。#include usingnamespacestd; vectora,b; boolgood(stringst){ if(st.size()==0)returnfalse; if(st.size()>1&&st[0]=='0')returnfal
yexiaohhjk
·
2015-11-29 21:00
Educational
Codeforces Round 1 C.Nearest vectors(排序)
EducationalCodeforcesRound1C:http://codeforces.com/contest/598/problem/CC.Nearestvectorstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregiventhesetofv
idealism_xxm
·
2015-11-28 15:00
排序
codeforces
上一页
21
22
23
24
25
26
27
28
下一页
按字母分类:
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
其他