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 #118 - Mushroom Scientists
咩哈哈~~Round#118水得只剩防爆的E题了..这题A得很神奇...俺只是做了个猜测..写了如下无比猥琐丑陋的代码..居然真给AC了...我就是一位一位的确定..大致上是可行的..随着精确位的深入..答案会越来越优...但我发现这样非常不严谨很容易会出错..那么我就在确定一位时给其更长的尝试范围(如当前要确定0.1上的数..按常规思维..尝试0.0~0.9..而我的尝试是从-5.1~5.1..
kk303
·
2020-09-15 21:09
搜索
Codeforces
138C Mushroom Gnomes - 2 线段树
MushroomGnomes-2感觉没啥东西,用线段树算算每个被覆盖的概率,坑点是有很多个在同一个点。#include#defineLLlonglong#definefifirst#definesesecond#definemkmake_pair#definePLLpair#definePLIpair#definePIIpair#defineSZ(x)((int)x.size())#defineu
afd5154
·
2020-09-15 21:03
Codeforces
Round #670 (Div. 2) 题解
A简单的贪心,就直接上代码了:#include#include#include#includeusingnamespacestd;#definemaxn110intT,n,a[maxn],b[maxn];intmain(){scanf("%d",&T);while(T--){scanf("%d",&n);memset(b,0,sizeof(b));for(inti=1;i1)ans+=2,now+
Hypoc_
·
2020-09-15 21:02
比赛
Codeforces
Round #668 (Div. 1) 题解
A容易发现一个结论:每隔kkk位的字符应该是相同的。于是就可以确定这个字符串的一部分。剩下的部分只需要保证字符串前kkk个字符中010101数量相同即可,剩下的?也就确定了,代码如下:#include#include#include#includeusingnamespacestd;#definemaxn300010intT,n,k;chars[maxn];intmain(){scanf("%d"
Hypoc_
·
2020-09-15 21:02
比赛
Educational
Codeforces
Round 95 题解
背景T1出了大锅导致unrated了……最后排名在70左右,如果不算橙名及以上的那些,那就排到第10左右了,小号错失一波上分的好机会QAQ……A算一下需要的总木棍数,然后就能算出交易次数,要注意精度问题,需要用longdouble。代码如下:#include#include#include#includeusingnamespacestd;#definemaxn300010#definelllon
Hypoc_
·
2020-09-15 21:02
比赛
【题解】
Codeforces
Global Round 10 -- F
题目:https://
codeforces
.ml/contest/1392/problem/F题解以下是比较投机取巧的方法!先打个暴力找下规律。
Inquisitor_
·
2020-09-15 21:48
算法
Codeforces
Global Round 10(ABCD题解)
A.OmkarandPassword.题意:给你一个长度为n的数组,你每次可以选择两个相邻的不相等的数把它们变成他俩的和,如[1234],你可以选择2,3。然后把他俩合并成5,原序列变为[154]。问你在进行任意多次操作后,原数组最少剩下几个数。思路:情况1:如果原数组只有一种数,答案是n。情况2:否则答案是1.简单证明:情况一无需证明。情况二:你可以每次选择一个最大的数,让他变得更大,一直下去,
ldu 王跃
·
2020-09-15 21:30
codeforces
CodeForces
60 E.Mushroom Gnomes(矩阵快速幂)
Description给出n个有序的整数ai,前x秒,每秒相邻两个数之间会多一个数,其值为这两个数的和,之后把所有数字排序,最后y秒依旧是两个数之间多一个这两个数的和,问最后得到的所有数字之和Input第一行输入四个整数n,x,y,p,之后输入不减的n个整数ai(1≤n≤106,0≤x,y≤1018,x+y>0,2≤p≤109,0≤ai≤109)Output输出最后的得到的数字之和,结果模p之后输
v5zsq
·
2020-09-15 21:14
Code
Forces
快速幂
Codeforces
Contest Rules
Codeforces
ContestRulesAdmin2012年2月25日
Codeforces
ContestRulesThetextcontainsonlypreliminaryrulesof
Codeforces
contests-somethingsurelywillchange.Inparticular
x314542916
·
2020-09-15 20:29
【其他】
Good Substrings
http://
codeforces
.com/contest/316/problem/G3SAM上DP在某岛的博客上看到的,要义就是一个串的子串必然是该串某个后缀的前缀,所以从表示该状态的子串节点往后走必然会走到那个串的尾节点
gyarenas
·
2020-09-15 19:01
动态规划
串
数据结构
Codeforces
Round #657 (Div. 2)A与B
这场真的是自闭场,第一题卡了一小时,第二题也wa了两发,差点爆零。。。直到最后(其实是现在)都不知道第一题wa点在哪。题意:给你一个字符串,中间有一些问号,你可以随意把这些问号换成小写字母。问最后形成的字符串能不能让abacaba变成它的子串且仅出现一次。分析:其实重点就是只出现一次。我觉得要是不考虑只出现一次倒真的像一道a题。。。由于样本比较小,我们可以直接暴力。对每个位置开始做一次分析,将待分
oj让我卡过一条吧
·
2020-09-15 15:03
算法训练
codeforces
CodeForces
- 254B:Jury Size(思维、模拟)
DiscriptionIn2013,thewritersofBerlandStateUniversityshouldprepareproblemsfornOlympiads.WewillassumethattheOlympiadsarenumberedwithconsecutiveintegersfrom1ton.ForeachOlympiadweknowhowmanymembersoftheju
爱吃老谈酸菜的DV
·
2020-09-15 15:49
解题报告
思维
codeforces
1029 E. Tree with Small Distances(树形dp||贪心)
http://
codeforces
.com/contest/1029/problem/E题意:给出以1位根节点有n个顶点,n-1条边的树,现在要添加边满足,1到所有顶点距离小于2思路:考虑最优的的添加一定是直接与
- Passerby ゛
·
2020-09-15 15:39
dp
贪心
树形dp
Codeforces
Contest 457 C Elections( 三分)
题意:有n个人要投票,第i个人会投给第ai个人。你是第0个人,你需要收买一些人使得最终你的票数比任何人的票数都多。第i个人需要bi块钱去收买。思路:这道题不能使用二分,因为票数与话费不成线性关系。这道题目要运用三分知识点三分学习:https://blog.csdn.net/Littlewhite520/article/details/70144763这道题目可以想到的是钱数会在某个票数的时候的值最
- Passerby ゛
·
2020-09-15 15:39
三分
codeforces
1096 D. Easy Problem(dp)
题目:http://
codeforces
.com/contest/1096/problem/D题意:给你一个字符串,每个字符有权值,问要删除的最小权值使得这个字符串中没有hard思路:可以看作一个动态规划问题
- Passerby ゛
·
2020-09-15 15:38
dp
dp
Codeforces
Round #155 (Div. 2) C YY题目
http://
codeforces
.com/problemset/problem/254/C题意:定义t是s的Anagram,满足条件是:t与s的字符相同。
weixin_34261739
·
2020-09-15 15:28
Codeforces
Round #333 (Div. 2) B. Approximating a Constant Range
B.ApproximatingaConstantRangetimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputWhenXelloswasdoingapracticecourseinuniversity,heoncehadtomeasuretheintensityofa
weixin_34055787
·
2020-09-15 15:48
Codeforces
Round #155 (Div. 2) 总结
最后输出最大值C.Anagram贪心:一个队列存入需要变成的字符,两个数组分别记录需要用来变的字符个数和剩余个数,贪心替换即可D.Rats暴力:神题,先附链接http://
codeforces
.com/
weixin_30295091
·
2020-09-15 15:28
CodeForces
-185A Plant[矩阵快速幂]
Plant题目传送门:
CodeForces
-185ATimeLimit2000msMemorylimit262144kBProblemDescription:Dwarfshaveplantedaveryinterestingplant
Guugle_
·
2020-09-15 14:08
快速幂
快速幂
CodeForces
-895B XK Segments[二分][思维]
XKSegments题目传送门:
CodeForces
-895BTimeLimit1000msMemorylimit262144kBProblemDescription:WhileVasyafinishedeatinghispieceofpizza
Guugle_
·
2020-09-15 14:08
思维
二分
思维
二分
CodeForces
-1243B2 Character Swap (Hard Version)[字符串模拟]
CharacterSwap(HardVersion)题目传送门:
CodeForces
-1243B2TimeLimit1000msMemorylimit262144kBProblemDescription
Guugle_
·
2020-09-15 14:08
字符串
模拟
字符串
模拟
Codeforces
Round #475 Div. 2 A B C D
A-Splits题意将一个正整数拆分成若干个正整数的和,从大到小排下来,与第一个数字相同的数字的个数为这个拆分的权重。问\(n\)的所有拆分的不同权重可能个数。思路全拆成1,然后每次将2个1换成1个2,即每次2的个数增加1。共有1+n/2种。Code#include#defineF(i,a,b)for(inti=(a);i(b);--i)#definedF2(i,a,b)for(inti=(a);
ahu12345678
·
2020-09-15 13:06
Educational
Codeforces
Round 41 A B C D E
A.Tetris题意俄罗斯方块,问能得多少分。思路即求最小值Code#include#defineF(i,a,b)for(inti=(a);i(b);--i)#definedF2(i,a,b)for(inti=(a);i>=(b);--i)usingnamespacestd;typedeflonglongLL;#definemaxn1010intcnt[maxn];intmain(){intn,m
ahu12345678
·
2020-09-15 13:06
Educational
Codeforces
Round 40 A B C D E G
A.DiagonalWalking题意将一个序列中所有的\('RU'\)或者\('UR'\)替换成\('D'\),问最终得到的序列最短长度为多少。思路贪心Code#include#defineF(i,a,b)for(inti=(a);i(b);--i)#definedF2(i,a,b)for(inti=(a);i>=(b);--i)#definemaxn110usingnamespacestd;c
ahu12345678
·
2020-09-15 13:35
Codeforces
950E Data Center Maintenance 强连通分量
题目链接题意有\(n\)个信息中心,每个信息中心都有自己的维护时间\((0\leqt\lth)\),在这个时刻里面的信息不能被获得。每个用户的数据都有两份备份,放在两个相异的信息中心(维护时间也相异)。现要挑选出信息中心的一个尽量小的子集,使得将这个子集的维护时间向后推移一个小时后,不会导致问题(存在一个用户,其数据所在的两个信息中心维护时间相同)。思路强连通分量考虑每个用户的信息存放的两个信息中
ahu12345678
·
2020-09-15 13:35
Codeforces
Round #155 (Div. 2) D-rats
#include#include#include#include#include#includeusingnamespacestd;intn,m,d;chare[1001][1001];intmark[1001][1001],locrat[1001][1001];intdir[4][2]={{1,0},{0,1},{-1,0},{0,-1}};intmain(){freopen("input.tx
knownothing
·
2020-09-15 13:01
bfs
Codeforces
Round #608 (Div. 2)B. Blocks
分析了一波:
CODEFORCES
给这个题的标签是“greedy”“math”,呃,但是我没用什么算法。就找了一下规律。看来需要去看看贪婪算法是会有什么帮助吧。
YGLeeeon
·
2020-09-15 13:24
Code
Forces
数学方法
算法
CodeForces
876D Sorting the Coins
题目链接:http://
codeforces
.com/contest/876/problem/D题意:有n个位置,有n次操作,每次操作在第p[i]位上放上一枚硬币,然后每次放上一枚硬币以后,你要从左往右扫一遍
15zhazhahe
·
2020-09-15 13:02
ACM
OnlineJudge
Codeforces
ACM
模拟
Codeforces
漫漫补题路
CodeForces
862A Mahmoud and Ehab and the MEX
题目链接:http://
codeforces
.com/contest/862/problem/A题意:给你一个大小为n的集合,你现在有添加和删除操作,问你要经过多少操作,才能使得这个集合里,最小的没有出现的元素为
15zhazhahe
·
2020-09-15 13:02
ACM
OnlineJudge
Codeforces
ACM
模拟
Codeforces
漫漫补题路
Codeforces
Round #155 (Div. 2)
A.CardswithNumberstimelimitpertest1secondmemorylimitpertest256megabytesinputinput.txtoutputoutput.txtPetyahasgot2ncards,eachcardcontainssomeinteger.Thenumbersonthecardscanbethesame.Let'sindexallcardsb
hzhyhx1117
·
2020-09-15 13:53
codeforces
Codeforces
Round #131 (Div. 2) A B
A.SystemofEquationstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputFuriklovesmathlessonsverymuch,sohedoesn'tattendthem,unlikeRubik.ButnowFurikwantstogetagoo
hzhyhx1117
·
2020-09-15 13:53
codeforces
output
input
math
integer
parameters
pair
Codeforces
Round #667 (Div. 3) A-B-C
Codeforces
Round#667(Div.3)A.YetAnotherTwoIntegersProblem问题分析:就是简单的暴力枚举从10依次往下扫AC代码:#include#include#include
MaxVen
·
2020-09-15 12:46
CodeForces
ACM
Codeforces
Round #668 (Div. 2)A-C
Codeforces
Round#668(Div.2)A.PermutationForgery问题分析:就是要求找一个新的序列只需要吧整个序列倒着输出就符合要求AC代码:#include#include#
MaxVen
·
2020-09-15 12:45
CodeForces
Codeforces
Round #642 (Div. 3) D.Constructing the Array
Codeforces
Round#642(Div.3)-1353D.ConstructingtheArray问题分析:模拟一个0数列,用优先队列然后把按照两个规则进行出列连续0长度长的优先级高,同长度的开始位置考前优先具体看大佬代码
MaxVen
·
2020-09-15 12:45
CodeForces
Educational
Codeforces
Round 94(A-C)
Educational
Codeforces
Round94(RatedforDiv.2)A.StringSimilarity问题分析:给你了相似规则以及分段规则然后一个数字n,以及2n-1长度的字符串我们按照分段规则会发现分段的数量一定是是
MaxVen
·
2020-09-15 12:45
CodeForces
Educational
Codeforces
Round 95 (Rated for Div. 2)
Poweredby:AB_IN局外人A.BuyingTorches真得好好吐槽一下。样例出错两次,数据出错一次。讲一下我的思路吧。首先先明确至少需要多少个棍。kkk个火炬,至少需要k∗y+kk*y+kk∗y+k个棍棍。其次要想,怎么从111个棍,利用第一条贸易,变成k∗y+kk*y+kk∗y+k个棍。我们可以先通过观察,假设x=12x=12x=12。那么1−>121->121−>1212−>231
AB_IN 局外人
·
2020-09-15 09:59
比赛题解
Python3
python
CodeForces
294C-Shaass and Lights(组合数学)
CodeForces
294C-ShaassandLights题目原址[http://
codeforces
.com/problemset/problem/294/C]题意现在有一行灯,有些是开着的,有些是关着的
Terry: )
·
2020-09-15 09:52
题库
XJOI 3363 树4/
Codeforces
739B Alyona and a tree(树上差分+路径倍增)
D.Alyonaandatreetimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAlyonahasatreewithnvertices.Therootofthetreeisthevertex1.IneachvertexAlyonawroteanpositivein
weixin_30639719
·
2020-09-15 08:10
数据结构与算法
CodeForces
407C 组合数学(详解)
题面:http://
codeforces
.com/problemset/problem/407/C一句话题意:给一个长度为n的序列g,m次操作,每次操作(l,r,k)表示将g[l]~g[r]的每个数g[
weixin_30472035
·
2020-09-15 08:05
数据结构与算法
codeforces
#294(Div 2) A、B、C
题目A:AandBandchess#include#include#include#include#include#include#include#include#defineLLlonglongusingnamespacestd;intmain(){charch;intw=0,b=0;for(inti=1;i>ch;if(ch=='Q')w+=9;elseif(ch=='R')w+=5;else
蘑菇小哲
·
2020-09-15 08:07
Codeforces
Codeforces
739B(树上路径倍增及差分)
比较考验我思维的一道好题。首先,做一遍DFS预处理出t[i][j]和d[i][j]。t[i][j]表示从第i个节点到离他第2^j近的祖先,d[i][j]表示从i开始到t[i][j]的路径上的路径权值总和。在第一次DFS的同时,对节点x进行定位(结果为dist(x,y)usingnamespacestd;#defineREP(i,n)for(inti(0);i=(b);--i)#definefor_
「已注销」
·
2020-09-15 08:38
Codeforces
数据结构
codeforces
294C C. Shaass and Lights(组合数学)
题目链接:
codeforces
题目大意:给出一列灯,初始有一些点亮的灯,每次只能点亮与已经点亮的灯相邻的灯,问点亮所有灯的方案有多少种。
黎辰
·
2020-09-15 08:40
codeforces的数论专题
CodeForces
294C - Shaass and Lights 统计
对于样例3:1234567891011有9个灯要打开...首先处理4前面的...放到9个要打开的任意位置C(9,3)..并且前面几个只有一种操作顺序(从4开始往左)...an=C(9,3)=84再看5~7..此时还剩下9-3=6个空位置..把这三个放进去..C(6,3)..有5,6,7有四种开的顺序:->5->6->7;55->6756#include#include#include#includ
kk303
·
2020-09-15 08:22
思维
Codeforces
294C 组合数学
题意给出一列灯,初始有一些点亮的灯,每次只能点亮与已经点亮的灯相邻的灯,问点亮所有灯的方案有多少种分析转载于:https://www.cnblogs.com/Superwalker/p/8644327.html
auiayo82822
·
2020-09-15 07:25
CodeForces
294 C.Shaass and Lights(组合数学)
Description给出一排灯,用01表示灯的开关状态,0表示灯关,1表示灯亮,每次可以打开之前是关闭状态的且其旁边有打开状态灯的灯,问有多少种方案可以把所有灯打开Input第一行两个整数n,m表示灯的数量和打开灯的数量,之后输入m个整数表示这m个开着灯的位置(1≤n≤1000,1≤m≤n)Output输出方案数,结果模109+7SampleInput311SampleOutput1Soluti
v5zsq
·
2020-09-15 07:50
Code
Forces
组合数学
Codeforces
Round #483 (Div. 2) B. Minesweeper
B.Minesweepertimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputOnedayAlexdecidedtorememberchildhoodwhencomputerswerenottoopowerfulandlotsofpeopleplayedonlydefa
wym_king
·
2020-09-15 05:15
acm入门
CF984B Minesweeper
原题链接:http://
codeforces
.com/contest/984/problem/BMinesweeperOnedayAlexdecidedtorememberchildhoodwhencomputerswerenottoopowerfulandlotsofpeopleplayedonlydefaultgames.AlexenjoyedplayingMinesweeperthattim
ShadyPi
·
2020-09-15 04:53
模拟
杂============
2019-2020 ACM-ICPC Brazil Subregional Programming Contest 题解
题目链接:http://
codeforces
.com/gym/102346A.Artwork将相交的圆用并查集合并,最后查询一下是否有一个或者两个在一个并查集里面的圆形成这样的一个封闭#include#
a1214034447
·
2020-09-15 03:00
二分系列
数论
数据结构
E. Egor in the Republic of Dagestan(DAG最短路+dp)详解
https://
codeforces
.com/contest/1407/problem/E题意:给一个有向图,每条边有一个类型(0或者1),什么类型的城市就只能走什么类型的边,你需要给每个城市指定类型(
小菜鸡加油
·
2020-09-15 03:45
线性dp
最短路
Codeforces
25 C. Roads in Berland(floyd插点)
题意:给定n个点的带权无向图,保证图联通接下来q次操作,每次操作给出一条边,在原图中加入这条边,然后问图中所有点对的最短路径和是多少数据范围:n,kusingnamespacestd;#defineintlonglongconstintmaxm=305;intd[maxm][maxm];signedmain(){intn;cin>>n;for(inti=1;i>d[i][j];}}intq;cin
这有点难啊
·
2020-09-15 03:42
上一页
50
51
52
53
54
55
56
57
下一页
按字母分类:
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
其他