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
Educational
Codeforces
Round 62 (Rated for Div. 2) E. Palindrome-less Arrays
链接https://
codeforces
.com/contest/1140/problem/E题解奇偶分开现在问题变成,你要在一些位置填上数字,使得相邻的不能相同f[i][0/1]f[i][0/1]f[
*ACoder*
·
2020-09-13 18:43
#
一般动态规划
【
CodeForces
-1041C】Coffee Break(二分解决关于set,pair,upper_bound用法)
【
CodeForces
-1041C】CoffeeBreak(二分解决关于set,pair,upper_bound用法)//题意:一个的工作时间是m分钟。
小小小丸子儿
·
2020-09-13 18:10
A. Rooms and Passages【区间问题】
题目链接:https://
codeforces
.com/gym/102215/problem/A题目:Thereare(n+1)roomsinthedungeon,consequentlyconnectedbynpassages.Theroomsarenumberedfrom0ton
DevourPower
·
2020-09-13 18:36
Div题解
算法
区间问题
Codeforces
GYM 100923G 详解
GYM100923G解题思路分析题目大意:给出一个N*M的矩阵,矩阵中每个格点具有可正可负的权值,求出权值最大的联通块的权值和。思考过程:从一开始就想的一直是多维dp,因为题中给出的是一个矩阵。但是多维dp又只能求出一条“路径”而不是一个联通块,因此又想到了dp之后再搜索合并“路径”,但是实在没有不TLE的实现方法,于是开始觉得情况不是我想象的这样。然后又套用矩阵中取子矩形的方式进行下一轮的思考,
Cleara8812
·
2020-09-13 18:34
KMP
CodeForces
432D
D.PrefixesandSuffixestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouhaveastrings = s1s2...s|s|,where|s|isthelengthofstrings,andsiitsi-thcharacter.Let'sin
OtterVV
·
2020-09-13 18:04
ACM
KMP
Codeforces
GYM 100726B 详解
GYM100722F解题思路分析题目描述:给你一个目标数独和一个未完成的且只有一种解法的标准数独,允许你对数独进行一下五种操作:顺时针或逆时针旋转这个数独;交换一个3*9矩阵内的任意两行;交换一个9*3矩阵内的任意两列;交换任意两个rowsegment或colsegment;对数独内的数字进行置换。每种操作都可以使用多次,要求我们判断那个未完成数独在完成之后是否可以变成上面所给出的目标数独。思路分
Cleara8812
·
2020-09-13 18:03
Codeforces
Round #666 (Div. 2) D. Stoned Game(博弈论)
题目链接思路:如果最大值超过其他所有值则先手赢,当石子总数为偶数时后手赢否则先手赢,因为相当于每一轮都要拿走两个。代码:#include#defineintlonglong#defineIOSios::sync_with_stdio(false);cin.tie(0);cout.tie(0);constintN=1e5+9;constintM=1e4+5;constdoubleeps=1e-8;c
ACkingdom
·
2020-09-13 18:51
思维
Codeforces
Gym-101291G Gravity
http://
codeforces
.com/gym/101291/attachmentsGravityYouwouldliketoimplementasimplesimulationofgravityona2
SDUT_you
·
2020-09-13 18:01
Coffee Break 二分
CoffeeBreak二分Timelimit:1000msMemorylimit:262144kBSource:
Codeforces
Round#509(Div.2)Tags:binarysearchdatastructuresgreedytwopointers
Dream Flying Eagle
·
2020-09-13 18:23
二分
Codeforces
1041C(贪心+set)
传送门题面:C.CoffeeBreaktimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputRecentlyMonocarpgotajob.Hisworkingdaylastsexactlymminutes.Duringwork,Monocarpwantstodrink
weixin_30663391
·
2020-09-13 18:08
Codeforces
Round #509 (Div. 2) - C - Coffee Break(Set 二分)
Codeforces
Round#509(Div.2)-C-CoffeeBreak题意:有n个不同的休息时间,每天工作时间为m,任意两个休息点之间至少要隔d个时间,求最少工作天数,使得n个休息时间都休息了
vloai
·
2020-09-13 18:34
二分
Codeforces
STL
暑假训练day1 : 2016 USP-ICMC
传送门:http://
codeforces
.com/gym/101063https://vjudge.net/contest/169377#overviewA.GiantSnailMazetimelimitpertest3secondsmemorylimitpertest512megabytesinputstandardinputoutputstandardoutputItist
VampireWeekend
·
2020-09-13 18:48
日常训练
数论
Jumping on Walls(
codeforces
)
题目:Vasyaplaysacomputergamewithninjas.AtthisstageVasya’sninjashouldgetoutofadeepcanyon.Thecanyonconsistsoftwoverticalparallelwalls,theirheightisnmeters.Let’simaginethatwesplitthesewallsinto1meter-longa
寻找秀儿
·
2020-09-13 18:44
DFS
Codeforces
Round #135 (Div. 2)-C. Color Stripe
Codeforces
Round#135(Div.2)-C.ColorStripe链接:http://
codeforces
.com/group/xrTA2IaQje/contest/249069/problem
寻找秀儿
·
2020-09-13 18:44
题
【kmp】F - Compress Words (
codeforces
)
题目:timelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAmugaehasasentenceconsistingofnnwords.Hewanttocompressthissentenceintooneword.Amugaedoesn’tlikerepetitions
寻找秀儿
·
2020-09-13 18:44
题
kmp
CodeForces
1140E-Palindrome-less Arrays(回文串+染色DP)
题目:传送门题意:给你一个数组,数组中的-1可以变为1~k的任意数,我们要求不存奇回文串,问我们有多少种选法,答案对998244353取模.思路:要求不存在奇回文串,说明相邻的偶数标号的数不相同(奇数同理).我们不妨用dp[i][j]表示到i时选择第j个数的方案数.则数组{1,-1,-1,3,-1,-1,-1,3},k为4时.奇序列1-1-1-111036201273012740127偶序列-13
JingLuoZZZ
·
2020-09-13 18:12
CF200题计划
DP
CodeForces
1238-E Keyboard Purchase(状压DP)
题目:传送门思路:先预处理出所有的字符的贡献对,例如abcd,则贡献对为(a,b),(b,c),(c,d)均为一个.如果在新建盘中一个字符位置pos,则与其有关的贡献对中,编号比他大的对中就要减去它,即为-pos,反之就是加上它,即为+pos。可以看出我们可以把单个字符的贡献单独放出来算,所以我们考虑直接枚举顺序,每次维护最小值.而状压dp转移的过程中恰好可以将顺序一一枚举Ac_Code:#inc
JingLuoZZZ
·
2020-09-13 18:11
CF200题计划
DP
CodeForces
1249 F Maximum Weight Subset(树形dp))
题目:F.MaximumWeightSubset思路:显然是树形dp没错了,重点在于如何处理和如何转移.我的做法是:dp[i][j]表示距结点i最近为j的点集的最大权重和.每次由叶子结点往父亲节点转移,很明显对于父亲结点u,叶子结点v,dp[u][j]最多只能有一个叶子结点可以为j,其他的节点必须是max(k-j,j),否则会导致选择的点集里面有距离大于k的点对.同时dp[u][j]还可以向dp[
JingLuoZZZ
·
2020-09-13 18:11
CF200题计划
DP
CodeForces
1003 F - Abbreviation(暴力+kmp)
Problem:传送门Solution:直接暴力枚举每个区间,然后kmp找这个区间出现的次数.Ac_Code:#include#include#include#include#include#include#include#include#include#include#definefirfirst#definesecsecondusingnamespacestd;maps;intcnt,n;in
JingLuoZZZ
·
2020-09-13 18:11
CF200题计划
CodeForces
1238 F The Maximum Subtree(树形dp)
题目:传送门思路:分析题意会发现,每个所选择的点只能有两条分支长度大于2,其他长度只能为1.我们考虑树形dp,对于每个节点我们先考虑他和他的两个儿子分支构成的结果,在更新其分支的最大值,向上传递Ac_Code:#include#include#include#include#include#include#include#include#include#include#definefirfirst
JingLuoZZZ
·
2020-09-13 18:11
DP
CF200题计划
GYM 2019 USP-ICMC A、B、C、D、E、F、H、J
题目链接https://
codeforces
.com/gym/102302A单调栈水题#includeusingnamespacestd;constintN=1e5+10;inth[N],n,r[N];
ccsu_deer
·
2020-09-13 18:10
codeforce题解
CodeForces
1238-D AB-string
题目:传送门思路:因为字符串只有A和B两种字符,我们不妨研究一下符合条件的特点.对于一个字符串我们将相同的连续的分为一段,如果分成了三段,则可以构成ABA或者BAB类的回文串,则三段以上都是成立的,如果分成了两段,如果有一段连续的个数为1,则是构不成回文串的,如果只有一个段,很明显个数为1不符合其他均符合.可以发现不符合条件的串的特点很明显,所以我们考虑计算不符合条件的串,然后从总字符串中减去就可
JingLuoZZZ
·
2020-09-13 18:40
CF200题计划
Codeforces
Round #666 (Div. 2)D.Stoned Game【奇偶和博弈 + 制高点】
题目链接上面有题目链接,这个题乍一看是一个很裸的奇偶和博弈:给n个数,先后手轮流取1,那么当总和为奇数,先手为优势局面。题目朴素解法就是求和得出来sum的奇偶性,if(sum%2)先手胜利;但是存在一个制高点问题,博弈论制高点指的是有一个状态的元素为强制优势局面。那么这个题的制高点是什么呢?如果是310022这组数据,先手选第一个堆,那么后手只能选取后面两个,先手继续取第一个堆。如此一来先手永远处
DevourPower
·
2020-09-13 17:58
Div题解
博弈论
Codeforces
Gym101063 F.Bandejao (2016 USP-ICMC)
F.BandejaoItislunchtimeonMars!Everyonehasgotthatbigsmileontheirfaces,alleagertoseewhattheGEMArestaurantisservingfordessert.EverythingisprettymuchlikeEarth,butnobodyknowswhy,GEMAdecidedtoinventnewtypes
weixin_30415113
·
2020-09-13 17:17
Jumping Buildings(
codeforces
)
题目:BobisdevelopinganewgamecalledjumpingLario.Inthisgamethemainprotagonist,Lario,hastojumpontopofbuildingsuntilhereachestheendofthelevel.TheleveliscomposedofNbuildingsofpossiblydifferentheights.Thebuil
寻找秀儿
·
2020-09-13 17:44
单调栈
【
CodeForces
-1041C】Coffee Break(贪心,STL,set二分维护,题意难,有坑,SJ题,构造)(知识点总结)
题干:RecentlyMonocarpgotajob.Hisworkingdaylastsexactlymmminutes.Duringwork,Monocarpwantstodrinkcoffeeatcertainmoments:therearennminutesa1,a2,…,ana1,a2,…,an,whenheisableandwillingtotakeacoffeebreak(forth
韬光养晦_
·
2020-09-13 17:13
Codeforce~
STL
二分
知识点
贪心
codeforces
392A Blocked Points 枚举
题意很繁琐..转化过来基本就是在平面上给一个半径为n的圆,求圆内有多少个点和圆外至少一个点的欧几里得距离恰好为1。想一下会发现四个象限其实是对称的,求一个象限的解*4就行,对一个象限内的点,发现一个象限内也可以分成两半,所以就是枚举出来1/8个圆的点就可以了...以第一象限为例的话,枚举的结束条件就是x>y。#include#include#includeusingnamespacestd;typ
NightRaven
·
2020-09-13 17:47
杂题
codeforces
codeforces
392B Tower of Hanoi 记忆化搜索
汉诺塔问题的变形,给出每个柱子到另一个柱子移动的花费,求最小花费使得n个盘从最左侧移动到最右侧。汉诺塔问题的移动方案其实就两种,第一种:n-1个盘子从1通过3移动到2,最下面的从1移动到3,n-1个盘子从2通过1移动到3.第二种:n-1个盘子从1通过2移动到3,最下面的从1移动到2,n-1个盘子从3通过2移动到1,最下面的从2移动到3,n-1个盘子从1通过2移动到3.实际就是最下面盘子的两种移动方
NightRaven
·
2020-09-13 17:47
动态规划
dp
codeforces
Codeforces
Round #230 (Div. 2) D - Tower of Hanoi
题目链接:http://
codeforces
.com/contest/393/problem/D大致题意:汉罗塔问题的变形,给三个柱子,对于每一次移动都会给出一个消耗cost,问将所有盘子从1号柱子移到
i-o07
·
2020-09-13 16:46
Codeforces
Solutions
codeforces
392 B. Tower of Hanoi(汉诺塔 DP)
题目链接:http://
codeforces
.com/contest/392/problem/BB.TowerofHanoitimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheTowerofHanoiisawell-knownmathematicalpuzzle
田益铭
·
2020-09-13 16:06
动态规划
dp
CodeForces
Codeforces
Beta Round #1
做了好久感觉做的有点蠢题目总体难度不高吧应该因为考虑的不周WA了两次题目传送门:http://
codeforces
.com/contest/1A.TheatreSquaretimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheatreSquareinthecapit
auguralpha
·
2020-09-13 16:01
codeforces
Codeforces
Beta Round #2
codeforces
2A.Winner
codeforces
2B.Theleastroundway
codeforces
2C.Commentatorproblem这期题目想对感觉较难A敲了十多分钟B是想了很久才开始写的中间
auguralpha
·
2020-09-13 16:01
codeforces
【索引】
CodeForces
Round #230 (Div. 2)
ProblemA:Nineteen(393A)ProblemB:Threematrices(393B)ProblemC:BlockedPoints(392A)ProblemD:TowerofHanoi(392B)ProblemE:YetAnotherNumberSequence(392C)
JeraKrs
·
2020-09-13 16:16
索引
Codeforces
392A Blocked Points(暴力)
题目链接:
Codeforces
392ABlockedPoints题目大意:给出一个n,然后距离原点距离小于n的都为积分点,其他都为非积分点,现在要求阻塞尽量少得积分点,使得没有一个积分点可以连接到非积分点
JeraKrs
·
2020-09-13 16:16
CF
GRADE:C
搜索-暴力搜索
Codeforces
Round #230 (Div. 2)
Problems#NameANineteenstandardinput/output1s,256MBx1710BThreematricesstandardinput/output1s,256MBx1806CBlockedPointsstandardinput/output2s,256MBx418DTowerofHanoistandardinput/output1s,256MBx147EYetAno
lab104_yifan
·
2020-09-13 16:15
Tower of Hanoi
CodeForces
392B
B.TowerofHanoitimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheTowerofHanoiisawell-knownmathematicalpuzzle.Itconsistsofthreerods,andanumberofdisksofdiffere
neuike
·
2020-09-13 16:32
模拟
搜索
Codeforces
Global Round 1 G. Tree-Tac-Toe 题解
Codeforces
GlobalRound1G.Tree-Tac-Toe题解题目链接在这里。题目大意有一棵树上面有nnn个结点,其中有些结点已经有了颜色(白色),有些还没有。
2020linweitong
·
2020-09-13 15:40
博弈论
题解
树
code forces 392A Blocked Points
codeforces
392ABlockedPoints题目链接:http://
codeforces
.com/problemset/problem/392/A题目大意:这个题题意挺绕的,不过多看两眼也能明白
slicer
·
2020-09-13 15:07
几何
Codeforces
Round #230 (Div. 1) B. Tower of Hanoi 记忆化搜索
B.TowerofHanoitimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheTowerofHanoiisawell-knownmathematicalpuzzle.Itconsistsofthreerods,andanumberofdisksofdiffere
cokomowang
·
2020-09-13 15:57
dp
Tower of Hanoi
CodeForces
- 392B(dfs——记忆化搜索)
TowerofHanoi题目链接:
CodeForces
-392B题意:在经典的汉诺塔的基础上进行了改造,不是问最少移动次数,而是问最少移动代价;从i柱移动到j柱的代价是t[i][j],求最少移动代价;思路
LBJHan
·
2020-09-13 15:15
递归
怒刷DP
Codeforces
Round #230 (Div. 2
连涨六次RATING居然还是不够紫T_T,不过确实分数不够(明明每次差一点!!!)A.Nineteen水题,统计每个字母出现次数,然后ans--验证不知道哪还有BUG还是有人FST#include#include#include#include#include#include#include#include#include#include#include#include#include#inclu
August_AC
·
2020-09-13 15:53
CF
Codeforces
392B Tower of Hanoi
B.TowerofHanoitimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheTowerofHanoiisawell-knownmathematicalpuzzle.Itconsistsofthreerods,andanumberofdisksofdiffere
ACM2272902662
·
2020-09-13 14:17
Codeforces
Codeforces
Round #230 (Div. 2) C. Blocked Points D. Tower of Hanoi
C.BlockedPoints题意:A点和B点是4-connected,的条件是theEuclideandistancebetweenAandBisoneunitandneitherAnorBisblocked;orthereissomeintegralpointC,suchthatAis4-connectedwithC,andCis4-connectedwithB.这段描述类似递归的意思,就是A
ACM_Napoleon
·
2020-09-13 14:56
Codeforces
Codeforces
_392B_Tower of Hanoi(记忆化搜索)
B.TowerofHanoitimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheTowerofHanoiisawell-knownmathematicalpuzzle.Itconsistsofthreerods,andanumberofdisksofdiffere
light_starlight
·
2020-09-13 14:55
ACM
Codeforces
Round #230 (Div. 1) B. Tower of Hanoi
B.TowerofHanoitimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheTowerofHanoiisawell-knownmathematicalpuzzle.Itconsistsofthreerods,andanumberofdisksofdiffere
utobe67
·
2020-09-13 14:23
dp
Codeforces
Round #230 (Div. 2) D. Tower of Hanoi (加强版汉诺塔,DP)
这题一开始碰到简直蒙了,完全不造从何做起呢,后来学长让我欣赏了大白P26页那个汉诺塔,于是我有了一定的思路。这题是个很漂亮的DP,状态转移方程太复杂了懒得写了,不过看代码也可以看懂哦。#include#include#include#include#include#include#include#include#include#include#include#include#include#inc
Miracle_ma
·
2020-09-13 14:04
CodeForces
589J ——2015-2016 ACM-ICPC, NEERC, Southern Subregional Contest
J-CleanerRobotTimeLimit:2000MSMemoryLimit:524288KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForces
589JDescriptionMashahasrecentlyboughtacleanerrobot
猿的进化之路
·
2020-09-13 14:49
-------搜索
cf(448c)-painting fence
这是一道面试题,同时是
codeforces
上的c类题目。tags:divideandconquer,dp,greedy解决思路首先明确先需要明确每次只可能存在两种刷法,要么横着一笔,要么竖着一笔。
linjiet
·
2020-09-13 12:03
算法
CodeForces
878 简要题解
A.ShortProgram起床困难综合征,随便构造一下就好了。#include#definexxfirst#defineyysecond#definempmake_pair#definepbpush_back#definemset(x,y)memset(x,y,sizeofx)#definemcpy(x,y)memcpy(x,y,sizeofx)usingnamespacestd;typedef
wxh010910
·
2020-09-13 07:51
CodeForces
- 878D 递归(搜索)
开始有k个生物,有n个属性支持3种操作:1.将两个生物合并成一个新的生物,所有属性值为原来的较大值2.将两个生物合并成一个新的生物,所有属性值为原来的较小值3.询问i生物的第j个属性值n#include#include#include#include#include#include#definelllonglong#defineinf0x3f3f3f3f#defineN100010usingnam
weixin_44705665
·
2020-09-13 06:21
递归
上一页
63
64
65
66
67
68
69
70
下一页
按字母分类:
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
其他