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
codeforce
集训队每周一赛 2020-04-02(思维/模拟+贪心+二分)
第六次周赛A金龙小学的口语考试
CodeForce
s1185C1题解B黄牌警告
CodeForce
s1215A题解C分糖果
CodeForce
s678C题解D密文
CodeForce
s1215C题解E新的运算
CodeForce
s1328C
带你看宇宙
·
2020-08-11 02:03
比赛
Codeforce
s Round #646 (Div. 2)B.Subsequence Hate(贪心)---题目+题解
来源:http://
codeforce
s.com/contest/1363/problem/BShubhamhasabinarystrings.Abinarystringisastringcontainingonlycharacters
xh_Dopamine
·
2020-08-11 02:13
题解
Codeforces
Codeforce
s Round #663 (Div. 2) C. Cyclic Permutations(组合数学)
题目链接思路:减后再增必成环,列出所有情况,然后再减去只先增一次再减一次的情况和只递增和只递减的情况即可。代码:#include#defineintlonglong#defineIOSios::sync_with_stdio(false);cin.tie(0);cout.tie(0);constintmod=1e9+7;constintN=1e6+5;usingnamespacestd;intqu
ACkingdom
·
2020-08-11 02:45
思维
组合数学
Codeforce
s Round #661 (Div. 3) D. Binary String To Subsequences(思维,字符串)
题目链接题意:给你一个01字符串,你能将他分为至少多少个相邻数字不同的子字符串,输出个数和每一个位置的字符属于哪个子串。思路:每次记录都从一段连续的0或1开始,a数组记录子串编号,b数组记录编号子串结尾为0还是1,对于每一段连续的0或1,都从编号为1的子串开始遍历,根据b数组判断最后一位的数字看他能否成为该编号子串的最后一位,如果可以就将a[i]变为该编号并改变b数组中该编号子串的结尾数字。代码:
ACkingdom
·
2020-08-11 02:45
思维
字符串
Codeforce
s Round #663 (Div. 2) A. Suborrays
题目链接思路:倒序输出n-1即可。代码:#include#defineintlonglong#defineIOSios::sync_with_stdio(false);cin.tie(0);cout.tie(0);constintN=1e5+3;constintM=2e4+5;constdoubleeps=1e-8;constintmod=998244353;constintinf=0x7ffff
ACkingdom
·
2020-08-11 02:45
思维
Codeforce
s Round #663 (Div. 2) B. Fix You
题目链接思路:将每一行最后一个变成D,最后一行全部变成R即可。代码:#include#defineintlonglong#defineIOSios::sync_with_stdio(false);cin.tie(0);cout.tie(0);constintN=1e5+3;constintM=2e4+5;constdoubleeps=1e-8;constintmod=998244353;const
ACkingdom
·
2020-08-11 02:45
思维
【高维前缀和+容斥】
Codeforce
s449D[Jzzhu and Numbers]题解
题目概述有n个数ai,求选出若干个数(不可不选)and起来为0的方案数。解题报告把每个数在二进制下的01序列看作集合,那么题目转化为选出一些集合交集为空的方案数。然后……完全不会做啊……然后考虑容斥,令f(i)表示包含集合i的数的个数,S(i)表示集合i的元素个数,考虑容斥,那么答案就是∑220−1i=0(−1)S(i)×(2f(i)−1)。问题是f(i)怎么求,有个高维前缀和的高端玩意可以使用。
ZigZagK
·
2020-08-11 02:26
Codeforces题解
容斥原理
codeforce
s 1090B切题记录
写在前面:说实话我做这道题目的时候异常的蒙逼,那个傻逼大佬出的,TMD是pdf格式就算了,你大爷连提交地方或者测试数据都没有,怎么判断程序是否正确啊!!!所以如果有大佬拥有测试数据或者提交方法请在下方评论区联系我,万分感谢。题目原文:(鉴于CSDN没有上传附件的功能,再次提供文件链接,有需要者自行下载)下载链接复制版:Examplesstandardinput:Themostfamouschara
zizi0092011
·
2020-08-11 02:09
CF比赛切题报告
codeforce
s 300B切题记录
题目地址Aprogrammingcoachhasnstudentstoteach.Weknowthatnisdivisibleby3.Let’sassumethatallstudentsarenumberedfrom1ton,inclusive.Beforetheuniversityprogrammingchampionshipthecoachwantstosplitallstudentsinto
zizi0092011
·
2020-08-11 02:38
codeforce
s1077C思维题
C.GoodArraytimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputLet'scallanarraygoodifthereisanelementinthearraythatequalstothesumofallotherelements.Forexample,th
零千
·
2020-08-11 01:23
思维题
暴力
Codeforce
s 1080 - 全解
单个题目的链接
Codeforce
s1080A-PetyaandOrigami
Codeforce
s1080B-Margariteandthebestpresent
Codeforce
s1080C-Mashaandtwofriends
Codeforce
s1080D-Olyaandmagicalsquare
Codeforce
s1080E-SonyaandMatrixBeauty
Codeforce
s1080
LucienShui
·
2020-08-11 01:42
ACM
题解
Codeforces
Codeforce
s 1084D - The Fair Nut and the Best Path - 树形DP
Codeforce
s1084A-TheFairNutandtheBestPath-树形DP题解链接https://lucien.ink题目链接https://
codeforce
s.com/contest
LucienShui
·
2020-08-11 01:42
ACM
题解
Codeforces
动态规划
Codeforce
s 842C - Ilya And The Tree - 树形DP或DFS
链接: http://
codeforce
s.com/contest/842/problem/C题目:Ilyaisveryfondofgraphs,especiallytrees.DuringhislasttriptotheforestIlyafoundaveryinterestingtreerootedatvertex1
LucienShui
·
2020-08-11 01:41
Codeforces
题解
思维
数据结构-树
Codeforce
s 1080E - Sonya and Matrix Beauty - Manacher
Codeforce
s1080E-SonyaandMatrixBeauty-Manacher题解链接https://lucien.ink题目链接https://
codeforce
s.com/contest
LucienShui
·
2020-08-11 01:41
Codeforces
ACM
题解
Mabacher
字符串
codeforce
s 1250B The Feast and the Bus 枚举+贪心
http://
codeforce
s.com/problemset/problem/1250/BEmployeesofJebTrainsareontheirwaytocelebratethe256-thdayoftheyear
csu_xiji
·
2020-08-11 01:26
暴力
贪心
比赛补题
第四次练习6.1
A-DreamoonandRankingCollectionDreamoonisabigfanofthe
Codeforce
scontests.Oneday,heclaimedthathewillcollectalltheplacesfrom11to5454aftertwomoreratedcontests.It
xiaoxu778
·
2020-08-11 01:45
D. The Fair Nut and the Best Path(树形dp)
D.TheFairNutandtheBestPathhttp://
codeforce
s.com/contest/1084/problem/Dtimelimitpertest3secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheFairNutisgoingtotraveltotheTreeCoun
sdau_blue
·
2020-08-11 01:54
DP_树形dp
(
CodeForce
s - 607B)Zuma
(
CodeForce
s-607B)Zumatimelimitpertest:2secondsmemorylimitpertest:512megabytesinput:standardinputoutput
Hold_My_Own
·
2020-08-11 01:58
区间dp
codeforces
Codeforce
s 1080C. Masha and two friends
给你一个n行m列的黑白块相间的棋盘,进行两次操作,第一次把(x1,y1)到(x2,y2)的区域全部涂白,第二次把(x3,y3)到(x4,y4)的区域全部涂黑,问你这样以后黑白各有多少块?观察黑白块的分布我们可以得知从(a,b)到(c,d)的白、黑色块数量分别是(c-a+1)(d-b+1)/2+(a+b+1)%2和(c-a+1)(d-b+1)/2+(a+b)%2,所以我们可分别计算除两次操作区间的黑
winhcc
·
2020-08-11 00:03
Codeforce
s 1080B. Margarite and the best present
我们先计算从l到r共有多少个数,如果是偶数个,那么答案就是flag*(r-l+1)/2,flag为1或-1,取决于l的奇偶性;如果是奇数个,就把第一个数拿出来单独考虑,后面的就又是偶数个了。#includeusingnamespacestd;intq,l,r,num,m;intmain(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);//f
winhcc
·
2020-08-11 00:03
Sasha and Array
CodeForce
s - 719E 线段树维护矩阵+矩阵快速幂
Sashahasanarrayofintegersa1, a2, ..., an.Youhavetoperformmqueries.Theremightbequeriesoftwotypes:1lrx—increaseallintegersonthesegmentfromltorbyvaluesx;2lr—find,wheref(x)isthex-thFibonaccinumber.Asthisn
隔阂0323
·
2020-08-11 00:29
线段树
Kefa and Park
CodeForce
s - 580C
Kefadecidedtocelebratehisfirstbigsalarybygoingtotherestaurant.Helivesbyanunusualpark.Theparkisarootedtreeconsistingofnverticeswiththerootatvertex1.Vertex1alsocontainsKefa'shouse.Unfortunaelyforourhero
隔阂0323
·
2020-08-11 00:28
图
2020.7.3上午训练
芜湖~起飞A-PhoenixandBalance
CodeForce
s-1348A分析代码B-PhoenixandBeauty
CodeForce
s-1348B分析代码C-PhoenixandDistribution
CodeForce
s
一脸呆滞
·
2020-08-11 00:57
题解
Prefix Sum Primes——
Codeforce
s
timelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputWe’regivingawaynicehugebagscontainingnumbertiles!Abagwewanttopresenttoyoucontainsntiles.Eachofthemhasasinglen
GUESSERR
·
2020-08-11 00:25
Codeforces
Codeforce
s Round #661 (Div. 3) D E1
目录D.BinaryStringToSubsequencesE1.WeightsDivision(easyversion)D.BinaryStringToSubsequencestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenabinarys
san lolo
·
2020-08-11 00:46
STL
[
Codeforce
s Round #661 (Div. 3)] E1.Weights Division (easy version)
题目链接:E1.WeightsDivision(easyversion)可能这几天没练基础思维题导致前面签到题打得慢,关键均题WA1发,又关键有两道题败在输入输出上,很不应该,后面等牛客完了,补补cf的题,提升一下自己的代码能力。题意题意是给你n个节点带边权的树,给你一个数S,你可以选一些边然后将其权值变为其一半向下取整,然后问你最少进行多少次操作使得从根节点到所有叶结点的权值之和小于等于S。题解
张小生的先生
·
2020-08-11 00:45
贪心
DFS搜索
Codeforce
s Round #654 (Div. 2) A-D 题解
A、OmkarandCompletionhttps://
codeforce
s.com/problemset/problem/1372/A题意:题目给出一个数n,要求输出一个n长度的数组(范围[1,1000
化身孤岛的鲸o
·
2020-08-11 00:07
codeforces
第三次周赛D - Problem D
CodeForce
s - 369A
Valeraisalazystudent.Hehasmcleanbowlsandkcleanplates.Valerahasmadeaneatingplanforthenextndays.AsValeraislazy,hewilleatexactlyonedishperday.Atthat,inordertoeatadish,heneedsexactlyonecleanplateorbowl.We
Elenaaab
·
2020-08-11 00:57
GZHU18级第三次周赛——白银等级 A - Problem A
CodeForce
s - 439A
*Timelimit:1000msMemorylimit:262144kBSource:
Codeforce
sRound#251(Div.2)Tags:greedyimplementation1100Editorial
辣条。
·
2020-08-11 00:54
ACM第三次周赛
Codeforce
s 165E Compatible Numbers
CompatibleNumbersTimeLimit:4sMemoryLimit:256MBProblemDescriptionTwointegersxxxandyyyarecompatible,iftheresultoftheirbitwise“AND”equalszero,thatis,aaa&bbb = 0.Forexample,numbers90(10110102)90(1011010_2
月凉小朋友
·
2020-08-11 00:52
组队赛题解
acm
Game on a Tree(博弈+树形dp)
题目链接:http://
codeforce
s.com/gym/102392/problem/F参考题解:http://
codeforce
s.com/gym/102392/problem/F题意:给定一棵根结点为的树
罗gkv
·
2020-08-11 00:46
Codeforces
个人训练
Codeforce
s 607 B-Zuma 【区间DP】
题目来源:https://
codeforce
s.com/problemset/problem/607/B★打牌憨憨开始写区间DP啦~翻译:有n个点按顺序排成一行,你现在要消去所有的点。
HungTeen
·
2020-08-11 00:08
动态规划
Educational
Codeforce
s Round 36 (Rated for Div. 2) E. Physical Education Lessons (动态开点线段树)
E.PhysicalEducationLessonstimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputThisyearAlexhasfinishedschool,andnowheisafirst-yearstudentofBerlandStateUniversity.
东野圭吾#
·
2020-08-11 00:59
Codeforces
线段树
Codeforce
s Round #660 (Div. 2) A~D
A.CaptainFlintandCrewRecruitmenttimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputDespitehisbadreputation,CaptainFlintisafriendlyperson(atleast,friendlytoanima
东野圭吾#
·
2020-08-11 00:59
Codeforces
Codeforce
s - Zuma
题目链接:
Codeforce
s-Zuma对于区间[l,r]如果两端的相等,那么可以直接变为区间[l+1,r-1]否则我们可以枚举区间的划分方案。
青烟绕指柔!
·
2020-08-11 00:25
Codeforces
区间dp
动态规划
Prefix Sum Primes
CodeForce
s - 1150C(思维)
We’regivingawaynicehugebagscontainingnumbertiles!Abagwewanttopresenttoyoucontainsnntiles.Eachofthemhasasinglenumberwrittenonit—either11or22.However,thereisoneconditionyoumustfulfillinordertoreceivethe
林尛尛
·
2020-08-11 00:54
思维
Codeforce
s Round #629 (Div. 3) E. Tree Queries
http://
codeforce
s.com/contest/1328/problem/E题意:一棵树,有m个询问,每次询问询问k个点是否都在一条从根节点(点1)到某个节点v的路径上,或者距离这条路径的距离为
forOnward
·
2020-08-11 00:06
cf与各算法比赛
codeforce
s 1084 D. The Fair Nut and the Best Path(树形dp)
题目点这里题目大意:每个点有权值,每个边也有权值,找到一条路径使得点权和减去边权和最大,答案也可以只为一个点,输出答案思路:树形dpdp记录该点到子节点的最大值ans记录答案得到答案更新和转移方程;这里要先更新ans,因为要在使用to节点更新该节点之前更新ans转移方程可以理解为to节点更新后和以前最大的取最大值ans=max(ans,dp[u]-now.se+dp[to]);dp[u]=max(
- Passerby ゛
·
2020-08-11 00:46
dp
2019 ACM训练计划——( 每天5题 ) 训练计划18【循环数列 + 模拟】
A
Codeforce
sRound#273(Div.2),problem:©TableDecorations题目大意有红绿蓝三种颜色,然后要每张桌子上颜色不能完全相同,求满足这样条件的最大桌子数题解先对颜色数目进行从小到大排序
一百个Chocolate
·
2020-08-11 00:29
Codeforces✍
第二届“传智杯”全国大学生IT技能大赛(初赛) 解题报告
整体评价:比较简单的一套题,前三道题大致相当于
Codeforce
sdiv2的T1、T2难度,第四题在div1的T1、T2难度之间。
Forward_Star
·
2020-08-10 23:15
随笔
Codeforce
s DP 练习
Codeforce
s466C.NumberofWays【前缀】C.NumberofWaystimelimitpertest:2secondsmemorylimitpertest:256megabytesinput
Whowell
·
2020-08-10 23:13
codeforces
动态规划
贪心
CodeForce
s 632B Alice, Bob, Two Teams
参考链接https://blog.csdn.net/WYK1823376647/article/details/52279846题意:有n个物品,每个物品有一个分值,然后每个物品有一个标牌,如果标牌上是A,那么就属于A,是B,那么就属于B。现在你可以选择一个前缀或者后缀,然后将上面的A改成B,将B改成A,然后问你最多B能够得到多少思路:分别记录前缀和..题意:给定n个数和一个字符串,每个数对应一个
luxxxxxxx_
·
2020-08-10 23:08
水题
CodeForce
s580C Kefa and Park 【dfs vector】
C.KefaandParktimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputKefadecidedtocelebratehisfirstbigsalarybygoingtotherestaurant.Helivesbyanunusualpark.Theparkisa
肖火柴
·
2020-08-10 23:24
Codeforce
s Round #335 (Div. 2) A. Magic Spheres 水题
A.MagicSpheresTimeLimit:20SecMemoryLimit:256MB题目连接http://www.
codeforce
s.com/contest/606/problem/ADescriptionCarlisabeginnermagician.Hehasablue
weixin_34242509
·
2020-08-10 23:20
Alice, Bob, Oranges and Apples
CodeForce
s - 586E
E-Alice,Bob,OrangesandApples
CodeForce
s-586E自己想的时候模拟了一下各个结果感觉是不是会跟橘子苹果之间的比例有什么关系搜题解的时候发现了Stern-Brocottree
weixin_30888413
·
2020-08-10 23:02
[CF430B] Balls Game(暴力,模拟)
题目链接:http://
codeforce
s.com/contest/430/problem/B题意:祖玛,消除游戏。给你一个颜色,问你往现有的串里插,最多消除多少个。
weixin_30696427
·
2020-08-10 23:28
codeforce
s 607B. Zuma
GenosrecentlyinstalledthegameZumaonhisphone.InZumathereexistsalineofngemstones,thei-thofwhichhascolorci.Thegoalofthegameistodestroyallthegemstonesinthelineasquicklyaspossible.Inonesecond,Genosisableto
weixin_30696427
·
2020-08-10 23:57
codeforce
1175E Minimal Segment Cover ST表 倍增思想
这题太巧妙了。题意是,给定2*10^5个区间。然后2*10^5组询问,每次询问一个区间,问至少需要几个给定区间,才能将其完全覆盖。坐标范围5*10^5。如果只有一个询问区间,是经典的贪心问题。我们每次选择,尽可能覆盖的靠右的区间。但是这题显然贪心的话,时间是不够的。考虑使用倍增进行预处理。我们用dp[i][o]表示从i点开始,选择o个区间,能覆盖到最远哪个点。为-1,则表示不存在。那么显然如果dp
weixin_30650859
·
2020-08-10 22:19
BZOJ-4424 &&
CodeForce
s-19E Fairy DP+dfs (Link-Cut-Tree可A)
Va爷的胡策题T2E.Fairytimelimitpertest1.5secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputOnceuponatimetherelivedagoodfairyA.OnedayafineyoungmanBcametoherandaskedtopredicthisfuture
weixin_30412013
·
2020-08-10 22:07
CodeForce
s 492A Vanya and Cubes
Vanyagotncubes.Hedecidedtobuildapyramidfromthem.Vanyawantstobuildthepyramidasfollows:thetoplevelofthepyramidmustconsistof1cube,thesecondlevelmustconsistof1 + 2 = 3cubes,thethirdlevelmusthave1 + 2 + 3
wb129945130
·
2020-08-10 22:26
ACM
上一页
142
143
144
145
146
147
148
149
下一页
按字母分类:
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
其他