自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

xuanweiace的博客

你必须非常努力,才能看起来毫不费力。

  • 博客(61)
  • 收藏
  • 关注

原创 【CodeForces - 1199C】MP3(思维,离散化)

题干:One common way of digitalizing sound is to record sound intensity at particular time moments. For each time moment intensity is recorded as a non-negative integer. Thus we can represent a sound f...

2019-07-31 21:31:27 716

原创 【CodeForces - 1197C】Array Splitting(水题)

题干:You are given asortedarraya1,a2,…,ana1,a2,…,an(for each indexi>1i>1conditionai≥ai−1ai≥ai−1holds) and an integerkk.You are asked to divide this array intokknon-empty consecutive ...

2019-07-31 21:22:09 411

原创 【LightOJ - 1038】Race to 1 Again(概率dp,数学期望)

题干:Rimi learned a new thing about integers, which is - any positive integer greater than1can be divided by its divisors. So, he is now playing with this property. He selects a numberN. And he cal...

2019-07-31 21:20:56 244

原创 【LightOJ - 1104】Birthday Paradox(概率,思维)

题干:Sometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in a party where there are23people including you. What is the probab...

2019-07-31 21:20:36 237

原创 【LightOJ - 1027】A Dangerous Maze(概率dp,数学期望)

题干:You are in a maze; seeingndoors in front of you in beginning. You can choose any door you like. The probability for choosing a door is equal for all doors.If you choose theithdoor, it can e...

2019-07-31 21:20:19 276

原创 【LightOJ - 1079】Just another Robbery(概率dp,概率背包)

题干:As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so he decided to rob banks. He wants to make a calculated risk, and grab as much...

2019-07-31 21:19:50 289

原创 【LightOJ - 1030】Discovering Gold(概率dp,数学期望,期望的线性性)

题干:You are in a cave, a long cave! The cave can be represented by a1 x Ngrid. Each cell of the cave can contain any amount of gold.Initially you are in position1. Now each turn you throw a perf...

2019-07-31 21:19:30 247

原创 【BZOJ - 3036】绿豆蛙的归宿(概率DAG图dp,拓扑排序,概率dp,期望的线性性)

题干:随着新版百度空间的下线,Blog宠物绿豆蛙完成了它的使命,去寻找它新的归宿。给出一个有向无环的连通图,起点为1终点为N,每条边都有一个长度。绿豆蛙从起点出发,走向终点。到达每一个顶点时,如果有K条离开该点的道路,绿豆蛙可以选择任意一条道路离开该点,并且走向每条路的概率为 1/K 。现在绿豆蛙想知道,从起点走到终点的所经过的路径总长度期望是多少?Input第一行: 两个整数...

2019-07-31 21:18:40 403

原创 【ZOJ - 3329】One Person Game(带循环的概率dp,数学期望,高斯消元,数学)

题干:There is a very simple and interesting one-person game. You have 3 dice, namelyDie1,Die2andDie3.Die1hasK1faces.Die2hasK2faces.Die3hasK3faces. All the dice are fair dice, so the pr...

2019-07-28 14:53:49 262

原创 *【CodeForces - 280C】Game on Tree(期望模型,期望的线性性)

题干:Momiji has got a rooted tree, consisting ofnnodes. The tree nodes are numbered by integers from1ton. The root has number1. Momiji decided to play a game on this tree.The game consists of ...

2019-07-28 11:49:45 224

原创 【Gym - 101606F】Flipping Coins(概率dp)

题干:Here’s a jolly and simple game: line up a row ofNidentical coins, all with the heads facing down onto the table and the tails upwards, and for exactlyKtimes take one of the coins, toss it int...

2019-07-28 11:49:36 287

原创 【POJ - 2096】Collecting Bugs(概率dp)

题干:Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets a new program, he classifies all possible bugs in...

2019-07-28 11:48:13 234

原创 【BZOJ - 3993】星际战争(网络流最大流+二分)

