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 ——1100F Ivan and Burgers(线性基)
Ivanlovesburgersandspendingmoney.TherearennburgerjointsonthestreetwhereIvanlives.Ivanhasqqfriends,andtheii-thfriendsuggestedtomeetatthejointliliandwalktothejointriri(li≤ri)(li≤ri).Whilestrollingwithth
lgz0921
·
2020-08-21 00:49
数论
【
Codeforce
s 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
Codeforce
s查看被Hack的测试数据
需求在
Codeforce
s上如果自己的算法通过了系统测试,但是被人hack了,想查看hack所用的数据。
海天一树
·
2020-08-20 23:21
小朋友学Codeforces
Codeforce
s 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
codeforce
s 1299A Anu Has a Function
传送门题意:给一个序列,让改变序列的顺序,使其经过一个运算,最后值最大。分析:本题考就考这个运算,这个运算就是二进制,所以考的就是二进制。分析这个运算:(以下摘自tqltqltqltql)/-------------------------------------------------------------------------------------------/我们看这样一个操作他代表着
czyhbo
·
2020-08-20 23:47
math
二进制
CF868F 分治优化dp
链接:https://
codeforce
s.com/problemset/problem/868/F首先n^2m的dp很容易想,f(j,i)表示考虑划分了j个集合,最后一个集合结尾在i的最小值。
caoyang1123
·
2020-08-20 23:32
刷题集
训练集
codeforce
s 1100F
传送门:http://
codeforce
s.com/contest/1099/problem/F题意:两个人在玩游戏。第一个人从根结点出发。
black_miracle
·
2020-08-20 23:49
dfs
线段树
codeforce
s 1100F
传送门:http://
codeforce
s.com/contest/1100/problem/F题意:n个数,q个询问,每次询问区间异或最大值。
black_miracle
·
2020-08-20 23:48
线性基
Codeforce
s Round 604 C. Beautiful Regional Contest
原题链接:https://
codeforce
s.com/contest/1265/problem/C题目内容实例input5125443221111114432111000000202019181716151413121110987654321326464635858585858373737373434282828282828242419171717171616161611output123000
atnana
·
2020-08-20 23:49
codeforce
s C. Everyone is a Winner!
原题链接:
codeforce
sC.EveryoneisaWinner!
atnana
·
2020-08-20 23:49
Codeforce
s 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_胡搞
Codeforce
s 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
codeforce
s1096E The Top Scorer
codeforce
s基础组合数学练习题/cy按照题面描述,不难想到枚举\(a_1\)的大小\(x\)和值为\(x\)的数的个数\(y\),不难写出获胜概率如下\[\sum_{x=r}^s\sum_{y=
adfa4535
·
2020-08-20 22:40
codeforce
s 1065F Up and Down the Tree
题目链接:
codeforce
s1065FUpandDowntheTree题意:给出一棵树的节点数\(n\)以及一次移动的最大距离\(k\),现在有一个标记在根节点1处,每一次可以进行一下的两个操作之一:
adfa4535
·
2020-08-20 22:08
[
Codeforce
s 482A] Diverse Permutation
[题目链接]https://
codeforce
s.com/contest/482/problem/A[算法]首先构造一个(k+1)个数的序列,满足它们的差为1-k对于i>k+1,令Ai=i时间复杂度:O
a576969381
·
2020-08-20 22:22
【
Codeforce
s】2015-2016 ACM-ICPC Nordic Collegiate Programming Contest (NCPC 2015) A Adjoin the Netwo
题目链接:http://
codeforce
s.com/gym/100781/attachments题目大意:给你n个点和l条边,让你添加一些边形成一棵树使得树的直径尽可能小。
ZZZZone
·
2020-08-20 22:38
CodeForces
DFS
树的直径
【
Codeforce
s】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
线段树
离散化
Codeforce
s--47A--Triangular numbers
题目描述:Atriangularnumberisthenumberofdotsinanequilateraltriangleuniformlyfilledwithdots.Forexample,threedotscanbearrangedinatriangle;thusthreeisatriangularnumber.Then-thtriangularnumberisthenumberofdots
ypopstar
·
2020-08-20 22:34
暴力枚举
算法
CodeForce
s 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://
codeforce
s.com/gym/101667/attachments[题意]给你n个边,定义一个函数F(e)。
Rec.
·
2020-08-20 22:37
Codeforce
s 19E Fairy
Description给定n个点,m条边的无向图,可以从图中删除一条边,问删除哪些边可以使图变成一个二分图。【题目分析】手玩一下,发现删除的是奇环的交集,而且不在偶环上的点,然后乱搞就可以了。【代码】#include#include#include#include#include#include#include#include#include#include#includeusingnamespa
Orion_Rigel
·
2020-08-20 22:21
并查集
好题
codeforce
s833 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
数论
Codeforce
s Round #532 (Div. 2)-F. Ivan and Burgers-线性基
Codeforce
sRound#532(Div.2)-F.IvanandBurgers-线性基【Description】Ivanlovesburgersandspendingmoney.ThereareburgerjointsonthestreetwhereIvanlives.Ivanhasfriends
__Simon_
·
2020-08-20 22:08
数学
CodeForce
s 482A Diverse Permutation
A.DiversePermutationtimelimitpertest1secondmemorylimitpertest256megabytesPermutationpisanorderedsetofintegersp1, p2, ..., pn,consistingofndistinctpositiveintegersnotlargerthann.We'lldenoteasnthe
Hytai
·
2020-08-20 22:51
数学构造
CodeForce
s 359B 构造
C-CTimeLimit:1000MSMemoryLimit:262144KB64bitIOFormat:%I64d&%I64uSubmitStatusPractice
CodeForce
s359BDescriptionApermutationpisanorderedgroupofnumbersp1
Marcus-Bao
·
2020-08-20 22:49
codeforces
思维
各种构造
[
CodeForce
s939F]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————
单调队列
Codeforce
s:1100F-F. Ivan and Burgers(离线线性基)
题目链:http://
codeforce
s.com/problemset/problem/1100/F题意:现在有n个数,q次询问,每次询问给你一段区间,然后你需要在区间中选出一些数要这些数的异或和最大
GoldenFingers
·
2020-08-20 22:02
数学基础-线性基
codeforce
s C. Diverse Permutation
C.DiversePermutationtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPermutationpisanorderedsetofintegersp1, p2, ..., pn,consistingofndistinctpositivein
Byte__
·
2020-08-20 22:22
CF
I - Absolute Game(博弈)
题目链接:http://
codeforce
s.com/gym/102392/problem/I题意:Alice和Bob分别由2组,他们轮流拿数,直到都剩下一个数,Alice想使该差值最大,Bob想使该差值最小
罗gkv
·
2020-08-20 21:12
Codeforces
个人训练
codeforce
s1100 F. Ivan and Burgers(线性基)
cf1100f线性基题目链接题意:给一个(n#definelllonglong#defineINF0x3f3f3f3fusingnamespacestd;constintmaxn=5e5+5;intr[maxn][22];//表示令i为右端的区间且线性基第i位有值的最大左端点l在哪intp[maxn][22];//当前线性基的值intn,a[maxn],m;intmain(){scanf("%d"
hupopoo
·
2020-08-20 21:35
codeforces题解
CodeForce
s 1100F Ivan and Burgers
CodeForce
s题面Timelimit3000msMemorylimit262144kBSource
Codeforce
sRound#532(Div.2)Tagsdatastructuresdivideandconquergreedymath
weixin_30361641
·
2020-08-20 21:42
Codeforce
s Round #275 (Div. 2) --C Diverse Permutation
题目链接:DiversePermutationDiversePermutationtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPermutationpisanorderedsetofintegersp1, p2, ..., pn,consisting
sxk_sxy
·
2020-08-20 21:31
Codeforces
codeforce
s 482A Diverse Permutation 贪心
传送门:cf482AA.DiversePermutationtimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputPermutationpisanorderedsetofintegersp1, p2, ..., pn,consistingofndistinct
飞火扑蛾
·
2020-08-20 21:52
贪心
CF
Codeforce
s 1299 题解
鸽了一周的题解……我颓炸了。A考虑一下\(f(x,y)\)的意义,就是\(x\)具有且\(y\)不具有的位,那么\(f(f(x,y),z)=f(x,y\\text{or}\z)\).也就是只有重排后第一个位置是多少队最终的值有影响。于是可以维护前后缀\(\text{or}\)然后枚举第一个即可。时间复杂度\(O(n)\).代码:80183835B答案是YES当且仅当\(n\)为偶数且对边分别平行且
suncongbo
·
2020-08-20 21:47
【学习笔记】Dilworth 定理的构造性证明
附例题:
Codeforce
s590EDilworth定理:DAG的最长反链大小等于最小链覆盖大小。反链是指从图中的一个点的集合,使得集合内点两两不可达;链覆盖是指用若干条可以相交的链覆盖图中所有的点。
suncongbo
·
2020-08-20 21:47
Codeforce
s 1344 题解
A假设所有的\((i+a_i)\)模\(n\)意义下构成排列则答案为YES,否则为NO.时间复杂度\(O(n)\)或\(O(n\logn)\).代码:79150268B由于每行每列必须有至少一个S,所以每行每列为#的格子要么构成一个连续区间要么不存在。如果某行或列不存在#,则该行或列的格子必须放在一个不存在#的列或行。于是得到了有解的必要条件:(1)每行每列#的格子要么不存在要么构成连续区间;(2
suncongbo
·
2020-08-20 21:46
交互题训练1
Codeforce
s1011D-Rocket不过,这里面的人有可能撒谎,即大于有可能说成小于,小于有可能说成大于。好在,它们说真假话为n个一个周期。
ezoilearner
·
2020-08-20 21:12
日常习题
构造法——Diverse Permutation (
CodeForce
s 482A )
题目链接:http://
codeforce
s.com/problemset/problem/482/A分析:这是一道构造法构造数学模型的题,建议先列出一定数量数据,然后从中寻找规律,建立模型。
FeBr2
·
2020-08-20 21:18
ACM算法(题解):
数学
【线性基】【离线处理】
codeforce
s1100F Ivan and Burgers
F.IvanandBurgerstimelimitpertest3secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputIvanlovesburgersandspendingmoney.TherearenburgerjointsonthestreetwhereIvanlives.Ivanhasqfrie
BUAA_Alchemist
·
2020-08-20 21:12
线性基
Codeforces
ACM第一年总结
明天正好就是正式接触ACM一年了vj:84
codeforce
:115洛谷:206CDOJ:大概三四十道(不用了)UESTCOJ:58一年下来就写了五百多道题....接触ACM的第一年打了很好的基础,只能说是编程和简单思维上吧
mxYlulu
·
2020-08-20 17:31
心得
Codeforce
s Round #353 (Div. 2) D. Tree Construction __ Binary Search Tree
D.TreeConstructiontimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputDuringtheprogrammingclassesVasyawasassignedadifficultproblem.However,hedoesn'tknowhowtocod
ProLightsfxjh
·
2020-08-20 15:24
Codeforces
Div.
2:D
☺藏题阁☺
算法的艺术
codeforce
s 734F Anton and School ( 构造 位运算的和 )
题目链接题目大意给出两个长度为N的序列Bi,Ci(N#include#include#include#defineblllonglong#defineFor(i,a,b)for(inti=(a),_##i=(b);i=_##i;i--)#defineMem(a,b)memset(a,b,sizeof(a))constintmaxn=200000+100;intN,B[maxn],C[maxn];i
Out_Of_Cage
·
2020-08-20 12:09
Codeforce
s Round #260 (Div. 1) B. A Lot of Games Trie + 博弈
题意:两个人在Trie树上博弈k局,当前局输的人在下一局中执先手。在一局博弈中,当一个人不能走时,判定另一个人赢。最后一局的结果作为整个游戏的结果。分析:先手赢的情况为:(1)先手可必胜,也可败。那么前k-1局败,最后一局胜利即可。(2)先手只能必胜。当k为奇数时获胜。后手赢的情况为:(1)先手必败。(2)先手只能必胜。k为偶数。(本题的状态为取完当前节点的状况)判定先手是否可必胜:叶子节点为可必
alpc_wt
·
2020-08-20 09:50
codeforces
&
bestcoder
DP
codeforce
div1+2 621 B. Cow and Friend
这道题大意是给定一些步伐,然后目标从0,0走到0,x问最少要几步,刚开始,我就想到了贪心,因为每两次最大的步伐就可以做到移动(0,2a【i】)的距离,所以我选择用数组存储所有小于2a【n】的值(a[n]为排序后最大值)然后把所有a[I]的答案更新为1,考虑余数加数组来解决问题可是答案超时了。之后重新看这个问题,发现了之前的一个误区,就比如345凑13的例子我一直在考虑刚好满足3+5+5的情况,却忽
徒手装机甲
·
2020-08-20 04:44
codeforce
贪心
Codeforce
s Round #443 (Div. 1) C. Tournament 思维题
C.Tournamenttimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputRecentlyatournamentinkkindsofsportshasbeguninBerland.Vasyawantstomakemoneyonthebets.Theschemeoft
zstu_zy
·
2020-08-20 04:35
算法理解
(
CodeForce
s - 327A)Flipping Game
(
CodeForce
s-327A)FlippingGametimelimitpertest:1secondmemorylimitpertest:256megabytesinput:standardinputoutput
Hold_My_Own
·
2020-08-20 04:29
暴力枚举
codeforces
Codeforce
s 1293 E. Xenon‘s Attack on the Gangs —— 树上记忆化搜索,单点加改成区间加,有丶东西
Thisway题意:现在有一棵大小为n的树,你要往边上放0~n-2这n-1个数,定义mex(u,v)表示u到v路径上的第一个未出现的自然数,定义S问你S最大是多少。题解:我感觉这道题绝不止23的难度…其实这种将单点加值转换为区间加值的题目在以前的DP中也遇到过,在线段树的题目中也是经常遇到,但是这次却没有想到真实不应该。首先需要知道的一件事情就是从0开始的值应当和之前的值的链接在一起:比如说0和1
天翼之城*
·
2020-08-20 04:48
想法
dp
dfs
Cow and Friend
CodeForce
s - 1307B(思维)
Bessiehaswaytoomanyfriendsbecausesheiseveryone’sfavoritecow!HernewfriendRabbitistryingtohopoversotheycanplay!Morespecifically,hewantstogetfrom(0,0)to(x,0)bymakingmultiplehops.Heisonlywillingtohopfromo
starlet_kiss
·
2020-08-20 04:09
Cow and Fields
CodeForce
s - 1307D(spfa+思维)
Bessieisoutgrazingonthefarm,whichconsistsofnfieldsconnectedbymbidirectionalroads.Sheiscurrentlyatfield1,andwillreturntoherhomeatfieldnattheendoftheday.TheCowfederationofBarnshasorderedFarmerJohntoinst
starlet_kiss
·
2020-08-20 04:09
【
Codeforce
s Round 333 (Div 2)C】【最短路】The Two Routes 完全图两种双向边的最小最大距离
C.TheTwoRoutestimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputInAbsurdistan,therearentowns(numbered1throughn)andmbidirectionalrailways.Thereisalsoanabsurdly
snowy_smile
·
2020-08-20 04:38
题库-CF
CodeForces
图论-最短路
上一页
99
100
101
102
103
104
105
106
下一页
按字母分类:
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
其他