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
CodeForce
s Educational
Codeforce
s Round 59 题解
菜了菜了……后三题居然考场上毫无思路……%爆HYXA:DigitsSequenceDividing(1107A)乍一看是一道很难的题目,DP啊什么的……实际上只要把第一个数字单独拿出来,如果后面是两位数以上,那一定比一位数要大,满足条件;如果后面只剩一个数字,只要比较一下大小就好了。B:Digitalroot(1107B)有一个前置知识(找规律也可发现),就是一个数字在按照题目那么操作直到剩下最后
cccccwb
·
2020-08-17 12:12
题解
Educational
Codeforce
s Round 81 (Rated for Div. 2)C 二分
C.ObtainTheStringtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregiventwostringsssandttconsistingoflowercaseLatinletters.Alsoyouhaveastringzzwhichisini
cwb丶
·
2020-08-17 12:38
二分
Codeforce
s 360C Levko and Strings dp (看题解)
LevkoandStrings感觉怎么复杂度都不对。。没想到暴力转移复杂度是对的,好菜啊。#include#defineLLlonglong#defineLDlongdouble#defineullunsignedlonglong#definefifirst#definesesecond#definemkmake_pair#definePLLpair#definePLIpair#definePII
afd5154
·
2020-08-17 11:30
Educational
Codeforce
s Round 82 (Rated for Div. 2)
C.PerfectKeyboard题目大意:Polycarp希望组装自己的键盘。多行的布局对他来说太复杂了-他的键盘只有一行,而所有26小写拉丁字母将按一定顺序排列。他的密码s,它们应该在键盘上相邻。例如,如果密码是abacaba,则布局cabdefghi…是完美的,因为键盘上的字符a和c相邻,而键盘上的a和b则相邻。确保在其中没有两个相邻的相等字符s,例如,密码不能是password(两个字符s
nefu_马家沟老三
·
2020-08-17 11:59
Codeforces之旅
Codeforce
s Round 1076 (Educational
Codeforce
s Round 54 Rated for Div. 2) F. Summer Practice Report
F.SummerPracticeReporttimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVovahastakenhissummerpracticethisyearandnowheshouldwriteareportonhowitwent.Vovahasalre
Detective-Conan
·
2020-08-17 11:16
Codeforces
贪心算法
线性DP
Educational
Codeforce
s Round 54 (Rated for Div. 2) A. Minimizing the String
贪心因字典序位越靠前权越大从初始位置枚举此位后一位向后与原串比较字典序若小则为最优输出结束/*Zeolim-AnACadaykeepsthebugaway*///pragmaGCCoptimize(2)#include#include#include#include#include#include#include#include#include#include#include#include#in
Zeolim
·
2020-08-17 11:11
GREED(贪心)
Codeforces
集训队每周一赛2020-03-01(二分排序+冒泡排序+结构体排序)
第一次周赛A我POJ3104题解B想HDU5540题解C上
CodeForce
s1311B题解D学HDU5182题解E啊HDU5832F!
带你看宇宙
·
2020-08-17 11:39
比赛
Codeforce
s--1051B--Relatively Prime Pairs
题目描述:Youaregivenasetofallintegersfromltorinclusive,l#include#include#includeusingnamespacestd;typedeflonglongll;intmain(){lll,r;while(scanf("%lld%lld",&l,&r)!=EOF){printf("YES\n");for(lli=l;i
ypopstar
·
2020-08-17 11:07
数学
算法
Educational
Codeforce
s Round 51 (Rated for Div. 2).B. Relatively Prime Pairs(水题)
B.RelativelyPrimePairstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenasetofallintegersfromlltorrinclusive,lusingnamespacestd;intmain(){ios::sync
MiaoPlus
·
2020-08-17 11:30
Educational
Codeforce
s Round 64 (Rated for Div. 2)
http://
codeforce
s.com/contest/1156A:(wa到菜哭)刚开始秒A了,结果是官方出题给错图了,然后,,wa了好几发主要点:考虑下面这种情况,也就是说当某个地方顺序为312时
yyyan_
·
2020-08-17 11:59
Codeforces
Educational
Codeforce
s Round 58 (Rated for Div. 2)
http://
codeforce
s.com/contest/1101A题判断d在不在l,r区间内如果不在就直接输出d如果在就用(r/d+1)*d求得在超过r后第一个是d的整数倍的数字#includeusingnamespacestd
yyyan_
·
2020-08-17 11:27
Codeforces
Codeforce
s A.Linova and Kingdom (树的深度 / dfs)
传送门题意:给你一棵n个节点的树,试标记其中k个节点为工业区,剩下的为旅游区,使得所有工业区走到1号根节点所经过的旅游区数量max。思路:将深度最大的k个节点标记为工业区即可。s[u]表示u节点子树上节点的数目。d[u]表示u节点的深度。排序找到d[u]-s[u]最大的k歌节点即可。代码实现:#include#defineendl'\n'#definenullNULL#definelllonglo
S atur
·
2020-08-17 11:26
图论
Codeforce
s C Anna, Svyatoslav and Maps (floyd最短路 & 贪心)
传送门题意:题意有点复杂,现有n个点的有向无权图,给出一条路径p。试问是否可以去掉p序列中的部分点,使得剩余序列所经路径依旧是原路径(长度不变)。思路:由于数据范围比较小,可以直接floyd处理。每次找到给定路径上终点到当前点的最短路,如果最短路小于给的路径的长度,那么把路径上该点的上一个点加进去。代码实现:#include#defineendl'\n'#definenullNULL#define
S atur
·
2020-08-17 11:25
图论
Codeforce
s D Graph And Its Complement
DGraphAndItsComplement题意:给定n个点,连接点使得图中块的个数为a,将连接情况反转图的个数为b。即连接情况为块数为1,补图为.块数为2。思路:可以自己假设个5,连线看一下。然后你就会发现。(5,1),(4,1),(3,1),(2,1),(1,1)的规律。a,b必须有一个为1,接下来在考虑一下边界,nusingnamespacestd;boolvis[1000+10][1000
DeathYmz
·
2020-08-17 11:18
codeforce
Codeforce
s E Post Lamps
EPostLamps思路:条件:照亮[0,n]段,选一种灯泡订购,灯泡有价格和向后照射长度,设置了不能放置的位置1、计算可以选择的最短长度,因为有blocked,因此必须从其前一格放置灯,并且覆盖blocked区域。计算blocked的方法:(1)[0,1,2,3,4,5,6]3,4,5不能用,必须选择长度大于等于[2,6]=4(2)[0,1,2,3,4,5,6]0不能用[0,1]肯定照射不到输出
DeathYmz
·
2020-08-17 11:46
codeforce
Codeforce
s B Applejack and Storages
BApplejackandStorages题意:初始输入n个棍子的长度,接下来有q个操作,每次操作加入长度为x的棍子,或者是取走为x的棍子。每次操作问,Applejack可以用当前的棍子组成一个正方形(4个一样的棍子)和长方形(2*2个一样的棍子)吗。思路:直接记录大于2的个数,大于4的个数,大于6的个数,大于8的个数。(记录方法如代码)然后判断。代码:#includeusingnamespace
DeathYmz
·
2020-08-17 11:46
codeforce
Codeforce
s C Bracket Sequences Concatenation Problem
CBracketSequencesConcatenationProblem思路:一个字符串S,需要判断它左边需要多少“(”右边需要多少“)”。为了配对成完整的,(i,j)或者(j,i)其中s[i],或者s[j],左右两边一定有一方(或两方)需要的数目为0,然后如果(i,j)可以配对,s[i]的R[i]==s[j]的L[i]且L[i]=R[j]=0。ok接下来就可以开始计算了。代码C++11#inc
DeathYmz
·
2020-08-17 11:46
Python
codeforce
Codeforce
s A Rainbow Dash, Fluttershy and Chess Coloring
ARainbowDash,FluttershyandChessColoring题意:游戏开始在一个正方形的平面网格上,它最初有轮廓边界。RainbowDash和Fluttershy有大小为1×1的方形平块,RainbowDash有无限个淡蓝色块,Fluttershy有无限个黄色块。以下规则放置的:每个新放置的块必须在一个侧面接触到之前的回合图形上建造的(注意网格的轮廓边界是最初建造的)。两个人要填
DeathYmz
·
2020-08-17 11:46
codeforce
Educational
Codeforce
s Round 80 Editorial 解题报告
SS有点不稳定一直进不去cf,进去的时候已经过了不少时间了,然后人就比较着急,反而做的更慢了。A题数学题很简单B题数学题很简单C题我看出来是一道dp题了,也看出来这道题可以用数学方法直接推公式了。然而我没推出dp递推公式,也没推出数学公式。这道题需要简单转换一下,然后才能做,这里我没想到这一点,题目做的不够多吧。题意是[1,n]范围中任取构成数列An和数列Bn,满足An为非降序列,Bn为非升序列,
陆小萌
·
2020-08-17 11:45
Educational
Codeforce
s Round 81 (Rated for Div. 2) C - Obtain The String
C.ObtainTheStringtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregiventwostringssandtconsistingoflowercaseLatinletters.Alsoyouhaveastringzwhichisinitia
陆小萌
·
2020-08-17 11:14
Educational
Codeforce
s Round 55 (Rated for Div. 2) ABCD总结
终测前三题900+,终测完三题597,上了35分。总算突破了1700。。。这次题目简单题来说偏难。A题9分钟才写出来。赛后补了D发现并不是太难。。。A:一本书有n页,你现在在x页,你要翻到y页,一次只能翻正好d页。可以从第x页翻到第n页或者第1页(即使不够正好d页),再翻到第y页。不能翻到第y页输出-1,否则输出最少翻几次。只需要分上面三种情况看能否整除取最小值就好了。如果都不能整除就是-1。B:
LSD20164388
·
2020-08-17 11:57
总结:比赛总结
Educational
Codeforce
s Round 51 (Rated for Div. 2) C Vasya and Multisets 【水题】
C.VasyaandMultisetstimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVasyahasamultisetssconsistingofnnintegernumbers.Vasyacallssomenumberxxniceifitappearsinthe
Head_Hard
·
2020-08-17 11:04
基础水题
Codeforce
s 简单思维题合集
codeforce
s1285BJustEatIt!
沐兮Krystal
·
2020-08-17 11:27
Codeforces
算法
Codeforce
s E. Maximum Subsequence Value(贪心+鸽巢原理)
https://
codeforce
s.com/contest/1365/problem/E(题目链接如上↑)题意:从a数组中选取一个长度为k的子序列,使得该子序列的value值最大。
沐兮Krystal
·
2020-08-17 11:26
Codeforces
Codeforce
s D. Two Divisors (数论,线性筛)
https://
codeforce
s.ml/contest/1366/problem/D(题目链接如上↑)题解:1.首先,gcd(x,y)=gcd(x+y,x*y)证明如下:gcd有两点性质:(1)gcd
沐兮Krystal
·
2020-08-17 11:26
Codeforces
数论题
Educational
Codeforce
s Round 32 A B C
A.LocalExtrematimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenanarraya.Someelementofthisarrayaiisalocalminimumiffitisstrictlylessthanbothofitsneig
Dave_L
·
2020-08-17 11:52
贪心
Educational
Codeforce
s Round 77 (Rated for Div. 2) E. Tournament
链接点击跳转题解把比赛的流程画出来,发现是一棵二叉树,如图:那其实我需要贿赂的就是每个红色子树中实力最强的叶子(预处理中把比你朋友弱的人的贿赂款都设为000)其实就发现问题变成了:我把原序列划分成log2nlog_2nlog2n个子序列,且序列长度分别为20,21,...,2log2n−12^0,2^1,...,2^{log_2n-1}20,21,...,2log2n−1,每个子序列的代价就等于序
*ACoder*
·
2020-08-17 11:20
#
一般动态规划
Educational
Codeforce
s Round 81 (Rated for Div. 2)C. Obtain The String
原题:C.ObtainTheStringYouaregiventwostringssandtconsistingoflowercaseLatinletters.Alsoyouhaveastringzwhichisinitiallyempty.Youwantstringztobeequaltostringt.Youcanperformthefollowingoperationtoachievethi
星痕一梦
·
2020-08-17 11:20
Codeforce
s Global Round 3 C. Crazy Diamond
链接https://
codeforce
s.com/problemset/problem/1148/C题解容易发现111和nnn这两个位置是很好用的,111可以和右半段中的任何一个交换,nnn可以和左半段中的一个任意交换因此我构造的策略是
*ACoder*
·
2020-08-17 11:49
构造
Educational
Codeforce
s Round 42 (Rated for Div. 2) D. Merge Equals
D.MergeEqualstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenanarrayofpositiveintegers.Whilethereareatleasttwoequalelements,wewillperformthefollo
风中一颗松
·
2020-08-17 11:15
Codeforces
Educational
Codeforce
s Round 43 (Rated for Div. 2)
题目链接:http://
codeforce
s.com/contest/976A.MinimumBinaryNumbertimelimitpertest:1secondmemorylimitpertest
Dillonh
·
2020-08-17 11:09
比赛题解
Online Courses In BSU
CodeForce
s - 770C (拓扑)
NowyoucantakeonlinecoursesintheBerlandStateUniversity!Polycarpneedstopasskmainonlinecoursesofhisspecialtytogetadiploma.Intotalncoursesareavailiableforthepassage.Thesituationiscomplicatedbythedependenc
电竞杜兰特
·
2020-08-17 11:06
拓扑
拓扑
Codeforce
s Global Round 5 补题(C2思维题、D-RMQ(二分+倍增ST/二分+单调栈)、E思维)
思路来源tourist的turorialC2.BalancedRemovals(Harder)(map)给n(n#include#include#include#includeusingnamespacestd;constintD=3;intn;intdfs(vector>&p,vector&x,intk){if(k==D){//由于所有值不同最后一层一定只有一个值returnx[0];}map>
Code92007
·
2020-08-17 11:33
#
Codeforces
Educational
Codeforce
s Round 54 (Rated for Div. 2) A. Minimizing the String(思维)
题目链接:http://
codeforce
s.com/contest/1076/problem/A题意是输入一个字符串,然后要求删除一个字符,输出删除一个字符后的字典序最小的字符串。
Ch_zaqdt
·
2020-08-17 11:29
CodeForces
CodeForce
s - 10D LCIS
LCIS+传送门+◇题意◇给定n,mn,m,并给定长度分别为n,mn,m的两个数组a[],b[]a[],b[],输出a,ba,b数组的最长公共子序列的长度和它本身。n,m(1 ≤n,m ≤ 500)n,m(1 ≤n,m ≤ 500)听说O(n4)O(n4)都能过◇经典DpDp◇(如果有兴趣的话可以回忆一下更基础更经典的类似题)最长上升子序列最长公共子序列单纯的我摆出上面两道题跟这道题还是有一定关系
C20191904
·
2020-08-17 11:53
查来查去写笔记
考来考去碰运气
CodeForce
s - 11D A Simple Task
◇ASimpleTask◇+传送门+先说两句每次都是这样:上去讲一道题,一边讲一遍问:没问题吧(众人回应:笑)。讲罢,老师曰:“你等下写篇题解吧”……于是,我又来了。◇题意◇给一个有nn个点,mm条边的图,求图上环的个数。(1 ≤ n ≤ 19,0 ≤ m)(1 ≤ n ≤ 19,0 ≤ m)注意:大家对着样例自己看一下提示:有两个“八”字形的环◇解析状压DpDpDpDp的理由:这个我没法解释,我
C20191904
·
2020-08-17 11:53
查来查去写笔记
考来考去碰运气
Educational
Codeforce
s Round 8 ABCDE
套题链接:http://
codeforce
s.com/contest/628难度类型:前几题比较容易,D题后难度陡增。A题解类型:模拟根据题意一轮轮做就是了,只是题目有点长,要仔细读。
ned_chu
·
2020-08-17 11:14
套题
Educational
Codeforce
s Round 7 ABCDE
套题链接:http://
codeforce
s.com/contest/622难度类型:基本都是想法题A题解类型:二分二分答案或者直接求根。
ned_chu
·
2020-08-17 11:13
套题
Educational
Codeforce
s Round 64 (Rated for Div. 2) 题解(A~E)
题目地址:https://
codeforce
s.com/contest/1156同时发布在本人的洛谷博客:https://www.luogu.org/blog/996-icu/并没有去打这一场比赛,不过据说因为第一题数据的锅
IlIlIllIIl
·
2020-08-17 11:58
C. A Tale of Two Lands
链接:http://
codeforce
s.com/contest/1166/problem/C题意:问有多少组(俩俩一组)组合,能使|a|,|b|在|a+b|和|a-b|之间题解:主要是要理解性质,同时思考如何节省时间
Z&C
·
2020-08-17 11:57
数学+思维
Educational
Codeforce
s Round 5 ABCDE
ProblemA位数少的前面补零,比字典序,注意本身可能有前导0#include#include#include#include#include#include#include#include#include#definelllonglong#definedebug(x)printf("----Line%s----\n",#x)usingnamespacestd;constintN=1e6+5;c
沙雕.
·
2020-08-17 11:26
Codeforces补题
Educational
codeforce
s Round 74
C题意:有个cliff高为h,1-h由h个平台,有的伸出有的未伸出。当你跳下一个平台的时候,它和它下面那个平台的状态都会改变。一次只能最多下跳2格。可以使用A让平台状态改变,求最少使用A的次数让ta能安全到达地上(0平台)思路:就是模拟…注意如果在x+1平台,平台x到y都是未伸出时,相当于ta已经到达了平台y,就不用模拟了(不然会t)D题意:由AB组成的string,求满足以下条件的字串的个数。1
weixin_43647238
·
2020-08-17 11:25
codeforces题集
Codeforce
s Round #649 (Div. 2)个人题解(A,B,C)
A题:题意:给你一个数组,找到一个最长数列的和不能被x整除,该数列只能由原数列从第一个开始删除,或者从最后一个开始删除(必须连续删除)。思路:直接设一个前缀和数组,循环一遍判断最大值就行了。如果全部元素都能被x整除,那就直接输出-1。#include#include#include#include#include#defineMAX100005typedeflonglongll;usingname
wut_zz
·
2020-08-17 11:53
Codeforce
s Round #651 (Div. 2)个人题解(A,B,C,D,E)
A题:题意:找出1-n中任意一对数a,b的最大公约数的最大值;思路:直接找除以2的就行了,水题;#includeusingnamespacestd;intmain(){intt;cin>>t;while(t--){intn;cin>>n;if(n%2==0)cout1思路:直接把数组b全部凑成偶数就行了。(输出的下标,比赛的时候wa了一发)。#includeusingnamespacestd;in
wut_zz
·
2020-08-17 11:53
Educational
Codeforce
s Round 19 题解【ABCDE】
A.k-Factorization题意:给你一个n,问你这个数能否分割成k个大于1的数的乘积。题解:因为n的取值范围很小,所以感觉dfs应该不会有很多种可能……#includeusingnamespacestd;longlongn;intk;vectorans;voiddfs(intx,longlongnow,intst){if(x==k&&now==n){for(inti=0;in)break;
weixin_34186931
·
2020-08-17 10:32
Educational
Codeforce
s Round 43 (Rated for Div. 2) ABCDE
A.MinimumBinaryNumbertimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputStringcanbecalledcorrectifitconsistsofcharacters"0"and"1"andtherearenoredundantleadingze
weixin_30559481
·
2020-08-17 10:52
Educational
Codeforce
s Round 48 (Rated for Div. 2) (ABCD题解)
比赛链接https://
codeforce
s.com/contest/1016A.DeathNote题目大意有一本死亡笔记,一页可以写mm个名字。
wang3312362136
·
2020-08-17 10:47
Codeforces
Educational
Codeforce
s Round 93 (Rated for Div. 2)ABCD
A.BadTriangle题意:问是否有不能组成三角形的情况思路:因为是有序的,所以用最小的两个和最大的组合查看是否是三角形即可传送门#includeusingnamespacestd;constintmaxn=5e4+100;intt;inta[maxn];intmain(){scanf("%d",&t);while(t--){intn;scanf("%d",&n);for(inti=1;ius
Dream-chasing ant
·
2020-08-17 10:14
--------【训练赛】
Codefoece Educational
Codeforce
s Round 83 (Rated for Div. 2)题解,(ABCDE)
比赛链接A题:思路:签到题。代码:#includeusingnamespacestd;typedeflonglongll;constintmaxn=2e5+50;intt,n,m;intarr[maxn];intmain(){ios::sync_with_stdio(false);cin>>t;while(t--){cin>>n>>m;if(nusingnamespacestd;typedeflo
V4yne.
·
2020-08-17 10:42
codeforce
题解
Educational
Codeforce
s Round 82 (Rated for Div. 2)(ABCDE部分题解)
AErasingZeroes直接模拟BNationalProject算出最后一轮前需要几轮,然后加上剩余需要的天数。最后判断一下是不是比n小,如果是就再多做几天。这题wa3发心态小崩#includeusingnamespacestd;intmain(){intT;cin>>T;while(T--){lln,g,b;cin>>n>>g>>b;lla=n;n=(n+1)/2;if(n==0){cout
_ 泛白
·
2020-08-17 10:42
练习
上一页
111
112
113
114
115
116
117
118
下一页
按字母分类:
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
其他