自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(52)
  • 资源 (1)
  • 收藏
  • 关注

原创 线段树-------L - Vases and Flowers(简单线段树 + 二分)

Alice is so popular that she can receive many flowers everyday. She has N vases numbered from 0 to N-1. When she receive some flowers, she will try to put them in the vases, one flower in one vase. Sh...

2018-10-31 20:52:22 183

原创 连通图-----A - Network of Schools (Tarjan模板缩点)

A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the “receiving sc...

2018-10-31 10:47:22 166

原创 Technocup 2019 - Elimination Round 2--------C. Cram Time

地址:http://codeforces.com/contest/1072/problem/C这道题其实,刚开始不知道怎么样的原则选取数,但是这道题的突破口就是找的是n+m尽可能大,选的数尽可能小就行,我不能自己增加题的难度啊,其实就是这样。。。。选取x使得x * (x + 1)/ 2 > (a + b);然后x–;之后a把较大的数拿走,其他的都是b的;反正就是1,2,3…x进行分配,...

2018-10-23 09:42:35 169

原创 线段树-------K - Transformation

Yuanfang is puzzled with the question below:There are n integers, a 1, a 2, …, a n. The initial values of them are 0. There are four kinds of operations.Operation 1: Add c to each number between a x...

2018-10-22 23:11:25 165

原创 线段树-------J - Assign the task

There is a company that has N employees(numbered from 1 to N),every employee in the company has a immediate boss (except for the leader of whole company).If you are the immediate boss of someone,that ...

2018-10-22 21:24:10 223

原创 Mail.Ru Cup 2018 Round 1-------D. Changing Array

地址:http://codeforces.com/contest/1054/problem/D下面解释转载于:http://www.cnblogs.com/CQBZOIer-zyy/p/9816004.html为了叙述方便,记MAX=(1<<k)-1,即二进制下k位全是1的数。为了符号表示不产生歧义,以下使用^表示异或(上面的题目描述中指的是次方)。这里要用到异或运算的一个很重...

2018-10-22 20:14:14 496

转载 初学强连通算法--Tarjan

首先推荐两个博客,我学习的时候看的:转自:https://blog.csdn.net/mengxiang000000/article/details/51672725#comments和https://blog.csdn.net/qq_34374664/article/details/77488976Tarjan算法的详细解释见上面两个博客。。。。。我们讨论一下Tarjan算法能够干一些...

2018-10-21 11:41:24 111

原创 Mail.Ru Cup 2018 Round 1 ----C. Candies Distribution

地址:http://codeforces.com/contest/1054/problem/C这道题是简单题就是我没有逆向思维,思维不会变通,当时想到,如果给的L,R数组是正确的话,那么答案就是n - L[i] - R[i],然后就一直在想如何判断给的数组一定输出YES,其实可以先减得出结果数组,然后再判断是否可以得出L,R数组,如果不能,输出NO,否则输出YES和结果数组。。。。。#incl...

2018-10-21 09:27:36 215

原创 线段树-------I - Tunnel Warfare

During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, villages connected by tunnels lay in a line. Except t...

2018-10-19 19:43:19 238

原创 线段树-----H - Can you answer these queries?

A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of the battleships can be marked a value of end...

2018-10-19 17:36:20 103

原创 线段树-----F - Count the Colors

Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your task is counting the segments of different colors you can see at last.Input...

2018-10-18 20:02:03 181

原创 Codeforces Round #516 D. Labyrinth

地址:http://codeforces.com/contest/1064/problem/D搜索题,用dfs会超,不能剪枝,因为这个一个cell会被多次访问;但是一般像遇到像求最短什么的,就用bfs,用bfs也可以,但是要有个优先顺序,因为可能搜索路径会因为之前被搜索过而截断这个例子:10 1010 410 9...*******.*.*******.*.*******.*....

2018-10-17 21:15:34 137

原创 线段树-----C - A Simple Problem with Integers

You have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the su...

2018-10-16 21:17:04 108

原创 次小生成树-------K - The Unique MST

Given a connected undirected graph, tell if its minimum spanning tree is unique.Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G is a subgraph of ...

2018-10-14 23:56:03 168

原创 最小生成树------E - QS Network

Sunny Cup 2003 - Preliminary RoundApril 20th, 12:00 - 17:00Problem E: QS NetworkIn the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with each other vi...