题干:3333年,在银河系的某星球上,X军团和Y军团正在激烈地作战。在战斗的某一阶段,Y军团一共派遣了N个巨型机器人进攻X军团的阵地,其中第i个巨型机器人的装甲值为Ai。当一个巨型机器人的装甲值减少到0或者以下时,这个巨型机器人就被摧毁了。X军团有M个激光武器,其中第i个激光武器每秒可以削减一个巨型机器人Bi的装甲值。激光武器的攻击是连续的。这种激光武器非常奇怪,一个激光武器只能攻击一些特定...

2019-07-27 15:55:13 188

原创 【Gym - 101061F】Fairness(dp,思维)

题干:Dwik and his brother Samir both received scholarships from a famous university in India. Their father, Besher, wants to send some money with each of them.Besher hasncoins, theithcoin has a ...

2019-07-27 09:57:21 233

原创 【BZOJ - 3224】普通平衡树(Splay模板题)

题干:您需要写一种数据结构(可参考题目标题),来维护一些数,其中需要提供以下操作:1. 插入x数2. 删除x数(若有多个相同的数,因只删除一个)3. 查询x数的排名(若有多个相同的数,因输出最小的排名)4. 查询排名为x的数5. 求x的前驱(前驱定义为小于x,且最大的数)6. 求x的后继(后继定义为大于x,且最小的数)Input第一行为n,表示操作的个数,下面n行每行有两个...

2019-07-26 21:48:49 319

原创 【洛谷 - P1345 [USACO5.4]】奶牛的电信(网络流最小割,拆点)

题干:题目描述农夫约翰的奶牛们喜欢通过电邮保持联系,于是她们建立了一个奶牛电脑网络,以便互相交流。这些机器用如下的方式发送电邮:如果存在一个由c台电脑组成的序列a1,a2,...,a(c),且a1与a2相连,a2与a3相连,等等,那么电脑a1和a(c)就可以互发电邮。很不幸,有时候奶牛会不小心踩到电脑上,农夫约翰的车也可能碾过电脑,这台倒霉的电脑就会坏掉。这意味着这台电脑不能再发送电邮...

2019-07-26 20:44:08 199

原创 【洛谷 - P1231 】教辅的组成(网络流最大流,拆点)

题干:题目描述蒟蒻HansBug在一本语文书里面发现了一本答案,然而他却明明记得这书应该还包含一份练习题。然而出现在他眼前的书多得数不胜数,其中有书,有答案,有练习册。已知一个完整的书册均应该包含且仅包含一本书、一本练习册和一份答案,然而现在全都乱做了一团。许多书上面的字迹都已经模糊了,然而HansBug还是可以大致判断这是一本书还是练习册或答案,并且能够大致知道一本书和答案以及一本书和练...

2019-07-26 20:38:22 217

原创 【洛谷 - P3410】拍照(最大权闭合图,网络流最小割)

