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~
Graph And Its Complement
CodeForce
s - 990D (思维)
D.GraphAndItsComplementtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputGiventhreenumbersn,a,bn,a,b.Youneedtofindanadjacencymatrixofsuchanundirectedgraphthat
JIA-YAO
·
2020-09-14 17:56
水题
Codeforce
s Round #548 (Div. 2)
A.EvenSubstringstimelimitpertest0.5secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenastrings=s1s2…sns=s1s2…snoflengthnn,whichonlycontainsdigits11,22,...,99.Asubstr
ccsu_deer
·
2020-09-14 17:24
codeforce题解
【DFS+思维】F1. Tree Cutting (Easy Version)
http://
codeforce
s.com/contest/1118/problem/F1F1.TreeCutting(EasyVersion)timelimitpertest2secondsYouaregivenanundirectedtreeofnnvertices.Someverticesarecoloredblue
Cherry_0525
·
2020-09-14 17:23
dfs
Educational
Codeforce
s Round 48 (Rated for Div. 2) D 1016D Vasya And The Matrix (构造)
D.VasyaAndTheMatrixtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputNowVasyaistakinganexaminmathematics.Inordertogetagoodmark,Vasyaneedstoguessthematrixthatt
ACMerszl
·
2020-09-14 17:23
Kefa and Dishes
CodeForce
s - 580D
传送门题目:WhenKefacametotherestaurantandsatatatable,thewaiterimmediatelybroughthimthemenu.Therewerendishes.Kefaknowsthatheneedsexactlymdishes.Butatthat,hedoesn'twanttoorderthesamedishtwicetotasteasmanydis
qq_2456160268
·
2020-09-14 17:52
ACM
dp
CodeForce
s - 873C Strange Game On Matrix(暴力+贪心)
题目链接:http://
codeforce
s.com/problemset/problem/873/CIvanisplayingastrangegame.Hehasamatrixawithnrowsandmcolumns.Eachelementofthematrixisequaltoeither0or1
永远鲜红の幼月
·
2020-09-14 17:52
贪心
bzoj、
codeforce
s、hdu等等的做题记录(更新中)
2019/5/29bzoj4240树状数组求逆序对+贪心(有个结论)(中)
codeforce
s1167F树状数组区间记录贡献(难)
codeforce
s1167E双指针思维记录前后缀(中)
codeforce
s1081E
Amo-
·
2020-09-14 17:47
做题记录
codeforce
s 1067F (Educational
Codeforce
s Round 65 (Rated for Div. 2) F. Scalar Queries ) 树状数组计算贡献
F.ScalarQueriestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenanarraya1,a2,…,ana1,a2,…,an.Allaiaiarepairwisedistinct.Let'sdefinefunctionf(l,r)f(
Amo-
·
2020-09-14 17:47
Codeforces
树状数组
计数
思维
Codeforce
s 873 B. Balanced Substring
题目链接:点击打开链接找出最长的平衡01串长度。思路,遇见一个1,sum++,遇见0,sum--;记录每一个的sum的位置,,dis[sum]=i;初始的时候把dis全部初始化为-1,如果当前dis[sum]=-1证明这个sum第一次出现,记录其出现的位置。如果当前did[sum]!=-1,那么证明这个sum,之前出现过,那么从之前那个位置到现在这个位置,中间的和为0,sum+0=sum证明中间是
xyry
·
2020-09-14 17:12
大三上学期训练
CF
字符串
Codeforce
s Round #497 (Div. 2)(暂时只有前三道)
Codeforce
sRound#497(Div.2)A.Romajitimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVityahasjuststartedlearningBerlaneselanguage.ItisknownthatBerlaneseusesthe
onlysky_yy
·
2020-09-14 17:41
codeforce
做题笔记
codeforce
【位运算】【
CodeForce
s】contest 1016 D Vasya And The Matrix
【题目】http://
codeforce
s.com/contest/1016/problem/D【题意】给定n行m列,每行每列的异或值,问能否有这样的矩阵【思路】除第一行第一列外全部填0,第一行填所有列的异或值
swqeaaa
·
2020-09-14 17:41
CodeForces
Codeforce
s Round #499 (Div. 2)D. Rocket
题目链接题目大意:二分查找答案,每次反馈答案偏大还是偏小,但反馈不一定正确。反馈正确性存在数组之中,每m个一次循环。思路:首先,要找出反馈正确性数组。对1进行m次询问,当且仅当反馈偏大时,该次反馈结果为错误。然后进行正常地二分查找#include#definelllonglong#defineIOS{ios::sync_with_stdio(0);cin.tie(0);}usingnamespac
lixuwei2333
·
2020-09-14 17:40
cf
交互题
codeforce
s 274B B. Zero Tree(树形dp)
题目链接:
codeforce
s题目大意:给出一棵树,每个点有权值,每次操作可以对一个联通子集中的点全部加1,或者全部减1,且每次操作必须包含点1,问最少通过多少次操作可以让整棵树每个点的权值变为0.题目分析
黎辰
·
2020-09-14 17:07
codeforces的dp专题
Codeforce
s#321 (Div. 2) D. Kefa and Dishes(DP,掩码)
D.KefaandDishestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputWhenKefacametotherestaurantandsatatatable,thewaiterimmediatelybroughthimthemenu.Therewerendis
luciozhang
·
2020-09-14 17:35
动态规划
Codeforces
acm
codeforces
dp
掩码
CodeForce
s - 1118F1 Tree Cutting (Easy Version) (树上dfs)
TreeCutting(EasyVersion)Youaregivenanundirectedtreeofnvertices.Someverticesarecoloredblue,somearecoloredredandsomeareuncolored.Itisguaranteedthatthetreecontainsatleastoneredvertexandatleastonebluevert
muyu__
·
2020-09-14 17:29
搜索
Codeforce
s 272D Dima and Two Sequences【思维+模拟】
D.DimaandTwoSequencestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputLittleDimahastwosequencesofpointswithintegercoordinates:sequence(a1, 1), (a2, 2), ...,
mengxiang000000
·
2020-09-14 17:56
数论&&组合数学
思维
CodeForce
s - 580D Kefa and Dishes
CodeForce
s-580DKefaandDishes状压dp,但是这不是关键,关键是ans我忘了是longlong了,然后%d输出的,整个代码改来改去一直WA在test7……WhenKefacametotherestaurantandsatatatable
mandiheyanyu
·
2020-09-14 17:24
Codeforce
s Round #582 (Div. 3) G. Path Queries 题解(种类并查集+kruskal的思想)
题目链接题目大意给你一棵树,求有多少条简单路径(u,v),满足u到v这条路径上的最大值不超过k。q次查询。(u#include#include#include#include#include#include#include#include#include#definefifirst#definesesecond#definedebugprintf("Iamhere\n");usingnamespa
_hunxuewangzi
·
2020-09-14 17:23
图论
codeforce
754-D(求最大k个重叠区间)
Allourcharactershavehobbies.ThesameistrueforFedor.Heenjoysshoppingintheneighboringsupermarket.Thegoodsinthesupermarkethaveuniqueintegerids.Also,foreveryintegerthereisaproductwithidequaltothisinteger.F
OJBFOWE
·
2020-09-14 17:23
codeforce
s 581C Developing Skills
Petyalovescomputergames.Finallyagamethathe’sbeenwaitingforsolongcameout!Themaincharacterofthisgamehasndifferentskills,eachofwhichischaracterizedbyanintegeraifrom0to100.Thehigherthenumberaiis,thehigher
SPZn_up
·
2020-09-14 17:51
====ACM=====
codeforce
s-597C-Subsequences【树状数组】
597C-Subsequencestimelimitpertest1secondmemorylimitpertest256megabytesForthegivensequencewithndifferentelementsfindthenumberofincreasingsubsequenceswithk + 1elements.Itisguaranteedthattheanswerisnotgr
宣之于口
·
2020-09-14 17:51
ACM_树状数组
codeforces
CodeForce
s - 803C 数学贪心
传送门:https://
codeforce
s.com/problemset/problem/803/C给一个n,要选k个严格递增的数字和等于n,且最大的公因数最大最大gcd也是n的因数,构造q*(a1+
二分抄代码
·
2020-09-14 17:50
贪心
codeforce
s1409F Subsequences of Length Two
https://
codeforce
s.com/contest/1409/problem/F艹怎么这题过了500多个人我不会做啊,写了个100多行的n^3贪心预处理然后n^3dp一直在wa最后其实设dp[
二分抄代码
·
2020-09-14 17:49
DP
Codeforce
s 651A Joysticks 【贪心】
题目链接:
Codeforce
s651AJoysticks题意:给定两个数n和m,你每次可以选择将其中一个数减2,另一个加1。直到两个数中至少有一个非正数停止,问最多可以执行的次数。
笑着走完自己的路
·
2020-09-14 17:24
贪心
codeforces
Codeforce
s Round #548 (Div. 2) (题解)
Codeforce
sRound#548(Div.2)(题解)A.EvenSubstrings题目大意给出一条数字字符串,问其有多少数字子串使其代表的数字为偶数解题思路从前向后遍历,若第i未偶数,则答案增加
Flyppy_White
·
2020-09-14 17:19
套题题解
codeforce
Codeforce
s 500E New Year Domino
E.NewYearDominotimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputCelebratingthenewyear,manypeoplepostvideosoffallingdominoes;Here'salistofthem:https://www.you
acerlawson
·
2020-09-14 17:45
codeforces
Codeforce
s Round #548 (Div. 2) 题解
题目链接http://
codeforce
s.com/contest/1139A.EvenSubstrings判断个位是否是奇数即可。
a1214034447
·
2020-09-14 17:45
题集
树状数组
DP
数学期望
二分匹配
数据结构
思维题
离线
Codeforce
s 900D-Unusual Sequences
UnusualSequencestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputCountthenumberofdistinctsequencesa1, a2, ..., an(1 ≤ ai)consistingofpositiveintegerssuchthatg
Wang_128
·
2020-09-14 17:13
Codeforces
----容斥
CodeForce
s 140 E.New Year Garland(组合数学+dp)
Descriptionn排,第i排li个位置,现在要给所有位置用m种颜色上色,需要满足:1.每一排相邻位置不同色2.相邻排所用颜色集不同问方案数,结果模pInput第一行三个整数n,m,p,之后输入n个整数li(1≤n,m≤106,2≤p≤109,1≤li≤5000,∑i=1nli≤107)Output方案数,结果模pSampleInput321000312SampleOutput8Solutio
v5zsq
·
2020-09-14 17:07
Code
Forces
组合数学
dp
CodeForce
s 611 C. New Year and Domino(dp+容斥)
Description一个只有’.’和’#’组成的h*w的图,一根木棍需要放在两个连续的’.’上,现在有n次查询,每次查询点[r1,c1]到[r2,c2]的矩形区域中有多少种放木棍的方法Input第一行两个整数h和w表示矩形行列数,之后为一h*w矩阵,然后是一整数n表示查询数,最后n行每行四个整数r1,c1,r2,c2表示查询区间(1#include#include#includeusingnam
v5zsq
·
2020-09-14 17:36
Code
Forces
dp
组合数学
Codeforce
s 985C 贪心
C.Liebig'sBarrelstimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouhavem = n·kwoodenstaves.Thei-thstavehaslengthai.Youhavetoassemblenbarrelsconsistingofkst
PiscesCrab
·
2020-09-14 17:33
【
codeforce
s #295(div 1)】ABC题解
很慢得速度做完了A;B一直WA,考完才发现读错题了;考完发现C也很简单。。先说A题:A.DNAAlignmenttimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputVasyabecameinterestedinbioinformatics.He'sgoingtowri
Regina8023
·
2020-09-14 17:33
~Contests~
codeforce
s 900d Unusual Sequences
题意:要求任意长度的数组,使得其和为x,每个元素gcd=y,求这样数组的数量。首先,由于每个元素可表示为x[i]*y,所以如果x%y!=0,那么这样的情况是不合法。所以我们可以将问题转化为求数组元素和为x/y,gcd=1的数组数量。由插板法可以得到和为x的数字共有2的x-1次方-1个情况。接着我们可以容斥,减去其含有的每一个因数出现的次数,由于原数的因数的因数还是原数的因数,所以记忆化搜索+递归实
Rising_shit
·
2020-09-14 17:02
数位dp
容斥原理
codeforce
s 274B Zero Tree(树形dp)
题意:给出一棵树,然后每个节点有个值vi,每次操作包含1这个节点的子树,操作内容是这颗子树的所有节点+1或-1.问最小的操作数使得树各个点变成0.题解:dp[u][3]0表示操作数,1表示子节点操作完这个节点还剩多少需要操作。每次都要累加dp[u][1]的值。2是个中间变量。可惜这样做事错的,明天再看看如何解决。wa的代码:#include#include#include#include#incl
My_ACM_Dream
·
2020-09-14 17:30
动态规划—树形dp
动态规划
codeforces
codeforce
s Unusual Sequences (数论)
D.UnusualSequencestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputCountthenumberofdistinctsequencesa1, a2, …, an(1 ≤ ai)consistingofpositiveintegerssuchthatg
黑码
·
2020-09-14 17:29
思维
莫比乌斯函数
容斥原理
Educational
Codeforce
s Round 53: E. Segment Sum(数位DP)
题意:给你三个数字L,R,K,问在[L,R]范围内有多少个数字满足它每一位不同数字不超过k个,求出它们的和思路:明显的数位DP了,套路都一样,不过这道题是记权值而不是满足条件的数字个数,所以还需要再开一个计贡献数组dp[len][x][sum]表示当前有len位数字还不确定,在此之前0~9每个数字出现的状态为x,已经有sum个不同数字的方案个数#include#include#include#in
Jaihk662
·
2020-09-14 17:27
#
动态规划
codeforce
719b 贪心
点击打开链接n个蝗虫,共两种颜色,要求摆出rbr...或者brb...这种交错的样子,可以交换任意俩,或者改变一个的颜色,求操作最小次数。//变换后的序列要么位brbr...要么位rbrb...//原序列和最终序列的某个位置不同这个位置就肯定要操作一次//统计错位位置//若和b错位位置有5个,和r错位位置有3个则应该交换3次改变两次即可#include#include#include#includ
Masamiiiii
·
2020-09-14 17:56
Binary
Search
&&
Greedy
CODEFORCES_
codeforce
s 900D Unusual Sequences (数论)
D.UnusualSequencestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputCountthenumberofdistinctsequencesa1, a2, ..., an(1 ≤ ai)consistingofpositiveintegerssuchtha
进修中的涵涵涵
·
2020-09-14 17:55
codeforces
组合数学
codeforces
数论
codeforce
s 743 D. Chloe and pleasant prizes(DFS)
D.Chloeandpleasantprizestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputGeneroussponsorsoftheolympiadinwhichChloeandVladiktookpartallowedalltheparticipantst
HandsomeHow
·
2020-09-14 17:25
搜索
codeforce
s900D Unusual Sequences
D.UnusualSequencestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputCountthenumberofdistinctsequencesa1, a2, ..., an(1 ≤ ai)consistingofpositiveintegerssuchtha
C_K_Y_
·
2020-09-14 17:23
数学
dp
Educational
Codeforce
s Round 45 (Rated for Div. 2) D. Graph And Its Complement
D.GraphAndItsComplementtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputGiventhreenumbersn,a,b.Youneedtofindanadjacencymatrixofsuchanundirectedgraphthatthenu
风中一颗松
·
2020-09-14 17:23
Codeforces
Codeforce
s 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
构造
Codeforce
s Round #548 (Div2)
Codeforce
sRound548(Div.2)题目地址A.EvenSubstrings题目大意:大概就是让你找到所有的偶数,然后让你累加这个偶数及之前的所有数的个数#includeusingnamespacestd
橘子灬君
·
2020-09-14 17:51
ACM
G. Path Queries(带权并查集+kruskal思想)
https://
codeforce
s.com/problemset/problem/1213/G题意翻译题目描述\mathsfE\color{red}\mathsf{ntropyIncreaser}EntropyIncreaser
小菜鸡加油
·
2020-09-14 17:51
思维
最小生成树
并查集
F1. Tree Cutting (Easy Version)(思维+树dfs)
https://
codeforce
s.com/problemset/problem/1118/F1题意翻译给一棵树,每一个节点都是红色,蓝色或者无色。
小菜鸡加油
·
2020-09-14 17:20
思维
树的dfs
Codeforce
s Round #548 (Div. 2) C. Edgy Trees(并查集)
C.EdgyTreestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenatree(aconnectedundirectedgraphwithoutcycles)ofnvertices.Eachofthen−1edgesofthetreeisc
totororz
·
2020-09-14 17:19
Codeforce
s Round #670 (Div. 2)(A-D详解)
A:SubsetMexB:MaximumProductC:LinkCutCentroidsD:ThreeSequences
小菜鸡加油
·
2020-09-14 17:19
codeforces
D. Vasya And The Matrix(位运算+矩阵构造)
https://
codeforce
s.com/problemset/problem/1016/D一个矩阵,你知道每行,每列异或后的结果,然后还原这个矩阵,如果不能还原输出NO。
小菜鸡加油
·
2020-09-14 17:19
构造
思维
位运算
Codeforce
s 900D (
Codeforce
s Round #450 Div. 2) Unusual Sequences 容斥定理
D.UnusualSequencestimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputCountthenumberofdistinctsequencesa1, a2, ..., an(1 ≤ ai)consistingofpositiveintegerssuchtha
VampireWeekend
·
2020-09-14 17:13
计数问题
Codeforce
s Round #100E. New Year Garland【DP】
E.NewYearGarlandtimelimitpertest5secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputAsGerald,Alexander,SergeyandGennadyarealreadybusywiththeusualNewYearchores,Edwardhastilydeco
kmlver
·
2020-09-14 17:12
上一页
57
58
59
60
61
62
63
64
下一页
按字母分类:
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
其他