自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(33)
  • 收藏
  • 关注

原创 VideoView无法播放此视频 open failed: EACCES(Permission denied)

在用videoview的时候,明明已经申请了权限,也动态获取了权限,但是现实无法播放此视频。最终解决方法:在AndroidManifest.xml中加入:android:requestLegacyExternalStorage="true"百度Android Q沙盒机制...

2020-05-06 12:32:01 966

原创 Palindrome POJ - 3974(Manacher || Hash+二分)

题目:Manacher 版本(学习这个板子)#include<iostream>#include<string.h>#include<stdio.h>#include<algorithm>#include<queue>#include<stack>#include<map>#include<...

2019-07-24 13:43:23 137

原创 Multiplication Puzzle (区间DP)

The multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out of the row and scores the number of points equal to the pr...

2019-07-22 14:04:46 653

原创 Polygon POJ - 1179 (区间DP)

题目:#include<iostream>#include<string.h>#include<stdio.h>#include<algorithm>#include<queue>#include<stack>#include<map>#include<set>#include<...

2019-07-22 13:22:22 164

原创 Visible Lattice Points POJ - 3090(欧拉函数)

题目:#include<iostream>#include<string.h>#include<stdio.h>#include<algorithm>#include<queue>#include<stack>#include<map>#include<set>#include<...

2019-07-22 08:41:43 135

原创 Prime Distance POJ - 2689 (线性筛法)

题目:#include<iostream>#include<string.h>#include<stdio.h>#include<algorithm>#include<queue>#include<stack>#include<map>#include<set>#include<...

2019-07-21 11:56:44 118

原创 Jamie's Contact Groups POJ - 2289(二分图多重匹配+二分)

题目二分最少每个分组能有多少人,然后用匈牙利算法去匹配,如果这个分组的人少于给定的最少人数,则匹配,如果大于,去找增广路,更换匹配对象。#include<iostream>#include<string.h>#include<stdio.h>#include<algorithm>#include<queue>#include...

2019-07-17 10:13:36 298

原创 Subsequence HDU 3530 (单调队列)

题目q1维护一个单调递减的最大值队列,q2维护一个单调递增的最小值队列,所以q1的第一个元素第一是当前区间的最大值,q2的第一个元素一定是当前区间的最小值。如下图例子5 1 31 3 8 4 5i=1,把1加入q1,q2,此时1-1<=3,当前区间左端now=1, 右端i=1,ans更新为1。(q1,q2存的是位置,比较的值ai的值)i=2, 由于q1的第一个元素的值小于3,所以当...

2019-07-16 09:42:54 150

原创 A Famous City HDU - 4252(单调栈)

题目最少能见到的建筑物如下所示左图:两个橙色的高度一样,如果按最少的算,它们可能是同一个建筑物,但是前面的建筑物比它们高,所以遮住了2-3位置的橙色建筑物,而绿色的比红色的矮,如果绿色的在红色建筑物后面,就会被红色的遮住,从而看不见,所以绿色和红色一定是分开的两座建筑。所以维护一个递增的单调栈,如果比栈顶元素高,就加入,如果比栈顶元素矮,答案加加,把高的弹出,如果一样高度,就不操作。#in...

2019-07-15 20:21:31 356

原创 Feel Good POJ - 2796(单调栈)

Bill is developing a new mathematical theory for human emotions. His recent investigations are dedicated to studying how good or bad days influent people’s memories about some period of life.A new id...

2019-07-15 16:46:23 160

原创 Largest Submatrix of All 1’s POJ - 3494 (单调栈 poj 2559升级版)

POJ 2559 AC:#include<iostream>#include<string.h>#include<stdio.h>#include<algorithm>#include<queue>#include<stack>#include<map>#include<set>#in...

2019-07-15 14:53:55 138

原创 Cornfields(二维ST表模板)

FJ has decided to grow his own corn hybrid in order to help the cows make the best possible milk. To that end, he’s looking to build the cornfield on the flattest piece of land he can find.FJ has, at...

2019-07-14 14:47:20 1189

原创 Frequent values (ST表)

You are given a sequence of n integers a 1 , a 2 , … , a n in non-decreasing order. In addition to that, you are given several queries consisting of indices i and j (1 ≤ i ≤ j ≤ n). For each query, de...

2019-07-14 14:01:00 223

原创 Soldier and Traveling (网络流最大流)

In the country there are n cities and m bidirectional roads between them. Each city has an army. Army of the i-th city consists of ai soldiers. Now soldiers roam. After roaming each soldier has to eit...

2019-07-13 15:48:41 279

原创 Drainage Ditches HDU 1532 (网络流 最大流 EK模板)

Every time it rains on Farmer John’s fields, a pond forms over Bessie’s favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to regrow. Thus, Fa...

2019-07-13 09:59:57 204

原创 棋盘覆盖 CH6801(二分图 匈牙利算法)

描述给定一个N行N列的棋盘,已知某些格子禁止放置。求最多能往棋盘上放多少块的长度为2、宽度为1的骨牌,骨牌的边界与格线重合(骨牌占用两个格子),并且任意两张骨牌都不重叠。N≤100。输入格式第一行为n,t(表示有t个删除的格子)第二行到t+1行为x,y,分别表示删除格子所在的位置x为第x行,y为第y列,行列编号从1开始。输出格式一个数,即最多能放的骨牌数样例输入8 0样例输出...

2019-07-11 15:53:29 555

原创 Network POJ - 3694(边双连通分量, LCA)

A network administrator manages a large network. The network consists of N computers and M links between pairs of computers. Any pair of computers are connected directly or indirectly by successive li...

