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
D - Shortest Cycle
CodeForce
s - 1206D (floyed最小环)
题意:找到最小的可以形成回路的环,如果两者有边则&操作不为0;分析:我们可以想一下&操作不为1即2进制位有相同位aiusingnamespacestd;#definelllonglongconstintINF=0x3f3f3f3f;constintmaxm=120;constintmaxn=1e5+50;intn,d,t;lla[maxn];intg[maxm+10][maxm+10],dis[m
fighting_yifeng
·
2020-08-15 14:32
codeforce
s 977F Consecutive Subsequence
题目Youaregivenanintegerarrayoflengthn.Youhavetochoosesomesubsequenceofthisarrayofmaximumlengthsuchthatthissubsequenceformsaincreasingsequenceofconsecutiveintegers.Inotherwordstherequiredsequenceshouldb
Int32ToByte
·
2020-08-15 14:32
acm
codeforces
codeforce
s 914 D Bash and a Tough Math Puzzle
DescriptionBashlikesplayingwitharrays.Hehasanarraya1, a2, …anofnintegers.Helikestoguessthegreatestcommondivisor(gcd)ofdifferentsegmentsofthearray.Ofcourse,sometimestheguessisnotcorrect.However,Bashwil
Int32ToByte
·
2020-08-15 14:32
acm
codeforce
s 916 A Jamie and Alarm Snooze
DescriptionJamielovessleeping.Oneday,hedecidesthatheneedstowakeupatexactlyhh: mm.However,hehateswakingup,sohewantstomakewakinguplesspainfulbysettingthealarmataluckytime.Hewillthenpressthesnoozebuttone
Int32ToByte
·
2020-08-15 14:32
acm
CodeForce
s 339D Xenia and Bit Operations 线段树
用线段树,关键点在于,一般用线段树时,先建树、再更新、再查询。而这种方法把它们综合在一起!!!别人的代码。。。。。。。~_~#include#includeusingnamespacestd;intsign[1>1;if(l==r)sign[o]=v;else{if(p<=M)update(o<<1,l,M,p,v,!t);elseupdate(o<<1|1,M+1,r,p,v,!t);if(t)
efine_dxq
·
2020-08-15 13:50
codeforce
s976C(排序+贪心)
题目链接:http://
codeforce
s.com/contest/976/problem/C题意:给出一些区间,让你找出使得li>=lj&&riusingnamespacestd;constintmaxn
童话ing
·
2020-08-15 13:45
Codeforces
[线段树]
Codeforce
s 339D Xenia and Bit Operations
XeniaandBitOperationstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputXeniathebeginnerprogrammerhasasequencea,consistingof2nnon-negativeintegers:a1, a2, ...,
dixiangee374493
·
2020-08-15 13:12
codeforce
s 375D. Tree and Queries (莫队+分块)
D.TreeandQueriestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouhavearootedtreeconsistingofnvertices.Eachvertexofthetreehassomecolor.Wewillassumethatthetr
clover_hxy
·
2020-08-15 13:12
分块
莫队
Codeforce
s 628D Magic Numbers 【数位dp】
题目链接:点我定义d-数:数字d有且只在偶数位上,奇数位不能出现数字d。(0#include#include#include#include#include#include#defineCLR(a,b)memset(a,(b),sizeof(a))#definePIacos(-1.0)usingnamespacestd;typedeflonglongLL;typedefdoubleDD;const
笑着走完自己的路
·
2020-08-15 13:02
数位DP
codeforces
Enchanted Artifact
Codeforce
s Round #610 (Div. 2)(交互)
D.EnchantedArtifacttimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputThisisaninteractiveproblem.Aftercompletingthelastleveloftheenchantedtemple,youreceivedapow
cwb丶
·
2020-08-15 13:24
cf俯冲之旅
交互
codeforce
s #197(div2)
A:就是将1、2、3、排序后后,中间依次加上'+'#include#include#include#include#include#includeusingnamespacestd;chars[110];charss[110];intmain(){cin>>s;intlen=strlen(s);intc1=0,c2=0,c3=0;for(inti=0;i#include#include#inclu
caoxiaoran1202
·
2020-08-15 13:24
codeforces
codeforce
s 357B Flag Day
FlagDaytimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputInBerland,thereisthenationalholidaycoming—theFlagDay.Inthehonorofthiseventthepresidentofthecountrydeci
Clearle
·
2020-08-15 13:48
codeforces
Codeforce
s Educational
Codeforce
s Round 67
目录ContestInfoSolutionsA.StickersandToysB.LettersShopC.VasyaAndArrayD.SubarraySortingE.TreePaintingContestInfoData:2019.6.30Solved:4/7SolutionsA.StickersandToys题意:有\(A\)物品\(s\)个,\(B\)物品\(t\)个,现在将这些物品装到
banshen0201
·
2020-08-15 13:35
Codeforce
s D. Intercity Travelling(区间组合)
题目描述:D.IntercityTravellingtimelimitpertest1.5secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputLehaisplanninghisjourneyfromMoscowtoSaratov.Hehatestrains,sohehasdecidedtogetfro
b10221001
·
2020-08-15 13:58
Codeforce
s Round #197 (Div. 2) -- D. Xenia and Bit Operations(线段树)
D.XeniaandBitOperationstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputXeniathebeginnerprogrammerhasasequencea,consistingof2nnon-negativeintegers:a1, a2, ..
aozil_yang
·
2020-08-15 13:53
CodeForces
线段树
Codeforce
s Round #664 (Div. 2)C. Boboniu and Bit Operations(思维+dp)
题目链接点这里!!题目大意:对a中的每一个数在b中选一个数进行&运算得到c,最后将所有c|运算,要求尽量小。思路:第一次看到这个的时候能想到的就是dp了,因为每次选取的数即使大最后或运算后也可能小,所以贪心是肯定不行的。那么就开始考虑状态,影响我们做决策的是什么因素,就是上一个ai和哪个bj结合,那么我们能确定他要和哪个结合吗?不能,因为或运算的缘故我们不能保证无后效性。那么我们就要考虑将所有可能
ナナ色のブランク
·
2020-08-15 13:15
codeforces
算法
动态规划
CodeForce
s 501C Misha and Forest(异或和)
给出一个森林,每个点的度和相邻点异或和,求所有边开始没注意到是森林,摸不到头脑,后来发现从叶子节点开始BFS,这样每次都能出来一条边,遍历完就可以了。#include"iostream"#include"cmath"#include"queue"#include"vector"usingnamespacestd;intd[70000],s[70000];queueq;usingnamespaces
ak8877
·
2020-08-15 13:43
解题报告
CodeForce
s 681B
B.EconomyGametimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputKolyaisdevelopinganeconomysimulatorgame.Hismostfavouritepartofthedevelopmentprocessisin-gametest
algzjh
·
2020-08-15 13:43
#
模拟与贪心
Codeforce
s 621B Wet Shark and Bishops
水题,找出两种对角线的规律就可以了#include"iostream"#include"stdio.h"#include"memory.h"#include"string.h"usingnamespacestd;intx[200005],y[200005];intp[2000],q[2000];intmain(){intn;while(cin>>n){//cout>x[i]>>y[i];p[y[i
ak8877
·
2020-08-15 13:43
解题报告
Codeforce
s 425E Sereja and Sets dp
SerejaandSets我们先考虑对于一堆线段我们怎么求最大的不相交的线段数量。我们先按r排序,然后能选就选。所以我们能想到我们用$dp[i][j]$表示已经选了i个线段,最后一个被选的线段的右端点是j的方案数。对于dp[i][j]->dp[i+1][k],所有能满足左端点>j右端点为k的方案数为1#defineLLlonglong#defineLDlongdouble#definefifirs
afd5154
·
2020-08-15 13:07
CodeForce
1372C - Omkar and Baseball(思维)
C.OmkarandBaseballtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPatricklikestoplaybaseball,butsometimeshewillspendsomanyhourshittinghomerunsthathismindsta
_Hayasaka
·
2020-08-15 13:05
c++
思维专题
CodeForce
s 1372B - Omkar and Last Class of Math(思维)
B.OmkarandLastClassofMathtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputInOmkar’slastclassofmath,helearnedabouttheleastcommonmultiple,orLCM.LCM(a,b)isthesma
_Hayasaka
·
2020-08-15 13:05
暴力出奇迹
思维专题
c++
【
codeforce
s 514B】Han Solo and Lazer Gun
【题目链接】:http://
codeforce
s.com/contest/514/problem/B【题意】每次攻击可以把经过自己的一条直线上的所有点都毁掉;然后给你n个目标物的坐标问你最少要攻击多少次才能把所有目标物全部毁掉
adgnfega11455
·
2020-08-15 13:34
codeforce
s - 920B(贪心)
B.TeaQueuetimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputRecentlynstudentsfromcitySmovedtocityPtoattendaprogrammingcamp.Theymovedtherebytrain.Intheevening,a
axiaobingqiu
·
2020-08-15 13:00
cf题
acm题目
codeforce
s #197 div.2解题报告
A.HelpfulMathstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputXeniathebeginnermathematicianisathirdyearstudentatelementaryschool.Sheisnowlearningtheaddition
LeeJuen
·
2020-08-15 13:56
动态规划
greedy
codeforces
Codeforce
s ~ 1062B ~ Math(思维,因数分解)
题意给你一个数,现在有两种操作:①将这个数字乘以x②将x开根号问这个数字最小能变成的数字是多少,最少需要多少次操作思路把n分解质因数以后。开方不能减少素因子的种类,但是能够减少每个素因子的幂,每次开方相当于幂/2。所以最小数一定是每种素因子相乘,最小操作次数就是开方次数+乘法次数。如果所有幂值都是222的同一个次方,接下来就是一直幂/2了,否则我们就要先通过一次乘法将所有幂值变为2的同一个次方。#
张松超
·
2020-08-15 13:47
【思维/构造】
【其他】
CodeForce
s School Team Contest #1 (Winter Computer School 2010/11) J. Spelling Check
J.SpellingChecktimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPetyahasnoticedthatwhenhetypesusingakeyboard,heoftenpressesextrabuttonsandaddsextraletterstot
qqspeed
·
2020-08-15 13:46
ACM
【LDU】2017级新生赛
A-TheatreSquarehttp://
codeforce
s.com/problemset/problem/1/ATheatreSquareinthecapitalcityofBerlandhasarectangularshapewiththesizen
Z_sea
·
2020-08-15 13:13
新生赛
Codeforce
s Round #655 (Div. 2)解题报告
文章目录
Codeforce
sRound#655(Div.2)解题报告A-OmkarandCompletion思路代码B-OmkarandLastClassofMath思路代码C-OmkarandBaseball
Visors
·
2020-08-15 13:57
codeforces
acm
解题报告
CodeForce
s 738A - Interview with Oleg(水题)
A.InterviewwithOlegtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPolycarphasinterviewedOlegandhaswrittentheinterviewdownwithoutpunctuationmarksandspacestos
Snakeflute
·
2020-08-15 13:46
CodeForces
codeforce
s J. Spelling Check
Petyahasnoticedthatwhenhetypesusingakeyboard,heoftenpressesextrabuttonsandaddsextraletterstothewords.Ofcourse,thespell-checkingsystemunderlinesthewordsforhimandhehastoclickeverywordandchoosetherightva
菜逼一枚
·
2020-08-15 13:14
大学竞赛
CF1A Theatre Square
原题链接:http://
codeforce
s.com/problemset/problem/1/ATheatreSquareTheatreSquareinthecapitalcityofBerlandhasarectangularshapewiththesizen
ShadyPi
·
2020-08-15 13:43
杂============
CF补题 ---
Codeforce
s Round #610 (Div. 2)
题意:多组输入,在一维空间中给你一个范围a-b,给你一个站点这个站点有一个半径为r的覆盖范围,问:从a->b以每秒走1个单位长度的速度,其中在走完a,b时间内,其中有多少时间未在这个站点的覆盖范围内。思路:a->b的总时间是max(a,b)-min(a,b);仅需判断站点位于ab之间还是位于ab之外就行。#includeusingnamespacestd;typedeflonglongll;int
Ramzes_666_fan
·
2020-08-15 13:37
cf补题
Codeforce
s 367D Sereja and Sets 题解&代码
题意:有1-n共n个正整数被分成了m个非空集合(m个集合的并是n个正整数,交总是空集),从m个集合中选最少的集合数,使得对于给定的d,选出的集合中的所有数从小到大排列后满足对于[1,n]这个区间中任意长度为d的连续子区间都至少有一个数在选出的集合中(1#includeusingnamespacestd;constintmaxn=100005;intn,m,d,cnt,num,ans,sta,a[1
Rainbow6174
·
2020-08-15 13:36
codeforces
CodeForce
s - 578B "Or" Game (暴力)
题目链接:点击打开链接题意:给你n个数,你一共能对这个n个数操作k次,操作为对某个数乘x。求两两或运算的最大值。题解:对于这个问题,最开始并没有任何思路,就想着瞎暴力试试,然后我就遇到了,如何分配那个数乘x的问题。后来我发现,对多个数字乘x是没有意义的。因为若ai比其他aj的二进制都多一位,那么无论aj怎么|或运算,都不会影响到xi的最高位。所以让某个值最大化,才是我们应该做的。也就是针对于某个a
PK__PK
·
2020-08-15 13:31
CodeForces
Codeforce
s Round #360 (Div. 2) B. Lovely Palindromes
题目链接:http://
codeforce
s.com/contest/688/problem/BB.LovelyPalindromestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputParihasafriendwholovespalindromenumbers.Ap
ontheway0101
·
2020-08-15 13:00
Codeforces
Codeforce
s Round #358 (Div. 2) A. Alyona and Numbers
题目链接:http://
codeforce
s.com/contest/682/problem/AA.AlyonaandNumberstimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAfterfinishingeatingherbun
ontheway0101
·
2020-08-15 13:00
Codeforces
Codeforce
s911题解
A.NearestMinimumsYouaregivenanarrayofnintegernumbersa0, a1, …, an - 1.Findthedistancebetweentwoclosest(nearest)minimumsinit.Itisguaranteedthatinthearrayaminimumoccursatleasttwotimes.InputThefirstlinec
OneDay_pyf
·
2020-08-15 13:00
比赛题解
Codeforce
s Round #358 (Div. 2) B. Alyona and Mex
题目链接:http://
codeforce
s.com/contest/682/problem/BB.AlyonaandMextimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputSomeonegaveAlyonaanarraycontainingnpositiveinte
ontheway0101
·
2020-08-15 13:00
Codeforces
CodeForce
s 631A 631A - Interview
和最大连续子段差不多。#include#includeconstintMAX=1e3+5;__int64arr1[MAX],arr2[MAX];intmain(){intnum;std::cin>>num;for(inti=1;i>arr1[i];}for(inti=1;i>arr2[i];}__int64max_sum=0,curr_sum=0,sum_a=0,sum_b=0;for(inti=
yurio7r
·
2020-08-15 13:49
CodeForces
Codeforce
s Educational Round89div2
Codeforce
sEducationalRound89div2原题:Youaregivenanarrayconsistingofnintegersa1,a2,…,an.Initiallyax=1,allotherelementsareequalto0
Luo_Xubo
·
2020-08-15 13:41
Codeforces
codeforce
s 339D 简单的线段树操作
Xeniathebeginnerprogrammerhasasequencea,consistingof2nnon-negativeintegers:a1, a2, …, a2n.Xeniaiscurrentlystudyingbitoperations.Tobetterunderstandhowtheywork,Xeniadecidedtocalculatesomevaluevfora.Name
黑码
·
2020-08-15 13:07
线段树
【
CodeForce
s】A. Helpful Maths
ProblemhereProblemXeniathebeginnermathematicianisathirdyearstudentatelementaryschool.Sheisnowlearningtheadditionoperation.Theteacherhaswrittendownthesumofmultiplenumbers.Pupilsshouldcalculatethesum.To
MikotoLoveMe
·
2020-08-15 13:03
CodeForces
算法
Nenu 复健训练#4
Codeforce
s Round 440 Div.2
A.SearchforPrettyIntegersYouaregiventwolistsofnon-zerodigits.Let'scallanintegerprettyifits(base10)representationhasatleastonedigitfromthefirstlistandatleastonedigitfromthesecondlist.Whatisthesmallestp
Cainiao:)
·
2020-08-15 13:28
Nenu复建训练
Nenu 复建训练#1
日更博客+补题了(发现自己极其菜)A-FashioninBerland#
Codeforce
s691AAccordingtorulesoftheBerlandfashion,ajacketshouldbefastenedbyallthebuttonsexceptonlyone
Cainiao:)
·
2020-08-15 13:28
Nenu复建训练
Codeforce
s Round #610 (Div. 2) 简要题解
http://
codeforce
s.com/contest/1282坚持下去谁也不知道结果是什么,但不坚持我肯定会后悔的。这场比赛自闭了,对我极其不友好,读不懂,读懂了又做不来。
KXL5180
·
2020-08-15 13:57
ACM题解
CodeForce
s 131C The World is a Theatre 组合数
看过生活大爆炸的都知道,四男一女。所以就是男生的取法乘女生的取法#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#defineCPY(A,B)memcpy(A,B,sizeof
Kim0403
·
2020-08-15 13:57
CodeForces
数学-组合数学
Codeforce
s Educational Round #42
终于上紫了qaq算是省选前的一个好消息了吧qaq值得纪念。4.10-4.11CF962AEquator(模拟)#include#include#include#includeusingnamespacestd;#definelllonglong#defineinf0x3f3f3f3f#defineN200010inlinechargc(){staticcharbuf[1'9'){if(ch=='-
Icefox_zhx
·
2020-08-15 13:19
codeforces
STL
贪心
模拟
比赛
codeforce
s——1A - Theatre Square
A.TheatreSquaretimelimitpertest2secondsmemorylimitpertest64megabytesinputstandardinputoutputstandardoutputTheatreSquareinthecapitalcityofBerlandhasarectangularshapewiththesizen × mmeters.Ontheoccasion
tokers
·
2020-08-15 13:10
Educational
Codeforce
s Round 37 C. Swap Adjacent Elements 思维
C.SwapAdjacentElementstimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouhaveanarrayaconsistingofnintegers.Eachintegerfrom1tonappearsexactlyonceinthisarray.F
Frost_Bite
·
2020-08-15 13:37
上一页
124
125
126
127
128
129
130
131
下一页
按字母分类:
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
其他