2018-10-14 10:50:23 117

原创 带权并查集-------I - Navigation Nightmare

Farmer John’s pastoral neighborhood has N farms (2 <= N <= 40,000), usually numbered/labeled 1…N. A series of M (1 <= M < 40,000) vertical and horizontal roads each of varying lengths (1 &...

2018-10-13 19:14:56 205

原创 Codeforces Round #515 (Div. 3)

记一次灰常失败的打cf经历,暴露了自己的许多问题,以及自己逻辑能力和代码能力不是很强A题:http://codeforces.com/contest/1066/problem/A这道水题上来,想暴力遍历,不可能,但是那个(L,R],处理的不好,这个逻辑没搞好,导致12分才a。。。。其实左开就是为了取上界,(R / v ) - (L + v - 1) / v + 1;#include<b...

2018-10-13 17:52:31 159

原创 Lyft Level 5 Challenge 2018 C. Permutation Game

地址:http://codeforces.com/contest/1033/problem/C必胜点和必败点的概念:P点:必败点,换而言之,就是谁处于此位置,则在双方操作正确的情况下必败。N点:必胜点,处于此情况下,双方操作均正确的情况下必胜。必胜点和必败点的性质:1、所有终结点是 必败点 P 。(我们以此为基本前提进行推理,换句话说,我们以此为假设)2、从任何必胜点N 操作,至少有一...

2018-10-12 19:56:51 184

原创 并查集-----L - Connections in Galaxy War

In order to strengthen the defense ability, many stars in galaxy allied together and built many bidirectional tunnels to exchange messages. However, when the Galaxy War began, some tunnels were destro...

2018-10-12 17:12:05 198

原创 并查集------K - Rochambeau

N children are playing Rochambeau (scissors-rock-cloth) game with you. One of them is the judge. The rest children are divided into three groups (it is possible that some group is empty). You don’t kn...

2018-10-12 11:32:01 123

原创 Educational Codeforces Round 52 (Rated for Div. 2) C. Make It Equal

题目:https://codeforces.com/contest/1065/problem/C这道题是服了,我的算法是贪心模拟,贪心的找切片,写的比较慢,因为是模拟,所以考虑的比较多,而且变量比较多。。。。。。赛后居然被hack了。。。好气,为什么呢,就是少考虑了初始时高度都一样,每次都是不考虑特殊情况。。。希望自己能够吃个教训。。。还有我觉得自己脑子里都是暴力,模拟,看了大佬的代码,人家...

2018-10-12 10:31:41 118

原创 并查集------H - Parity game

Now and then you play the following game with your friend. Your friend writes down a sequence consisting of zeroes and ones. You choose a continuous subsequence (for example the subsequence from the t...

2018-10-11 18:07:43 223

原创 贪心-----G - Supermarket

A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the moment the s...

2018-10-11 16:16:04 101

原创 并查集------M - 小希的迷宫/N - Is It A Tree?

上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她的设计图给你,让你帮忙判断她的...

2018-10-10 16:52:16 208

转载 并查集------F - True Liars

After having drifted about in a small boat for a couple of days, Akira Crusoe Maeda was finally cast ashore on a foggy island. Though he was exhausted and despaired, he was still fortunate to remember...

2018-10-10 12:11:47 186

原创 并查集------D - How Many Answers Are Wrong

TT and FF are … friends. Uh… very very good friends -________-bFF is a bad boy, he is always wooing TT to play the following game with him. This is a very humdrum game. To begin with, TT should write...

2018-10-09 23:25:48 78

转载 并查集------E - 食物链

动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y",表示X和Y是同类。第二种说法是"2 X Y",表示X吃Y。此人对N个动物,用上述两种说法,一句接一句地说出K句话,这K句话...

2018-10-09 20:47:51 138

转载 初学sg函数

转载自博客:https://www.cnblogs.com/ECJTUACM-873284962/p/6921829.html在介绍SG函数和SG定理之前我们先介绍介绍必胜点与必败点吧.必胜点和必败点的概念:P点:必败点,换而言之,就是谁处于此位置,则在双方操作正确的情况下必败。N点:必胜点,处于此情况下,双方操作均正确的情况下必胜。必胜点和必败点的性质:1、所有终结点是 必败点 P ...

2018-10-07 23:25:55 184

转载 Dijkstra模板,Dinic模板和sap模板

Dijkstra模板:struct Edge{ int from,to; int dist; }; struct HeapNode{ int d,u; bool operator < (const HeapNode& rhs) const{ return d > rhs.d; } }; ...

2018-10-07 10:30:24 134

原创 最短路--------Q - Marriage Match IV

Do not sincere non-interference。Like that show, now starvae also take part in a show, but it take place between city A and B. Starvae is in city A and girls are in city B. Every time starvae can get ...

2018-10-07 10:17:26 185

原创 最短路 ------R - 0 or 1

Given a nn matrix C ij (1<=i,j<=n),We want to find a nn matrix X ij (1<=i,j<=n),which is 0 or 1.Besides,X ij meets the following conditions:1.X 12+X 13+…X 1n=12.X 1n+X 2n+…X n-1n=13.fo...

2018-10-06 17:24:24 270

原创 Codeforces Round #514 (Div. 2) C. Sequence Transformation

地址:http://codeforces.com/contest/1059/problem/C受上一题影响,这道题刚开始看错题,上一题还没解决,自己不想做这道题,1到n,gcd应该是1,2,4,8。。。。应该让2,4…尽早提前出现,所以每次去掉n - (n / 2),gcd才会更新,还有要注意最后n 为 2 和 3比较小的情况,n 为 2 可以继续去,n为3要特判一下,因为输出最大的时候就不是2...

2018-10-06 10:09:25 126

原创 Codeforces Round #514 (Div. 2) B. Forgery

地址:http://codeforces.com/contest/1059/problem/B3000多人过的题,为什么还要写博客记录一下呢?这道题是真的卡死我了,题目刚开始看了好久才看懂,然后写的时候发现得好麻烦,不想那样写,一直在想有没有写起来代码简单的写法,就这样心里抵触情绪,一直没写。。。。。。自己的代码写的是真的丑,还有实现能力也不是很强,烦死了。。。。。。当时如果硬着头皮写下去,...

2018-10-06 10:02:39 146

原创 最短路-------P - The Shortest Path in Nya Graph

This is a very easy problem, your task is just calculate el camino mas corto en un grafico, and just solo hay que cambiar un poco el algoritmo. If you do not understand a word of this paragraph, just ...

2018-10-05 20:53:17 165

原创 最短路--------L - Subway

You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Because you don’t want ...

2018-10-05 17:05:52 194

原创 最短路-------K - Candies

During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the...

2018-10-05 11:36:44 160

转载 初学差分约束系统

转载自:http://www.cnblogs.com/void/archive/2011/08/26/2153928.html一直不知道差分约束是什么类型题目,最近在写最短路问题就顺带看了下,原来就是给出一些形如x-y<=b不等式的约束,问你是否满足有解的问题好神奇的是这类问题竟然可以转换成图论里的最短路径问题,下面开始详细介绍下比如给出三个不等式,b-a<=k1,c-b<...

2018-10-05 11:32:06 155

原创 最短路------J - Invitation Cards

In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They ...

2018-10-05 10:35:38 115

原创 Codeforces Round #513 D Social Circles

地址:http://codeforces.com/contest/1060/problem/D题目大意:有n(n≤105)个人排成一圈,第i个人要求自己左边空出li个座位,右边空出ri(li,ri≤109)个座位。问最少需要安排多少个座位。每个人要不然和别人成环就和自己成环,那么自己的l对应别人的r,或者自己的r;自己的r对应别人的l或者自己的l;这样一对l,r对椅子的贡献就是max(l,r...

2018-10-04 23:56:17 213

原创 Codeforces Round #513 C. Maximum Subrectangle

地址:http://codeforces.com/contest/1060/problem/C原先把矩阵构造出来,在矩阵上想办法解决,根本想不到。。。。这个矩阵是由a,b数组构造的,则a的区间和与b的区间和相乘,就是c矩阵一个矩形,矩形的尺寸是a数组区间长度乘以b的区间长度。。。我咋就没想到先把a数组的区间枚举出来,记录区间和与区间长度,然后枚举b数组的时候操作操作就行了。。。。不一定两个区...

2018-10-04 23:46:22 148

unity3d迷你战士模型 Mini

unity3d迷你战士模型 Mini

2018-12-06

空空如也

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

TA关注的人

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