题干:题目描述小B有n个下属,现小B要带着一些下属让别人拍照。有m个人,每个人都愿意付给小B一定钱让n个人中的一些人进行合影。如果这一些人没带齐那么就不能拍照,小B也不会得到钱。注意:带下属不是白带的!!!对于每个下属,如果他带了那么小B需要给他一些钱,保证当他拍照时配合。请问,小B的净收益最多是多少。输入输出格式输入格式:第1行有2个正整数m和n(0<...

2019-07-26 20:33:21 186

原创 【HDU - 6231】K-th Number(二分,思维)

题干:Alice are given an arrayA[1..N]A[1..N]withNNnumbers.Now Alice want to build an arrayBBby a parameterKKas following rules:Initially, the array B is empty. Consider each interval in arr...

2019-07-26 20:32:59 391

原创 【洛谷 - P2756】飞行员配对方案问题(网络流最大流,输出方案)

题干:题目背景第二次世界大战时期..题目描述英国皇家空军从沦陷国征募了大量外籍飞行员。由皇家空军派出的每一架飞机都需要配备在航行技能和语言上能互相配合的2 名飞行员,其中1 名是英国飞行员,另1名是外籍飞行员。在众多的飞行员中,每一名外籍飞行员都可以与其他若干名英国飞行员很好地配合。如何选择配对飞行的飞行员才能使一次派出最多的飞机。对于给定的外籍飞行员与英国飞行员的配合情况,试设计...

2019-07-26 20:32:39 480

原创 【HDU - 5886】Tower Defence(树的直径,思维,dp)

题干:There was a civil war between two factions in Skyrim, a province of the Empire on the continent of Tamriel. The Stormcloaks, led by Ulfric Stormcloak, are made up of Skyrim's native Nord race. Th...

2019-07-26 20:30:45 307

原创 【2019牛客暑期多校训练营(第一场) - A】Equivalent Prefixes(单调栈,tricks)

题干:链接:https://ac.nowcoder.com/acm/contest/881/A来源:牛客网Two arrays u and v each with m distinct elements are called equivalent if and only if RMQ(u,l,r)=RMQ(v,l,r)for all 1≤l≤r≤mwhere RMQ(w,l,r...

2019-07-22 21:00:46 344

原创 【2019牛客暑期多校训练营(第一场) - H】XOR(线性基,期望的线性性)

题干:链接:https://ac.nowcoder.com/acm/contest/881/H来源:牛客网Bobo has a set A of n integers a1,a2,…,ana1,a2,…,an.He wants to know the sum of sizes for all subsets of A whose xor sum is zero modulo (10...

2019-07-22 20:59:10 460

原创 【ZOJ - 2968 】Difference Game (贪心,思维模拟)

题干:Now you are going to play an interesting game. In this game, you are given two groups of distinct integers andCcoins. The two groups, namedGaandGbrespectively, are not empty and contain the ...

2019-07-22 20:58:37 297

原创 【HDU - 3966】Aragorn's Story(树链剖分,模板题)

题干:Our protagonist is the handsome human prince Aragorn comes from The Lord of the Rings. One day Aragorn finds a lot of enemies who want to invade his kingdom. As Aragorn knows, the enemy has N cam...

2019-07-21 12:10:35 220

原创 【HDU - 6203】ping ping ping(lca+贪心思想,对lca排序,树状数组差分)

题干:给出一个n+1个点的树,以及p个点对,需要断开一些点,使得这p个点对路径不连通。输出应该断开的最少点数。解题报告:从那p个点对入手的话:首先考虑只有一对点的话,肯定是这条路径上的随便一个点都可以。两个点对呢?肯定是有交点就选交点,没交点就只能破坏两个点了。多个点对呢?比较难考虑了。也比较难想到正解:贪心思维,破坏两个点的LCA是最佳的。从破坏的点入手:破坏一个点,可以影响到的...

2019-07-20 21:38:18 190

原创 【POJ - 2942】Knights of the Round Table(点双连通分量,二分图判断奇环奇圈)

题干:Being a knight is a very attractive career: searching for the Holy Grail, saving damsels in distress, and drinking with the other knights are fun things to do. Therefore, it is not very surprisin...

2019-07-19 18:30:04 343

原创 【BZOJ - 2574】[Poi1999] Store-Keeper(点双连通分量,求割点,记忆化bfs)

题干:有一个仓库被分成n*m个矩形区域,如果两个区域有一条公共边,则被认为这两个区域相邻。包裹都放在一个区域中,剩余的区域或者空闲或者被集装箱占有,这是因为集装箱太重,仓库管理员不能将集装箱搬走。仓库管理员目是是要将包裹从开始的P区域移动到最后的K区域。他可以从空区域走到与之相邻的一个空区域。当仓库管理员走到与包裹相邻的区域时,它可以推动包裹,具体的推动方法如下所示:读入一个储藏表...

2019-07-19 18:29:47 609

原创 【POJ - 3694】Network(对dfn求lca 或 缩点+lca 或 边双连通+并查集)

题干:网络管理员管理大型网络。该网络由N台计算机和成对计算机之间的M链路组成。任何一对计算机都通过连续的链接直接或间接连接,因此可以在任何两台计算机之间转换数据。管理员发现某些链接对网络至关重要,因为任何一个链接的故障都可能导致某些计算机之间无法转换数据。他把这种联系称为桥梁。他计划逐一添加一些新链接以消除所有桥梁。 您将通过在添加每个新链接后报告网络中的网桥数来帮助管理员。输入输入包...

2019-07-18 19:36:36 270

原创 【POJ - 1523】SPF(Tarjan求割点,求分割成的连通块数,模板题,tricks)

题干:Consider the two networks shown below. Assuming that data moves around these networks only between directly connected nodes on a peer-to-peer basis, a failure of a single node, 3, in the network ...

2019-07-18 19:36:33 241

原创 【HDU - 3394】Railway(点双连通分量,Tarjan算法,思维tricks)

题干:There are some locations in a park, and some of them are connected by roads. The park manger needs to build some railways along the roads, and he would like to arrange tourist routes to each circ...

2019-07-17 22:39:55 590

原创 【POJ - 3352】Road Construction(Tarjan,边双连通分量)

题干:It's almost summer time, and that means that it's almost summer construction time! This year, the good people who are in charge of the roads on the tropical island paradise of Remote Island would...

2019-07-16 18:09:46 316

原创 【POJ - 2553】The Bottom of a Graph(tarjan强连通分量缩点,模板题)

题干:We will use the following (standard) definitions from graph theory. LetVbe a nonempty and finite set, its elements being called vertices (or nodes). LetEbe a subset of the Cartesian productV...

2019-07-16 18:08:04 228

原创 【POJ - 3177】Redundant Paths(边双连通分量,去重边)

题干:In order to get from one of the F (1 <= F <= 5,000) grazing fields (which are numbered 1..F) to another field, Bessie and the rest of the herd are forced to cross near the Tree of Rotten Ap...

2019-07-16 18:07:31 262

原创 【CodeForces - 1152C 】Neko does Maths(数学数论,lcm,gcd性质)

题干:给出a,b<=1e9,你要找到最小的k使得lcm(a+k,b+k)尽可能小,如果有多个k给出同样的最小公倍数,输出最小的一个k。解题报告:因为题目中k太多了,先化简一下公式,假设a>b ,则gcd(a+k,b+k) == gcd(a+k,a+b);下面给出一个简单证明:z=gcd(a+k,b+k);所以:(a+k)%z==0,(b+k)%z==0;...

2019-07-15 17:11:34 372

原创 【HDU - 5477】A Sweet Journey(思维,水题)

题干:Master Di plans to take his girlfriend for a travel by bike. Their journey, which can be seen as a line segment of length L, is a road of swamps and flats. In the swamp, it takes A point strength...

2019-07-15 15:00:37 298

原创 【HDU - 5475】An easy problem(线段树,思维)

题干:One day, a useless calculator was being built by Kuros. Let's assume that number X is showed on the screen of calculator. At first, X = 1. This calculator only supports two types of operation.1...

2019-07-15 14:54:48 184

原创 【HDU - 5468】Puzzled Elena(容斥原理,dfs序,数学,素因子分解,有坑)

题干: Problem Description Since both Stefan and Damon fell in love with Elena, and it was really difficult for her to choose. Bonnie, her best friend, suggested her to throw a question to them,...

2019-07-15 14:37:22 237

原创 *【ZOJ - 3703】Happy Programming Contest(带优先级的01背包)

题干:In Zhejiang University Programming Contest, a team is called "couple team" if it consists of only two students loving each other. In the contest, the team will get a lovely balloon with unique co...

2019-07-11 22:10:25 222

原创 【HRBUST - 1996】数学等式 (HASH 或 二分)

题干:又到了数学题的时刻了,给出三个数组A,B,C,然后再给出一个数X,现在我想知道是否能找到三个数满足等式A[i]+B[j]+C[k]=X,你能帮助我么??Input本题有多组数据,每组数据第一行输入三个数n,m,h,分别表示数组A,B,C内的的元素个数(0<n,m,h<=500)接下来三行分别输入数组A,B,C的元素接下来输入一个数Q,表示Q次询问(1&l...

2019-07-11 22:07:04 375

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除