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
743 D. Chloe and pleasant prizes(DFS)
D.Chloeandpleasantprizestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputGeneroussponsorsoftheolympiadinwhichChloeandVladiktookpartallowedalltheparticipantst
HandsomeHow
·
2020-09-14 17:25
搜索
codeforces
900D Unusual Sequences
D.UnusualSequencestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputCountthenumberofdistinctsequencesa1, a2, ..., an(1 ≤ ai)consistingofpositiveintegerssuchtha
C_K_Y_
·
2020-09-14 17:23
数学
dp
Educational
Codeforces
Round 45 (Rated for Div. 2) D. Graph And Its Complement
D.GraphAndItsComplementtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputGiventhreenumbersn,a,b.Youneedtofindanadjacencymatrixofsuchanundirectedgraphthatthenu
风中一颗松
·
2020-09-14 17:23
Codeforces
Codeforces
1016D Vasya And The Matrix(构造)
题目链接:VasyaAndTheMatrix题意构造一个nn行mm列的矩阵,要求构造矩阵的每一行的异或值为aiai,每一列的异或值为bibi。输入第一行包含两个整数n,m(2≤n,m≤100)n,m(2≤n,m≤100),第二行有nn个整数a1,a2,⋯,an(0≤ai≤109)a1,a2,⋯,an(0≤ai≤109),第三行有mm个整数b1,b2,⋯,bm(0≤bi≤109)b1,b2,⋯,bm
Dmaxiya
·
2020-09-14 17:52
构造
Codeforces
Round #548 (Div2)
Codeforces
Round548(Div.2)题目地址A.EvenSubstrings题目大意:大概就是让你找到所有的偶数,然后让你累加这个偶数及之前的所有数的个数#includeusingnamespacestd
橘子灬君
·
2020-09-14 17:51
ACM
G. Path Queries(带权并查集+kruskal思想)
https://
codeforces
.com/problemset/problem/1213/G题意翻译题目描述\mathsfE\color{red}\mathsf{ntropyIncreaser}EntropyIncreaser
小菜鸡加油
·
2020-09-14 17:51
思维
最小生成树
并查集
F1. Tree Cutting (Easy Version)(思维+树dfs)
https://
codeforces
.com/problemset/problem/1118/F1题意翻译给一棵树,每一个节点都是红色,蓝色或者无色。
小菜鸡加油
·
2020-09-14 17:20
思维
树的dfs
Codeforces
Round #548 (Div. 2) C. Edgy Trees(并查集)
C.EdgyTreestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenatree(aconnectedundirectedgraphwithoutcycles)ofnvertices.Eachofthen−1edgesofthetreeisc
totororz
·
2020-09-14 17:19
Codeforces
Round #670 (Div. 2)(A-D详解)
A:SubsetMexB:MaximumProductC:LinkCutCentroidsD:ThreeSequences
小菜鸡加油
·
2020-09-14 17:19
codeforces
D. Vasya And The Matrix(位运算+矩阵构造)
https://
codeforces
.com/problemset/problem/1016/D一个矩阵,你知道每行,每列异或后的结果,然后还原这个矩阵,如果不能还原输出NO。
小菜鸡加油
·
2020-09-14 17:19
构造
思维
位运算
Codeforces
900D (
Codeforces
Round #450 Div. 2) Unusual Sequences 容斥定理
D.UnusualSequencestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputCountthenumberofdistinctsequencesa1, a2, ..., an(1 ≤ ai)consistingofpositiveintegerssuchtha
VampireWeekend
·
2020-09-14 17:13
计数问题
Codeforces
Round #100E. New Year Garland【DP】
E.NewYearGarlandtimelimitpertest5secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAsGerald,Alexander,SergeyandGennadyarealreadybusywiththeusualNewYearchores,Edwardhastilydeco
kmlver
·
2020-09-14 17:12
Codeforces
Round 580 D. Kefa and Dishes (状态压缩dp)
D.KefaandDishestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputWhenKefacametotherestaurantandsatatatable,thewaiterimmediatelybroughthimthemenu.Therewerendis
zthgreat
·
2020-09-14 17:41
【动态规划】
dp
压缩
Codeforces
Round #548 (Div. 2) C. Edgy Trees
C.EdgyTreestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenatree(aconnectedundirectedgraphwithoutcycles)ofnnvertices.Eachofthen−1n−1edgesofthetre
Amo-
·
2020-09-14 17:39
思维
Codeforces
并查集
Codeforces
Round #450 (Div. 2) D. Unusual Sequences 数学
Countthenumberofdistinctsequencesa1, a2, …, an(1 ≤ ai)consistingofpositiveintegerssuchthatgcd(a1, a2, …, an) = xand.Asthisnumbercouldbelarge,printtheanswermodulo109 + 7.gcdheremeansthegreatestcommondi
looooooogn
·
2020-09-14 17:08
Codeforces
Round #634 (Div. 3) E2.Three Blocks Palindrome (hard version)
Codeforces
Round#634(Div.3)E2.ThreeBlocksPalindrome(hardversion)Theonlydifferencebetweeneasyandhardversionsisconstraints.Youaregivenasequenceaconsistingofnpositiveintegers.Let
旺 崽
·
2020-09-14 17:08
思维
二分
Codeforces
Codeforces
Educational
Codeforces
Round 45 (Rated for Div. 2)题解
A.CommentaryBoxestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputBerlandFootballCupstartsreallysoon!Commentatorsfromallovertheworldcometotheevent.Organizers
weiweiwei_
·
2020-09-14 17:07
Codeforces
873C Strange Game On Matrix【贪心】水题
C.StrangeGameOnMatrixtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputIvanisplayingastrangegame.Hehasamatrixawithnrowsandmcolumns.Eachelementofthematrixisequa
mengxiang000000
·
2020-09-14 17:01
水题
B. Maximum Product(贪心+枚举)
https://
codeforces
.com/contest/1406/problem/B思路:直接正反两个排序,枚举正排序中选0~5个,反排序中选5-i个,枚举取最大就好了。
小菜鸡加油
·
2020-09-14 17:50
思维
贪心
[
codeforces
]round670 D. Three Sequences
#include#definedebug(x)coutpii;lln,q;lla[N];lldiffer[N];intmain(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);#ifDBGfreopen("input.txt","r",stdin);#endifcin>>n;lltot=0;for(inti=1;i>a[i];differ[
IZUMIXINGI
·
2020-09-14 17:49
math
codeforces
1166B All the Vowels Please
链接:点这里题意:给你一个数字,判断它能不能变成一个n*m=k的矩形,并且每行每列都有完整的五个元音字母。思路:一判断不是素数,二判断长和宽要大一等于5就好了。判断素数的时候还写错了。wa了一发。窒息#include#include#include#include#includeusingnamespacestd;constintmaxn=50000+10;intvis[27];intd[27];
okimaru
·
2020-09-14 14:50
code'forces
codeforces
1092C Prefixes and Suffixes【字符串+思维】
题目链接:点这里题意:这题意我读错了三个小时...最后到网上找题解的时候才发现读错了QAQ暴击题意是判断给你的2*n-2个字符串是前缀还是后缀,不是判断这个字符串的内容...我真的欲哭无泪,理解能力太菜了思路:将两个n-1长的字符串取出,先判断第一个取出的字符串和给出的字符串前缀的匹配程度。如果匹配程度大于半数,则这个为所需字符串-1,否则就是另外一个。同时要注意回文串的情况,所以开了一个cnt数
okimaru
·
2020-09-14 14:50
codeforces
1166A Silent Classroom
题目链接:点这里题意:一个人数n,有n个人名,要把他们分到两个教室里,名字首字母的尽量不要放一起,如果有名字首字母一样的放一起,就要加一张凳子。思路:刚开始我找起了规律,然后wa了好多。。明明是一道水题。正解是开两个数组,只要每次读入把名字放到相同首字母比较少的那个数组里就好了。太菜了,浪费了我好久时间,打div2,最后太困了,只写了两道题,就去睡觉了,光荣掉分。#include#include#
okimaru
·
2020-09-14 14:20
code'forces
codeforces
1003C Intense Heat
题目链接:http://
codeforces
.com/problemset/problem/1003/C题目思路:该题用到了前缀和,题意是给你n个数要求找连续小于等于k的最大平均值。
okimaru
·
2020-09-14 14:19
codeforces
707 C Pythagorean Triples【数学】
C.PythagoreanTriplestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputKatyastudiesinafifthgrade.RecentlyherclassstudiedrighttrianglesandthePythagoreantheorem.I
Joefery
·
2020-09-14 13:17
数学
CodeForces
并查集在实际问题中的应用
题目来源:
codeforces
1012B原问题如下,在一个(n*m)的table上,element会做出一种增值行为,如果有三个物质处于某个矩形的三个顶点上,那么在第四个顶点上会自动增值出一个element
Absoler
·
2020-09-14 11:16
数据结构
Codeforces
725D By Assassin
题意:acm队伍可以得气球,相同气球数是一个排名。每个队伍有一个成熟上限,如果该队伍的气球数大于上限,该队伍被淘汰!给了你队伍的气球数,你的气球可以给别人,问你最大可能的排名思路:用优先队列,首先用big记录比你气球多的队伍,该队伍被撑爆淘汰需要给他的气球数,big用递增序列!用small记录小于等于你的气球数的队伍信息,用pair重定义一下。解题的思路是,比你气球数多的,你只能通过给他气球淘汰他
Assassin__is__me
·
2020-09-14 11:49
模拟
排序
xjb搞
Codeforces
725E Too Much Money (看题解)
TooMuchMoney最关键的一点就是这个贪心可以在sqrt(n)级别算出答案。因为最多有sqrt(n)个不同的数值加入。我们可以发现最优肯定加入一个。然后维护一个当前可以取的最大值,枚举加入的数来贪心。#include#defineLLlonglong#definefifirst#definesesecond#definemkmake_pair#definePLLpair#definePLIp
afd5154
·
2020-09-14 10:23
Codeforces
725E Too much money (暴力模拟)
思路:首先明确一点,为什么按照从大到小依次取,会得不到指定值:因为,当取了某个位置的某个值(因为相同的值可以有多个)以后,之后所有能取的加起来都不够达到指定值了,所以,放一个值肯定比放多个值加起来和那个值相同来的好。所以依次遍历所有i#includeusingnamespacestd;#definemod1000000007#definePIacos(-1.0)#defineINF0x3f3f3f
奶瓶他哥
·
2020-09-14 09:17
Leha and Function
CodeForces
- 841C 组合数
稍微推一下,我们可以猜测F(n,k)中n尽量大,k尽量小,就能使得F尽量大然后呢,,cf还是要敢于猜的,40分钟想到了这一点,没敢写,最后交上对了#include#include#include#include#include#include#include#include#include#include#include#include#defineinfreopen("in.txt","r",s
冰冰的小宝贝
·
2020-09-14 08:39
codefoces
Codeforces
- Nirvana
题目链接:
Codeforces
-Nirvana爆搜,或者类似于一个数位dp。枚举当前这一位是否能取到9,然后分是否取9转移。
青烟绕指柔!
·
2020-09-14 08:51
数位dp
Codeforces
动态规划
Codeforces
- Hills
题目链接:
Codeforces
-Hillsdp[i][j][0/1]分别代表前i个,选j个,第i个是否选择的最大值。显然选择是不能连续的,因为相邻的是一个偏序关系。
青烟绕指柔!
·
2020-09-14 08:51
动态规划
Codeforces
思维题
Codeforces
- CF1132CPainting the Fence
题目链接:
Codeforces
-CF1132CPaintingtheFence先枚举第一个删除的人。然后枚举第二个,利用前缀和优化计算。
青烟绕指柔!
·
2020-09-14 08:51
前缀和
Codeforces
思维题
Codeforces
Round #611 (Div. 3) C题
FriendsandGiftsTherearenfriendswhowanttogivegiftsfortheNewYeartoeachother.Eachfriendshouldgiveexactlyonegiftandreceiveexactlyonegift.Thefriendcannotgivethegifttohimself.Foreachfriendthevaluefiisknown:
不拿牌不改名
·
2020-09-14 07:19
#
codeforces上分记录
#
思维
codeforces
GCD+LCM
Codeforces
Round #641 (Div. 2) C题 Orac and LCM
OracandLCM题目大意:给n个数,先求出所有lcm(a[i],a[j]),i#defineLLlonglong#definepapair#definelsk>n;for(inti=1;i>a[i];for(inti=n;i>=1;i--)g[i]=__gcd(g[i+1],a[i]);for(inti=1;i<=n;i++)b[i]=a[i]*g[i+1]/g[i];LLans=0;for(
不拿牌不改名
·
2020-09-14 07:19
#
数学
数论
数学
Powers Of Two(二进制拆分)
题目链接:http://
codeforces
.com/contest/1095/problem/CExamplesinput94outputYES1224input81outputYES8input51outputNOinput37outputNO
永夜莫明
·
2020-09-14 07:42
思维
Codeforces
游玩攻略
Codeforces
游玩攻略1.简介2.网址3.使用1.主界面2.社区3.比赛名字颜色比赛种类比赛流程关于
Codeforces
赛制:如何读懂排行榜Rating4.题解最后鸣谢1.简介
Codeforces
justin666888
·
2020-09-14 06:45
Codeforce
la1la1la的四连做..
写在前面的..今天来了一波很成功的la1la1la四连做..还是同样的激情0.0..还是熟悉的爆零..t1
Codeforces
713C先把ai减去i把问题转化成单调不降..然后比较显而易见地就可以知道最终的序列的数一定是原序列中出现过的
Ra1nbow_Chan
·
2020-09-14 06:07
一些奇奇怪怪的东西
bzoj
codeforces
552B Vanya and Books
点击打开链接B.VanyaandBookstimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVanyagotanimportanttask—heshouldenumeratebooksinthelibraryandlabeleachbookwithitsnumber.
zhang_liuchen
·
2020-09-14 05:21
ACM算法_数学题
math
codeforces
Vanya and Cards
DescriptionVanyalovesplaying.Heevenhasaspecialsetofcardstoplaywith.Eachcardhasasingleinteger.Thenumberonthecardcanbepositive,negativeandcanevenbeequaltozero.Theonlylimitis,thenumberoneachcarddoesn’tex
徐诚武
·
2020-09-14 05:24
codeforce
Codeforces
Round #235 (Div. 2) A. Vanya and Cards
A.VanyaandCardstimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVanyalovesplaying.Heevenhasaspecialsetofcardstoplaywith.Eachcardhasasingleinteger.Thenumberont
殷华
·
2020-09-14 04:53
基础
codeforces
401A - Vanya and Cards
题目链接:http://
codeforces
.com/problemset/problem/401/A题目大意:求最小操作数。题目分析:……。
sstrawberry
·
2020-09-14 04:52
Water~~~
Codeforces
492C Vanya and Exams(贪心)
题目链接:
Codeforces
492CVanyaandExams#include#include#includeusingnamespacestd;typedeflonglongll;constintmaxn
JeraKrs
·
2020-09-14 04:20
CF
GRADE:D
算法设计-贪心法
Codeforces
401A Vanya and Cards(水题)
题目链接:
Codeforces
401AVanyaandCards题目大意:给出n和x,表示说有n张卡片,每张卡片上有一个值,绝对值不大于x,现在给出n张卡片上的值,问说至少再拿几张卡片,可以使得所有卡片上值的和等于
JeraKrs
·
2020-09-14 04:20
CF
非常简单的签到题
GRADE:D
CodeForces
677A Vanya and Fence(轧马路)
http://
codeforces
.com/contest/677/problem/AA.VanyaandFencetimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVanyaandhisfriendsarewalkingalongthefenceofheightha
Shyazhut
·
2020-09-14 04:32
CodeForces
一块水过这的题
codeforces
A. Vanya and Cards
1、http://
codeforces
.com/contest/401/problem/A2、题目大意:有n张卡片,每张卡片的值都小于X,求最少还需要多少张卡片才能使得所有的卡片的和最小,题目很简单,看代码就明白了
sdjzping
·
2020-09-14 04:26
竞赛
Codeforces
Round #665 (Div. 2)
目录
Codeforces
Round#665(Div.2)A.DistanceandAxisB.TernarySequenceC.MereArrayD.MaximumDistributedTree参考
Codeforces
Round
第25小时
·
2020-09-14 04:32
Codeforces
Round #516 (Div. 2, by Moscow Team Olympiad)
Codeforces
Round#516(Div.2,byMoscowTeamOlympiad)Solved:3outof6Rank:1347A.Makeatriangle!难度:普及?数学题。。。
dmqqndlx85675
·
2020-09-14 03:49
Codeforces
Round #513 by Barcelona Bootcamp (rated, Div. 1 + Div. 2)
Codeforces
Round#513byBarcelonaBootcamp(rated,Div.1+Div.2)Solved:2outof8...Rank:2730unratedA.PhoneNumbers
dmqqndlx85675
·
2020-09-14 03:48
codeforces
552 C Vanya and Scales
这个题的意思就是给出一个数m,以及一个以1为首元素,w为比例常数的等比数列,数列长度为101,数列中每个数字最多只能用一次。问是否存在xa+wb+……=wc+wd+……+we+m。很显然,换句话说就是问,是否存在m=wa+wb+……+wf-wc-wd-……-we,再进行化简就可以得到,是在问,是否存在m=((((wh±1)wi±1)±1)wj±1)wk……。那么很显然可以进行搜索,比如说用广搜,每
Last0rder
·
2020-09-14 03:11
bfs
上一页
60
61
62
63
64
65
66
67
下一页
按字母分类:
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
其他