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
sscanf用法总结
在做
codeforces
题目时,突然发现sscanf()函数非常有用,就顺便从网上搜集资料整理一下。
bggl
·
2020-08-21 10:47
算法题目练习与总结
codeforce 402A - Nuts
题目链接:http://
codeforces
.com/problemset/problem/402/A题目大意:每个盒子可由x块挡板分为x+1节,但每个盒子不能超过k节,每节不能放超过v个坚果,现在有a
sstrawberry
·
2020-08-21 07:48
Water~~~
Simulation
CodeForces
- 282A Bit++ (水)
CodeForces
-282ABit++TimeLimit:1000MSMemoryLimit:262144KB64bitIOFormat:%I64d&%I64uSubmitStatusDescriptionTheclassicprogramminglanguageofBitlandisBit
没有能与不能只有想与不想
·
2020-08-21 07:49
codeforces
Problem--282A--
Codeforces
--BIt++
BIt++timelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputTheclassicprogramminglanguageofBitlandisBit++.Thislanguageissopeculiarandcomplicated.Thelanguageisthatpe
小兔叽的甜甜圈
·
2020-08-21 04:54
Codeforces
Codeforces
Round #173 (Div. 2) A.Bit++
好久没做题了,最近又开始做了一些题,找找感觉,从最简单的开始,A.Bit++TheclassicprogramminglanguageofBitlandisBit++.Thislanguageissopeculiarandcomplicated.Thelanguageisthatpeculiarasithasexactlyonevariable,calledx.Also,therearetwoop
ACLegend
·
2020-08-21 04:24
字典树_异或和
(
CodeForces
-94
A黄橙橙
·
2020-08-21 04:20
Bit++
TimeLimit:2000MSMemoryLimit:262144KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForces
282ADescriptionTheclassicprogramminglanguageofBitlandisBit
weixin_30799995
·
2020-08-21 02:20
Codeforces
Round #532 (Div. 2) F. Ivan and Burgers(前缀线性基)
题目链接:https://
codeforces
.com/contest/1100/problem/F题目思路:本题属于前缀线性基裸题,对前缀线性基了解较少的可以点这里。
我不管这题我就是不会做
·
2020-08-21 01:41
algorith
CodeForces
- 1100F:Ivan and Burgers 线性基 在线
题意:给定N个数,Q次询问,求区间最大异或和。我们纪录一个前缀和线性基,保留最大的位置。#include#definelllonglongusingnamespacestd;constintmaxn=1e6+4;intpos[maxn][33],base[maxn][33],ps[33],bs[33];voidadd(intx,intid){for(inti=20;i>=0;i--){if(x&(
wym_king
·
2020-08-21 01:40
cf
线性基
【
CodeForces
- 124D】Squares (旋转坐标系,计算几何,思维)
题干:Youaregivenaninfinitecheckeredfield.Youshouldgetfromasquare(x1;y1)toasquare(x2;y2).Usingtheshortestpathisnotnecessary.Youcanmoveonthefieldsquaresinfourdirections.Thatis,whenyouarepositionedinanysqu
韬光养晦_
·
2020-08-21 01:36
计算几何
Codeforce~
思维
【NCPC2017-2018-gym101572-A.Airport Coffee 】 线段树+分类讨论DP
AirportCoffee题目链接:https://
codeforces
.com/gym/101572/problem/ADescriptionInputOutputSampleInput100000100138603005500020000500005500075000SampleOutput203
lajiyuan_
·
2020-08-21 01:26
Codeforces
DP
线段树
【
Codeforces
Round #532 (Div. 2) F. Ivan and Burgers】离线+线性基
F.IvanandBurgers题意n个数,q次询问,每次询问一个区间内选出任意个数的异或最大值。1<=n<=5∗1051<=n<=5*10^51#include#includeusingnamespacestd;constintmaxn=5e5+5;inta[maxn],pos[maxn];boolinsert_(intval,intp){for(inti=20;i>=0
lajiyuan_
·
2020-08-21 01:55
离线问题
线性基
离线
线性基
Codeforces
Codeforces
626G
注意到在同一堆中放彩票的贡献是单调递减的,因此如果没有修改,可以用堆贪心求出最大期望收益。考虑修改操作,如果将lkl_klk减小111,在第kkk堆放的数目可能不变,减小111(原先放了lkl_klk张),或是增加若干张。我们断言若增加,只会增加111张,证明是假设原先放了ccc张,现在若放了c+2c+2c+2张以上,那么第c+2c+2c+2张一定替换了其他堆的某张彩票,设那张彩票的贡献为www,
mayaohua2003
·
2020-08-21 01:22
集训队作业
codeforces
贪心
Codeforces
359B Permutation
B.Permutationtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputApermutationpisanorderedgroupofnumbersp1, p2, ..., pn,consistingofndistinctpositiveinteger
shyoldman
·
2020-08-21 01:40
就当它是水题吧
2017-2018 ACM-ICPC Southeast Regional Contest (Div. 1) H.Security Badges 区间双重合
http://
codeforces
.com/gym/101617题意:这个老板想检查自己酒店的安全性,他的手下有一些保安,每个保安有自己一个特有的带有标号的勋章,房间与房间之前有门相连。
twh233
·
2020-08-21 01:14
CodeForces
Gym101550E Exponial
Problem:F(n)=nF(n−1)modmIdea:欧拉定理降幂公式:abmodp=aϕp+bmodϕpmodp(b≥ϕp)Code:#includeusingnamespacestd;#definefifirst#definesesecond#definepbpush_back#defineCLR(A,X)memset(A,X,sizeof(A))#definebitcount(X)__b
Toooooocold
·
2020-08-21 01:10
数论-降幂公式
codeforces
上一种应对大测试数据debug方法
接触
codeforces
时间不长,也就参加了10场左右。
imbaLIHE
·
2020-08-21 01:23
两道交互题
http://
codeforces
.com/contest/810/problem/D一直感觉交互题很有意思呀;在1…..n中选了k个数字我们猜xy机器选择最接近x的数a和最接近y的数b如果|x-a||
yuhaoyuan……
·
2020-08-21 01:00
CodeForces
1131B Draw!
https://
codeforces
.com/problemset/problem/1131/BDescriptionYoustillhavepartialinformationaboutthescoreduringthehistoricfootballmatch.Youaregivenasetofpairs
北区以北
·
2020-08-21 01:21
NCPC2017E(MST)
题目链接:http://
codeforces
.com/group/Us3rfLfgWv/contest/101572orz这么看都不可能想到MST吧。。
qkoqhh
·
2020-08-21 01:50
MST
2017-2018 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2017)(solve7/11)
题目链接:http://
codeforces
.com/gym/101572B题题意:给你n个人的第一棒的速度和其他棒的速度,然后让你输出最快的那个组合,输出时间和人。
passer__
·
2020-08-21 01:17
第十九次
codeforces
竞技结束 #275 Div 1
A.DiversePermutationtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPermutationpisanorderedsetofintegersp1, p2, ..., pn,consistingofndistinctpositivein
糖果天王
·
2020-08-21 01:06
Coding
Competition
Codeforces
题解整合【按照场次】
Codeforces
Round#383(Div.2)【A.B.C.D.E】:http://blog.csdn.net/mengxiang000000/article/details/53503168http
mengxiang000000
·
2020-08-21 00:16
codeforces
1344B Monopole Magnets
https://
codeforces
.com/contest/1344/problem/B分情况讨论1.如果一行没有黑色,那么说明这一行是不能到达的,但是又必须放一个S,那么必须要有一列也全是白色,才能放下这个
二分抄代码
·
2020-08-21 00:21
CodeForces
——1100F Ivan and Burgers(线性基)
Ivanlovesburgersandspendingmoney.TherearennburgerjointsonthestreetwhereIvanlives.Ivanhasqqfriends,andtheii-thfriendsuggestedtomeetatthejointliliandwalktothejointriri(li≤ri)(li≤ri).Whilestrollingwithth
lgz0921
·
2020-08-21 00:49
数论
【
Codeforces
1100 F Ivan and Burgers 】线性基
F给你n个数q次询问问你这q次区间内能异或的最大值异或的最大值我们容易想到线性基但是要区间内我们不能暴力扫区间构造所以我们把问题离线了再去做将询问按照r的升序排序那么按顺序插入1-r的数目构造线性基然后记录一下pos我们每个线性基优先取右边的这样查询的时候只要在pos>=l的位置查询就行因为线性基只有20组所以可以暴力查询也就是log级别的插入与查询#include#include#include
ljq--linuxer
·
2020-08-20 23:07
ACM
Codeforces
Codeforces
查看被Hack的测试数据
需求在
Codeforces
上如果自己的算法通过了系统测试,但是被人hack了,想查看hack所用的数据。
海天一树
·
2020-08-20 23:21
小朋友学Codeforces
Codeforces
Round #275 (Div. 2) C Diverse Permutation
CDiversePermutation题意是,1到n的全排列,记为p1, p2, ..., pn.,让你找出一种排列,这种排列满足|p1 - p2|, |p2 - p3|, ..., |pn - 1 - pn|,这n-1个数有k个不同的数。其中1 ≤ k #include#defineN100010intans[N],n,k,vis[N];intmain(void){while(sca
gwq5210
·
2020-08-20 23:44
codeforces
codeforces
1299A Anu Has a Function
传送门题意:给一个序列,让改变序列的顺序,使其经过一个运算,最后值最大。分析:本题考就考这个运算,这个运算就是二进制,所以考的就是二进制。分析这个运算:(以下摘自tqltqltqltql)/-------------------------------------------------------------------------------------------/我们看这样一个操作他代表着
czyhbo
·
2020-08-20 23:47
math
二进制
CF868F 分治优化dp
链接:https://
codeforces
.com/problemset/problem/868/F首先n^2m的dp很容易想,f(j,i)表示考虑划分了j个集合,最后一个集合结尾在i的最小值。
caoyang1123
·
2020-08-20 23:32
刷题集
训练集
codeforces
1100F
传送门:http://
codeforces
.com/contest/1099/problem/F题意:两个人在玩游戏。第一个人从根结点出发。
black_miracle
·
2020-08-20 23:49
dfs
线段树
codeforces
1100F
传送门:http://
codeforces
.com/contest/1100/problem/F题意:n个数,q个询问,每次询问区间异或最大值。
black_miracle
·
2020-08-20 23:48
线性基
Codeforces
Round 604 C. Beautiful Regional Contest
原题链接:https://
codeforces
.com/contest/1265/problem/C题目内容实例input5125443221111114432111000000202019181716151413121110987654321326464635858585858373737373434282828282828242419171717171616161611output123000
atnana
·
2020-08-20 23:49
codeforces
C. Everyone is a Winner!
原题链接:
codeforces
C.EveryoneisaWinner!
atnana
·
2020-08-20 23:49
Codeforces
Round #143 (Div. 2) C. To Add or Not to Add 胡搞
Apieceofpapercontainsanarrayofnintegersa1, a2, ..., an.Yourtaskistofindanumberthatoccursthemaximumnumberoftimesinthisarray.However,beforelookingforsuchnumber,youareallowedtoperformnotmorethankfollowin
angle555945
·
2020-08-20 22:33
ACM_CodeForces
ACM_胡搞
Codeforces
Round #539 (Div. 1)
有史以来打的最烂的一场...B题都WA了两发,D题数树不知道结论不会做,E题没调出来...GG了。也说明我实力其实还不够吧...再多加练习,我还有机会继续努力。题目链接A.SashaandaBitofRelax题意:给定一个长度为\(n\)的序列\(a\),求有多少个长度为偶数的区间满足区间前一半数的异或和等于后一半数的异或和。\(n\leq3*10^5,a_i\leq2^{20}\)。题解:考虑
aisi8242
·
2020-08-20 22:50
codeforces
1096E The Top Scorer
codeforces
基础组合数学练习题/cy按照题面描述,不难想到枚举\(a_1\)的大小\(x\)和值为\(x\)的数的个数\(y\),不难写出获胜概率如下\[\sum_{x=r}^s\sum_{y=
adfa4535
·
2020-08-20 22:40
codeforces
1065F Up and Down the Tree
题目链接:
codeforces
1065FUpandDowntheTree题意:给出一棵树的节点数\(n\)以及一次移动的最大距离\(k\),现在有一个标记在根节点1处,每一次可以进行一下的两个操作之一:
adfa4535
·
2020-08-20 22:08
[
Codeforces
482A] Diverse Permutation
[题目链接]https://
codeforces
.com/contest/482/problem/A[算法]首先构造一个(k+1)个数的序列,满足它们的差为1-k对于i>k+1,令Ai=i时间复杂度:O
a576969381
·
2020-08-20 22:22
【
Codeforces
】2015-2016 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2015) A Adjoin the Netwo
题目链接:http://
codeforces
.com/gym/100781/attachments题目大意:给你n个点和l条边,让你添加一些边形成一棵树使得树的直径尽可能小。
ZZZZone
·
2020-08-20 22:38
CodeForces
DFS
树的直径
【
Codeforces
】2015-2016 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2015) E 线段树+离散化
题目链接:https://vjudge.net/contest/175173#problem/E题目大意:给你n个区间段l[i],r[i]0#include#include#include#include#includeusingnamespacestd;constintMaxN=3e5;constintINF=1f;structNODE{intl,r;}box[MaxN+5];boolcmp(N
ZZZZone
·
2020-08-20 22:38
CodeForces
线段树
离散化
Codeforces
--47A--Triangular numbers
题目描述:Atriangularnumberisthenumberofdotsinanequilateraltriangleuniformlyfilledwithdots.Forexample,threedotscanbearrangedinatriangle;thusthreeisatriangularnumber.Then-thtriangularnumberisthenumberofdots
ypopstar
·
2020-08-20 22:34
暴力枚举
算法
CodeForces
557 D.Vitaly and Cycle(组合数学)
Description给出一个n个点m条边的无向图,现在要求加最少的边使得该图有一个长度超过1的奇环,问最少边数及有多少种方案加最少条边形成奇环Input第一行两个整数n,m表示点数和边数,之后m行每行两个整数u,v表示一条无向边(3≤n≤105,0≤m≤min(n(n−1)2,105))Output输出所加最少边数t以及加t条边有多少种方案可以形成奇环SampleInput4412134243S
v5zsq
·
2020-08-20 22:43
Code
Forces
组合数学
[CF gym]2017-2018 ACM-ICPC, Asia Daejeon Regional Contest E How Many to Be Happy?
原题面:http://
codeforces
.com/gym/101667/attachments[题意]给你n个边,定义一个函数F(e)。
Rec.
·
2020-08-20 22:37
Codeforces
19E Fairy
Description给定n个点,m条边的无向图,可以从图中删除一条边,问删除哪些边可以使图变成一个二分图。【题目分析】手玩一下,发现删除的是奇环的交集,而且不在偶环上的点,然后乱搞就可以了。【代码】#include#include#include#include#include#include#include#include#include#include#includeusingnamespa
Orion_Rigel
·
2020-08-20 22:21
并查集
好题
codeforces
833 A题解
话说看各种提交的时候发现还有求导的……简直可怕题的大意是这样的:假设有两个数,使得:a=X21×X22×…×X2n×Y1×Y2×…×Ynb=Y21×Y22×…×Y2n×X1×X2×…×Xn则称a,b具有关系α。现在给出q组询问,每组询问涉及两个数,要求判断两个数之间是否具有关系α。(1 ≤ n ≤ 350000,1 ≤ a, b ≤ 109)看见这个数据范围,大概是一道数论题。我首先想到的是gcd
LittleRewriter
·
2020-08-20 22:50
数论
Codeforces
Round #532 (Div. 2)-F. Ivan and Burgers-线性基
Codeforces
Round#532(Div.2)-F.IvanandBurgers-线性基【Description】Ivanlovesburgersandspendingmoney.ThereareburgerjointsonthestreetwhereIvanlives.Ivanhasfriends
__Simon_
·
2020-08-20 22:08
数学
CodeForces
482A Diverse Permutation
A.DiversePermutationtimelimitpertest1secondmemorylimitpertest256megabytesPermutationpisanorderedsetofintegersp1, p2, ..., pn,consistingofndistinctpositiveintegersnotlargerthann.We'lldenoteasnthe
Hytai
·
2020-08-20 22:51
数学构造
CodeForces
359B 构造
C-CTimeLimit:1000MSMemoryLimit:262144KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForces
359BDescriptionApermutationpisanorderedgroupofnumbersp1
Marcus-Bao
·
2020-08-20 22:49
codeforces
思维
各种构造
[
CodeForces
939F]Cutlet
题意:有2×n2×n的时间去煎一块两面的肉给你kk个不相交时间区间[li,ri][li,ri]你可以在这些区间的时间内任意次翻转这块肉问是否存在合法的方案使得两面恰好都只煎了nn分钟求最少翻转次数n≤105,k≤100n≤105,k≤100考虑暴力DP,fi,jDP,fi,j表示前ii秒,没有被烤的那一面(简称为对面,另一面称正面)被烤了jj秒的最少翻转次数fi,j=fi−1,jfi,j=fi−1
Kelin__
·
2020-08-20 22:57
———DP————
单调队列
上一页
97
98
99
100
101
102
103
104
下一页
按字母分类:
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
其他