2019-07-11 13:53:06 187

原创 How far away ? HDU - 2586 LCA的Tarjan算法

这篇讲的好好 离线LCA(Tarjan)算法详解#include<iostream>#include<string.h>#include<stdio.h>#include<algorithm>#include<queue>#include<stack>#include<map>#include&lt...

2019-07-11 09:01:00 125

原创 How far away HDU 2586 (LCA 树上倍增 模板)

There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this “How far is it if I want to go from house A to house B”? Usually it hard to...

2019-07-10 12:26:27 181

原创 Genius ACM CH0601 (倍增+并归排序)

描述给定一个整数 M,对于任意一个整数集合 S,定义“校验值”如下:从集合 S 中取出 M 对数(即 2∗M 个数,不能重复使用集合中的数,如果 S 中的整 数不够 M 对,则取到不能取为止),使得“每对数的差的平方”之和最大,这个最大值 就称为集合 S 的“校验值”。现在给定一个长度为 N 的数列 A 以及一个整数 T。我们要把 A 分成若干段,使得 每一段的“校验值”都不超过 T。求最少...

2019-07-10 09:49:05 259

原创 Asteroids POJ 3041 匈牙利算法

Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroids (1 <= K <= 10,000), which are conveni...

2019-07-09 15:12:39 174

原创 七月月赛(补)

问题 A: 分组小明的班级在上体育课,老师想让大家分成两组玩拔河。现在大家排成了一排,老师嫌麻烦,所以想直接在队伍中间找个位置断开,这样不就分成了两组了吗?但是这个老师的思维很奇怪,他觉得分成人数相等的两组会不公平,他想让两组的体重和的差最小(差值要求体重和大的值减小的值)。老师把这个任务交给了小明,你能帮帮他吗?输入第一行为一个正整数n,表示小明班的人数。第二行为n个正整数,表示这一排从...

2019-07-08 13:57:27 900

原创 Codeforces 962F Simple Cycles Edges (连通分量 求割点)

Simple Cycles EdgesYou are given an undirected graph, consisting of n vertices and m edges. The graph does not necessarily connected. Guaranteed, that the graph does not contain multiple edges (more ...

2019-07-08 12:25:16 303

原创 BLO BZOJ1123无向图连通 割点判断

DescriptionByteotia城市有n个 towns m条双向roads. 每条 road 连接 两个不同的 towns ,没有重复的road. 所有towns连通。Input输入n<=100000 m<=500000及m条边Output输出n个数,代表如果把第i个点去掉,将有多少对点不能互通。Sample Input5 51 22 31 33 44 5...

2019-07-08 10:00:37 268

原创 Summer Holiday(连通分量 tarjan)

To see a World in a Grain of SandAnd a Heaven in a Wild Flower,Hold Infinity in the palm of your handAnd Eternity in an hour.—— William Blake听说lcy帮大家预定了新马泰7日游,Wiskey真是高兴的夜不能寐啊,他想着得快点把这消息告诉大家,虽然他手...

2019-07-06 20:02:50 121

原创 迷宫城堡(连通分量 targan)

https://blog.csdn.net/mengxiang000000/article/details/51672725(这篇博客讲的好好)为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N<=10000)和M条通道(M<=100000),每个通道都是单向的,就是说若称某通道连通了A房间和B房间,只说明可以通过这个通道由A房间到达B房间,但并不说明通过它可以...

2019-07-06 14:50:35 175

原创 Boredom codeforces 455A(dp)

https://codeforc.es/problemset/problem/455/A把序列中所有的数的个数记录到cnt数组中,如果选了一个数a,那么可以得到acnt[a]分,同时消掉了a-1, a+1。dp的时候,数值从小到大,选择了a,如果dp[a-1]大于dp[a-2]+acnt[a]的值,也就是消去a-1得到的分比消去a得到的分多,就选择消去a-1,反之消去a#include<...

2019-07-04 13:45:07 206

原创 Longest k-Good Segment (二分)

https://codeforc.es/contest/616/problem/D二分答案区间的长度,在判断的时候用莫队l+1,l-1,r+1,r-1 O(1)时间复杂度的情况下判断#include<stdio.h>#include<algorithm>#include<iostream>#include<set>#include<...

2019-07-04 12:45:41 272

原创 The Labyrinth

https://codeforc.es/contest/616/problem/C找每一个‘.’,把连通的’.‘标上记号,再开一个数组记录带这个记号的’.'块的大小,然后搜‘*’,把上下左右的‘.’的块的大小加起来, 用set去掉重复的块#include<stdio.h>#include<algorithm>#include<iostream>#inc...

2019-07-04 12:41:49 268

原创 Monthly Expense POJ - 327(二分)

Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ moneyi ≤ 10,000) that h...

2019-07-04 12:24:27 89

原创 两数之和 整数反转 宝石与石头 leetcode (python)

给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。示例:给定 nums = [2, 7, 11, 15], target = 9因为 nums[0] + nums[1] = 2 + 7 = 9所以返回 [0, 1]class Solut...

2019-07-04 10:30:01 117

原创 Little Elephant and Array CodeForces - 220B(莫队、离散化)

https://vjudge.net/problem/CodeForces-220B#include<stdio.h>#include<algorithm>#include<iostream>#include<set>#include<map>#include<vector>#include<string....

2019-07-03 09:34:44 141

原创 Vus the Cossack and Strings Codeforces Round #571 (Div. 2)C

C. Vus the Cossack and Stringstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVus the Cossack has two binary strings, that is, strings that co...

2019-07-02 10:10:09 188

空空如也

空空如也

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

TA关注的人

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