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 Gym 101234H Split Game
按极角扫描,显然只有经过端点的时候数量才会改变。大力讨论一下,注意区分“转到这个点就改变”和“转过这个点才改变”两种情况。#include#include#includeusingnamespacestd;#defineLLlonglongconstintmaxn=200010,eps=1e-8;structVector{LLx,y;voidrd(){scanf("%I64d%I64d",&x,&
sdfzyhx
·
2020-08-24 23:01
数学
codeforces
codeforce
s Gym - 101190A——Abbreviation
http://
codeforce
s.com/gym/101190/attachments恶心的模拟题,队友写的代码。
say_c_box
·
2020-08-24 23:57
算法
模拟
Codeforce
s Global Round 10 E Omkar and Duck
OmkarandDuck题目链接题目大意这是一个交互题,你先给出一个矩阵,然后输入权值,这个权值是矩阵中(1,1)点到(n,n)点的路径上的权值和。让你输出这个路径。所以要保证每种走法的路径权值和都不一样。题解做的时候想到了,可能的权值是0~x(x是走法的数量)。但是不会构造,,画了好多,没构造出来。。其实只要让x步后所能到达每个点的权值范围都不一样即可。x步能到达的点就是左下到右上对角线上的点。
李wa
·
2020-08-24 23:42
做题笔记
CodeForce
s - 514D-R2D2 and Droid Army(RMQ+二分)
题目链接:https://vjudge.net/problem/
CodeForce
s-514D题目大意:现在有一排机器人(n个),每个机器人有m个属性,你可以选择一种属性进行攻击,使所有机器人的这一属性都减
小鱼yn
·
2020-08-24 23:39
RMQ
字符串哈希(应用)
【求取字符串某长度的本质不同子串数量】:POJ1200CrazySearch(单哈希)
CodeForce
s271DGoodSubstrings(双哈希)先枚举获取所有的定长子串的hash值,排序去重后的数据个数就是答案
Zery_
·
2020-08-24 23:07
ACM——字符串
Codeforce
s Good Bye 2019 G. Subset with Zero Sum
题意:给出n个整数a,a2,a3...ana_,a_2,a_3...a_na,a2,a3...an,1≤i≤n1≤i≤n1≤i≤n,i−n≤i−1i-n≤i-1i−n≤i−1,现在需要你找出任意一个子序列使这个子序列的和为0题解:首先注意到i−n≤ai≤i−1i-n≤a_i≤i-1i−n≤ai≤i−1,那么1≤i−ai≤n1≤i-a_i≤n1≤i−ai≤n考虑构造一个点数为n的有向图,建iii和i
Nightmare丶
·
2020-08-24 22:32
思维题
Codeforce
s Good Bye 2019 E. Divide Points
题意:给出n个点,将这些点分成两个集合,使得没有任何属于同集合的两点的欧几里得距离等于不同集合两点的欧几里得距离,集合非空,输出任意一个集合的个数和该集合所有点的下标题解:偷偷用cf的题解水一篇题解应该没人发现吧(我们将点按x,y的奇偶分成4组,A00A_{00}A00表示x,y均为偶数…A01,A10,A11A_{01},A_{10},A_{11}A01,A10,A11同理。首先如果所有点都属于
Nightmare丶
·
2020-08-24 22:32
思维题
GDUT 第一次组队赛 Team up! Team up! Team up!(三,dp,dfs)
题目提交网站:http://
codeforce
s.com/group/NVaJtLaLjS/contest/241520ProblemA—limit2secondsMillionaireCongratulations
*Slime*
·
2020-08-24 22:59
训练赛
Codeforce
s Round #223 (Div. 1) C. Sereja and Brackets 离线树状数组
C.SerejaandBrackets题意:给你一个只包含'('和')'的字符串,由m个询问,每次询问给定一个区间,求区间内'('和')'匹配的个数。思路:观察发现每个')'匹配的’(’的位置是一定的,我们可以将每一个与之匹配的‘(’的位置保存起来,将询问按照右端点排序。边更新边查询,在区间范围内被标记点的个数即为括号匹配的对数。(因为在存位置时保存的是与右括号‘)’匹配的左括号'('的位置,更新
柒月 流火
·
2020-08-24 22:48
数据结构-----树状数组
思维
Codeforce
s Round #279 (Div. 2) C.Hacking Cypher
C.HackingCypher题意:给你一个由数字0~9组成的字符串(最大长度为1000000个字符),给你两个数字a和b(1#include#include#include#include#include#include#include#include#include#include#include#include#include#include#definemod1000000007using
柒月 流火
·
2020-08-24 22:18
思维
Codeforce
s Round #279 (Div. 2) C.Hacking Cypher 找规律
C.HackingCypher题意:给你一个区间[L,R],求区间内任意两个数相异或的最大值。题解:1000012000103000114001005001016001107001118010009010011001010110101112011001301101140111015011111610000找规律可以发现任意区间[L,R]内相异或最大的值为L和R的二进制中最高的不相同的位置起(包含这
柒月 流火
·
2020-08-24 22:18
思维
几道dp
http://
codeforce
s.com/problemset/problem/553/A题意:一串球,每种颜色的球有ci个,并且根据安排,前一种颜色的最后一个球需要放在后一种球最后一个前面,求方案数
yyPurpose_forever
·
2020-08-24 22:41
动态规划
codeforce
s980e(倍增、贪心|| 树的dfs序差分+树状数组)
E.TheNumberGamestimelimitpertest3secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputThenationofPanelholdsanannualshowcalledTheNumberGames,whereeachdistrictinthenationwillberepr
yyPurpose_forever
·
2020-08-24 22:41
贪心
数据结构
codeforce
s 869c(组合数)
C.TheIntriguingObsessiontimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutput—Thisisnotplayingbutdutyasalliesofjustice,Nii-chan!—Notalliesbutjusticeitself,Onii-ch
yyPurpose_forever
·
2020-08-24 22:41
数论
数学
codeforce
s 159D D. Palindrome pairs( manacher+dp )
题目链接:
codeforce
s159D题目大意:给出一个字符出,求取这个字符串中互相不覆盖的两个回文子串的对数。
黎辰
·
2020-08-24 22:38
codeforces的dp专题
Pasha and Stick
Codeforce
s 610A
DescriptionPashahasawoodenstickofsomepositiveintegerlengthn.Hewantstoperformexactlythreecutstogetfourpartsofthestick.Eachpartmusthavesomepositiveintegerlengthandthesumoftheselengthswillobviouslyben.Pa
q923714892
·
2020-08-24 22:16
基础水题
Codeforce
s Round #320 (Div. 2) B. Finding Team Member
timelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputThereisaprogramingcontestnamedSnakeUp,2npeoplewanttocompeteforit.Inordertoattendthiscontest,peopleneedtoform
miao_2cm
·
2020-08-24 22:07
杂七杂八
codeforces
codeforce
s - 735C -
LINK:http://
codeforce
s.com/contest/735/problem/C题意:有n个人比赛,比赛规则是淘汰制,而且一个人只能和和他比赛次数相差1以内的人比,问赢的人最多比了几场。
horihori_
·
2020-08-24 22:33
codeforces
Codeforce
s Round #337 (Div. 2) A. Pasha and Stick (水)
A.PashaandSticktimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPashahasawoodenstickofsomepositiveintegerlengthn.Hewantstoperformexactlythreecutstogetfourpart
AnICoo1
·
2020-08-24 22:58
技巧
CodeForce
s Gym 100803A 模拟,贪心
模拟,贪心的搞,从第一位开始,如果需要交换就从后面找个最近的交换就行#include#include#include#include#include#include#include#includeusingnamespacestd;#definelllonglong#definemaxn100005intN,M;ints1[20];ints2[20];ints3[20];intmain(){//f
sky-edge
·
2020-08-24 21:19
模拟题
CodeForces
CodeForce
s Gym 100735E
给你一个矩阵,他们本来是,每行,每列,两条对角线,的和都是一样的,现在把主对角线的元素都挖去,让你求主对角线上各是什么以5*5举例吧,假设为a,b,c,d,e,每行的和是sum,然后将所有行加起来就有,a+b+c+d+e+4sum=5sum,然后sum就能求出来,然后根据每行和为sum,所以每行的那个未知数就能求出来,然后就可以了#include#include#include#include#i
sky-edge
·
2020-08-24 21:19
水题
CodeForces
Codeforce
s 610A Pasha and Stick 【水题】
A.PashaandSticktimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPashahasawoodenstickofsomepositiveintegerlengthn.Hewantstoperformexactlythreecutstogetfourpart
笑着走完自己的路
·
2020-08-24 21:43
codeforces
水题
Codeforce
s gym 101350F 想法
MonkeyingAroundtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputWhenthemonkeyprofessorleaveshisclassforashorttime,allthemonkeysgobananas.Nmonkeysarelinedupsi
black_miracle
·
2020-08-24 21:26
想法
ZeptoLab Code Rush 2015
源地址:http://
codeforce
s.com/contest/526最近做题实在是没有感觉,,略颓废。。
ThinkingLion
·
2020-08-24 21:59
codeforces
【
codeforce
s】gym 101741 A - Three Arrays(二分做法)
题目链接http://
codeforce
s.com/gym/101741/problem/A题目大意给定三个序列a,b,c都是从小到大依次排列然后问你有多少个三元组(i,j,k)满足|a[i]- b[j
Tannidy
·
2020-08-24 21:27
二分
CodeForce
s 762C Two strings
今天补一下前天的一道题,我果然是太菜了TAT题面如下:C.TwostringsYouaregiventwostringsaandb.Youhavetoremovetheminimumpossiblenumberofconsecutive(standingoneafteranother)charactersfromstringbinsuchawaythatitbecomesasubsequenceo
Messhiro
·
2020-08-24 21:33
题解
Codeforce
s D1/D2. Prefix-Suffix Palindrome (字符串hash) /详解
D1.Prefix-SuffixPalindrome(Easyversion)D2.Prefix-SuffixPalindrome(Hardversion)题意:对于给出的字符串,可截取其前缀和后缀,求能组成的最长回文串。思路:正常来说暴力的思路是先匹配前缀pre和后缀suf,找到第一个不匹配的l和r,然后在由l开始从左向右求最长的回文串palindrome,以及由r开始从右向左求最长的回文串pa
我不会DP
·
2020-08-24 21:49
Codeforce
s Gym 101142 F. Folding
题意对于原W×H的矩形纸,最少折叠几次能成为w×h的矩形纸片。解题思路反向模拟,w×h的纸张展开一次最大变成2w×h或w×2h,判断最小几次使得w>=W且h>=H即可。需要注意的是纸张可以展开,故长宽可对调。代码#includeusingnamespacestd;constintINF=1e9+7;longlongW,H;intsolve(longlongw,longlongh){if(w>W||
ffutop
·
2020-08-24 21:32
Codeforces
Gym
[
Codeforce
s17E]Palisection
题意求一个字符串的所有有交集的回文子串有多少对题解直接做貌似是做不了的,考虑到正难则反我们设回文串的总数是sumsum⇒ans=(sum2)−⇒ans=(sum2)−没有交集的回文串对数考虑怎么算没有交集的回文串对数我们考虑答案可以是∑i∑i以ii结尾的回文串个数×i×i后面的回文串个数以ii结尾的回文串个数就是ii这个点在failfail树上的深度ii后面的回文串个数=∑j>i=∑j>i以jj开
Kelin__
·
2020-08-24 21:48
回文自动机
CodeForce
s Gym100935 水题专场
CodeForce
sGym100935比赛链接:
CodeForce
sGym100935ATime水题~#include#include#include#include#include#include#include
Xingw-Xiong
·
2020-08-24 21:38
ACM____套
题
ACM____水
题
【解题总结】SWERC 2019(
Codeforce
s Gym 102501)
我解决的:B(1WA)、I、J、A(3WA)、D(1WA,1TLE)。没看的:无。旁观的:C、F、K、G、H。看了但没做出来的:E、L。IRats简单题,略。BBiodiversity简单题,略。CAnts简单题,略。AEnvironment-FriendlyTravel最短路,略。本来应该一次过的题目,但写错了好几个地方,简直丢人。FIcebergs题意:给定几个简单多边形,计算其面积的和。计算
zqy1018
·
2020-08-24 21:05
解题总结
关于
codeforce
s的比赛规则
Codeforce
s简称:cf(所以谈论cf的时候经常被误会成TX的那款游戏).网址:
codeforce
s.com这是一个俄国的算法竞赛网站,由来自萨拉托夫州立大学、由MikeMirzayanov领导的一个团队创立和维护
Top_Spirit
·
2020-08-24 21:21
知识点
acm
codeforces
codeforce
1368C. Even Picture
このせかい悪くない要求灰色色块之间连通每个灰色色块都要有偶数个灰色色块相邻(共边)只有n个色块,其周围4个色块均为灰色日渐沉迷水题无法自拔待我数位板到了补个图如果还能记起来的话#pragmaGCCdiagnosticerror"-std=c++11"#include#defineINF0x3f3f3f3f#definelllonglong#definePairpair#definerereturn
white_156
·
2020-08-24 18:47
codeforces
Codeforce
s 28D
l+r+c相同的列车才能一起mp[i][j]表示l+r+c=i&&l=j的最大权的位置#include#include#include#includeusingnamespacestd;constintN=1e5+100;structP{intv,c,l,r,s;}p[N];intsta[N],top;intsta1[N],top1;mapmp[N];intpre[N];intmain(){#if
After0514
·
2020-08-24 18:40
dp
拓扑排序入门
话不多少,例题来见
CodeForce
s-510CFoxCielis
回忆过往-静夜思-勿颓废
·
2020-08-24 17:23
Codeforce
s - D. Make The Fence Great Again
D.MakeTheFenceGreatAgaintimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouhaveafenceconsistingofnverticalboards.Thewidthofeachboardis1.Theheightofthei-thbo
青烟绕指柔!
·
2020-08-24 17:43
Codeforces
动态规划
Codeforce
s 1005D(dp)
传送门题面:D.PolycarpandDiv3timelimitpertest3secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPolycarplikesnumbersthataredivisibleby3.Hehasahugenumberss.Polycarpwantstocutfromitth
Chen_Jr_
·
2020-08-24 17:04
CodeForces
思维
dp
Codeforce
s Round #257 (Div. 2) D题:Jzzhu and Cities 删特殊边的最短路
D.JzzhuandCitiestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputJzzhuisthepresidentofcountryA.Therearencitiesnumberedfrom1toninhiscountry.City1isthecapitalo
zzm_
·
2020-08-24 17:28
CodeForce
s 28D Don't fear, DravDe is kind dp
主题链接:点击打开链接为了让球队后,删除是合法的。也就是说,对于每一个车辆,l+r+c一样,按l+r+c分类。然后dp一下。#include#include#include#include#include#include#include#includeusingnamespacestd;#definellint#defineN100005structnode{intv,c,l,r;intnum;}
weixin_34194317
·
2020-08-24 17:01
[
Codeforce
s 28D] Do not fear,DravDe is kind
BriefIntro:对于四元组(v,c,l,r),求其子序列中v最大的和,并使其满足:1、Ci+Li+Ri相同2、L1=0,Rn=03、Li=Sigma(C1...Ci-1)Solution:算是有条件约束的DP吧设dp[k]为选到k且选k的最大值对于每个条件,我们这样处理:1、将所有数据按Ci+Li+Ri的和进行分组处理2、当Li=0时,将其视为起点;当Ri=0时,用dp[i]去更新res3、
weixin_30340617
·
2020-08-24 16:13
Codeforce
s546C:Soldier and Cards
DescriptionTwoboredsoldiersareplayingcardwar.Theircarddeckconsistsofexactlyncards,numberedfrom1ton,allvaluesaredifferent.Theydividecardsbetweentheminsomemanner,it’spossiblethattheyhavedifferentnumbero
wb129945130
·
2020-08-24 16:25
ACM-数据结构
CodeForce
s 986A-Fair 最短路
题目大意在无向无权连通图G=中,每一个结点都有一个不超过k的编号(保证1~k每个编号至少出现一次)。试求从每一个结点出发,遍历到k个编号中的s个所需要经过的最短路径之和。数据范围1#include#include#include#include#include#includeusingnamespacestd;intn,m,k,s;vectorG[100008];intdist[100008][1
Heart_Taylor
·
2020-08-24 16:02
White Lines
CodeForce
s - 1200D (前缀和,思维)
题目大意给定一个n*n的红黑格子,然后你可以选一个点把以这个点为左上角的k*k的区域都变为白的,问最多多少个一行或一列都为白。思路前缀和思路,预处理出每一行的前缀和cr[i][j],然后对每一行来说,在算一个每个黑格的贡献,贡献就是如果涂白这行j到j+k-1的网格这行变为全白,那么这个格子的贡献就为1(c[i][j]==1),每一列同样的预处理,之后求出每个c[i][j]对于行的前缀和,这样就可以
sunmaoxiang
·
2020-08-24 16:14
莫队
题目链接:
CodeForce
s-617E题目描述:Bobhasafavoritenumberkandaioflengthn.Nowheasksyoutoanswermqueries.Eachqueryisgivenbyapairliandriandasksyoutocountthenumberofpairsofintegersiandj
qqxqhd0YiEcu1Wzp
·
2020-08-24 15:50
莫队算法
codeforce
s 1221D DP
个人博客链接:https://blog.nuoyanli.com/2020/03/25/cf1221d/链接https://
codeforce
s.com/problemset/problem/1221/
nuoyanli
·
2020-08-24 15:32
ACM
#
DP
#
codeforces
codeforce
s 731C (并查集 水)
题目链接:点击这里题意:给出n只袜子的颜色,每天选择两只袜子,每次能把一只袜子染色。问最少染色几只袜子能使的每天的袜子颜色一样。给每天穿的两只袜子连边,很显然一个分量的袜子要一起考虑,并查集维护分量就好了。然后搜出最多的颜色,把分量的点都染成这个颜色即可。#include#include#include#include#include#includeusingnamespacestd;#defin
morejarphone
·
2020-08-24 15:14
并查集
codeforce
s 28C (概率DP)
题目链接:点击这里题意:m个房间n个人,每个人随机走进一个房间,每个房间排ai个队伍,走进这个房间的人平均排队,问最长的一个队伍的长度期望。用dp[i][j][k]表示i个房间剩下j个人最长队伍是k的概率。转移的时候就枚举当前房间的人数,概率乘上所有剩下的人中选择这么多人并且他们都进这个房间的概率.期望就是∑ni=1dp[m][0][i]∗i。#include#include#include#in
morejarphone
·
2020-08-24 15:14
概率DP
CodeForce
s-740A (分类)
题目:http://
codeforce
s.com/problemset/problem/740/A题意:给定n,a,b,c分别表示:目前已经买了n本书书的价格:a元可买1本书,b元可买2本书,c元可买3
旷野虽远
·
2020-08-24 15:42
codeforces
Codeforce
s 182 div2
退役好久了,闲来无事,和wiking大神solo了一盘CF,稍微写下解题报告。ProblemA水题。#include#include#include#include#includeusingnamespacestd;inta[200005];intmain(){inti,j,n,m,x,y,p,q;scanf("%d%d",&n,&m);x=y=0;for(i=0;i=(q-p+1)/2&&y>=
magicnumber
·
2020-08-24 15:53
Codeforce
s #664(Div.2) A~C
A题题解的方案挺好的要形成回文,最后的r,g,b,w中,三偶一奇或者全为偶两步:1、验证初始的r,g,b,w是否满足2、验证变色一次后的r,g,b,w是否满足(前提r>0,g>0,b>0)(变色两次(>0偶次)后,所有数字的奇偶没有变,没有意义变色三次(>1奇次)后,得到的数字的奇偶与变一次相同,没意义)B题C题c1|c2…cn=A,则,对任意的i(1~n),ci|A=A枚举ans[0,511],
雷德梅恩
·
2020-08-24 15:19
Codeforces
上一页
83
84
85
86
87
88
89
90
下一页
按字母分类:
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
其他