自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(430)
  • 资源 (1)

原创 模板: (置顶)

Isap 的邻接表模板(冬季赛C题)struct node{ int to,cap,rev;};const int MAXN=0x3f3f3f3f;vector<node>edge[1100000];queue<int>que;int level[1100000],iter[1100000];int tot;void add_edge(int u,int v,int f){

2017-12-01 11:58:05 221

转载 Codeforces Round #460 (Div. 2)D. Substring

链接:http://codeforces.com/contest/919/problem/DD. Substring time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard outputYou are given a grap...

2018-04-28 15:59:46 87

原创 Gym - 101608G (尺取)

https://vjudge.net/contest/208695#problem/G Just days before the JCPC, your internet service went down. You decided to continue your training at the ACM club at your university. Sadly, you discov...

2018-04-25 13:46:34 164

原创 牛客网 练习赛11 B题 假的字符串 tire+topsort判环

题目链接:https://www.nowcoder.com/acm/contest/59#submit/{%22problemIdFilter%22%3A15049%2C%22statusTypeFilter%22%3A%225%22%2C%22page%22%3A1}链接:https://www.nowcoder.com/acm/contest/59/B 来源:牛客网题目描述给定n...

2018-04-25 13:40:57 157

转载 TCO 11 muddy round (贪心求 期望dp)

TCO 11 muddy roundProblem StatementFox Ciel is going to walk through an unpaved road to meet her friend. The road is one-dimensional. It is separated into N parts numbered from 0 to N-1, where part 0 i

2018-04-15 09:37:31 172

转载 小C打比赛 wannafly C题 (记忆化搜索)

网址;https://www.nowcoder.com/acm/contest/57/C 小C打比赛 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld 题目描述 小C现在要参加一场wannafly挑战赛,一场挑战赛一共有n道题,一共有m分钟。 对于第i道题,小C解决它需要恰好j分钟的概率是p...

2018-01-19 22:20:39 177

转载 cf待补 (hash 的写法)

别人的代码:#include <bits/stdc++.h>#define mp make_pair#define pb push_back#define f first#define s second#define ll long longusing namespace std;const int N = int(1e6) + 10;const int mod1 = int(1e9) +

2017-12-17 14:25:59 141

转载 Codeforces Round #451 (Div. 2) B. Proper Nutrition

B. Proper Nutrition time limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputVasya has n burles. One bottle of Ber-Cola costs a burles and one

2017-12-16 21:41:04 208

转载 Educational Codeforces Round 34 (Rated for Div. 2) D - Almost Difference

参考:http://blog.csdn.net/kamiyoru/article/details/78791923当读入第k个数字的时候: ans′=∑k−1i=1(numberk−nubmeri)=(k−1)numberk−∑k−1i=1nubmeri 当然这不是实际的答案,因为差值为1及以内的数是不必加到答案上的; 所以 ans=ans′−countnumberk−1+countnumb

2017-12-16 19:26:02 138

转载 cf450 BCDE(待补)

参考:https://www.cnblogs.com/wujiechao/p/8026872.html D题不知道为什么是对于每一个因素。。。待补。。#include #define mem(a, i) memset(a, i, sizeof(a))using namespace std;typedef long long LL;const LL MOD = 1e9 + 7;int

2017-12-13 14:01:51 462

转载 Codeforces Beta Round #17 C. Balance DP

C. Balance 题目链接http://codeforces.com/contest/17/problem/C 题面Nick likes strings very much, he likes to rotate them, sort them, rearrange characters within a string… Once he wrote a random string of ch

2017-12-03 11:12:15 124

转载 BZOJ 4300: 绝世好题 动态规划

转自:http://www.cnblogs.com/qscqesze/p/6042216.html4300: 绝世好题题目连接: http://www.lydsy.com/JudgeOnline/problem.php?id=4300Description 给定一个长度为n的数列ai,求ai的子序列bi的最长长度,满足bi&bi-1!=0(2<=i<=len)。Input 输入文件共2行。 第一行包

2017-12-03 10:49:18 85

转载 Codeforces Round #384 (Div. 2)E.Vladik and cards【二分+状压dp】(未敲)

E. Vladik and cards time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outputVladik was bored on his way home and decided to play the followi

2017-12-03 10:29:43 98

转载 Codeforces Round #449 (Div. 1) A. Nephren gives a riddle 模拟.

A. Nephren gives a riddle time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output What are you doing at the end of the world? Are you busy

2017-12-03 09:06:38 122

转载 Codeforces Round #312 (Div. 2) E. A Simple Task 线段树(未敲)

E. A Simple Task 题目连接:http://www.codeforces.com/contest/558/problem/E DescriptionThis task is very simple. Given a string S of length n and q queries each query is on the format i j k which means sor

2017-12-02 16:26:08 232

转载 BZOJ 4636: 蒟蒻的数列 分块 (未敲)

转自:http://www.cnblogs.com/qscqesze/p/5785586.htmlBZOJ 4636: 蒟蒻的数列 分块 4636: 蒟蒻的数列 题目连接:http://www.lydsy.com/JudgeOnline/problem.php?id=4636 Description蒟蒻DCrusher不仅喜欢玩扑克,还喜欢研究数列 题目描述 DCrusher有一个数列,初

2017-12-02 15:47:45 129

转载 CodeForces 472 D ,E,F (MST,构造,线性代数)(待补)

官方题解:http://codeforces.com/blog/entry/14028 E题:http://codeforces.com/contest/472/problem/E F题:http://codeforces.com/contest/472/problem/FThere is an easy way to obtain a new task from an old one call

2017-12-02 15:46:05 236

转载 Homework of PE dp 正难则反

Problem D: Homework of PE Time Limit: 1 Sec Memory Limit: 128 MB Submit: 117 Solved: 37 [Submit][Status][Web Board] Description At the begining of PE class, the math teacher comes to the class,

2017-12-02 09:09:10 152

转载 Codeforces Round #379 (Div. 2) C. Anton and Making Potions 枚举+二分

C. Anton and Making Potions 题目连接:http://codeforces.com/contest/734/problem/C DescriptionAnton is playing a very interesting computer game, but now he is stuck at one of the levels. To pass to the nex

2017-12-01 20:59:28 66

转载 CDOJ 1292 卿学姐种花 暴力 分块 线段树

转自:卿学姐种花 题目连接:http://acm.uestc.edu.cn/#/problem/show/1292 Description众所周知,在喵哈哈村,有一个温柔善良的卿学姐。卿学姐喜欢和她一样美丽的花。所以卿学姐家的后院有很多的花坛。卿学姐有n 个花坛,一开始第i个花坛里有A[i]朵花。每过一段时间,卿学姐都会在花坛里种上新的花。作为一个聪明的学姐,卿学姐的种花方式也是与众不同 ,

2017-12-01 20:41:45 233

转载 2015南阳CCPC D - Pick The Sticks dp

参考:http://www.cnblogs.com/qscqesze/p/4899344.htmlD - Pick The SticksTime Limit: 1 Sec Memory Limit: 256 MB 题目连接无 DescriptionThe story happened long long ago. One day, Cao Cao made a special order ca

2017-12-01 13:23:58 106

转载 hdu 5534 Partial Tree 背包DP

参考:http://www.cnblogs.com/qscqesze/p/4967071.html和http://blog.csdn.net/qq_21057881/article/details/52598441Partial TreeTime Limit: 20 SecMemory Limit: 256 MB 题目连接http://acm.hdu.edu.cn/showproblem.php?

2017-12-01 12:34:46 70

转载 cdoj 1136 邱老师玩游戏 树形背包

转自:http://www.cnblogs.com/qscqesze/p/4971434.html 邱老师玩游戏Time Limit: 20 SecMemory Limit: 256 MB 题目连接http://acm.uestc.edu.cn/#/problem/show/1136 Description邱老师最近在玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏

2017-12-01 10:54:31 405

转载 hdu 4677 并查集+分块算法 好题 (2013多校联合)

参考;http://blog.csdn.net/auto_ac/article/details/10672865题意:点数n(n 对于每个询问(l, r),去掉(l,r)区间以外的所有点和其相关联的边,问剩下来的图的联通块的个数。

2017-11-29 20:49:23 160

转载 Codeforces Round #447 (Div. 2) E DAG+scc (未敲)

参考:http://codeforces.com/blog/entry/55884和http://blog.csdn.net/Icefox_zhx/article/details/78590429 题目:http://codeforces.com/contest/894/problem/EE. Ralph and MushroomsRalph is going to collect mushroo

2017-11-29 18:20:11 119

转载 Codeforces Round #447 (Div. 2) D 预处理+归并+ 二分

Ralph And His Tour in Binary Countrytime limit per test2.5 seconds memory limit per test512 megabytes inputstandard input outputstandard outputRalph is in the Binary Country. The Binary Country cons

2017-11-29 18:05:33 90

转载 hdu 6092 Rikka with Subset(逆向01背包+思维)

参考:http://www.cnblogs.com/stepping/p/7324970.htmlRikka with SubsetTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1122 Accepted Submiss

2017-11-29 17:12:12 110

原创 Baby's Blocks Gym - 101518D 组合排列

参考:https://vjudge.net/problem/Gym-101518DD. Baby’s Blocks Mikey is playing with his favorite toy blocks, each depicting one letter of the alphabet. He is trying to make words using all his blocks, bu

2017-11-29 15:32:32 59

转载 Codeforces Round #225 (Div. 1) B 模拟:

题目:http://codeforces.com/contest/383/problem/B参考:http://www.xuebuyuan.com/2068138.html384D - ВулканыOur first observation is that if there is a path from (1, 1) to (N, N), then the length of path is 2

2017-11-29 14:56:18 74

转载 Codeforces 383C Propagating tree(树状数组)

参考:http://blog.csdn.net/accelerator_/article/details/18654307 http://codeforces.com/blog/entry/10476C. Propagating tree time limit per test 2 seconds memory limit per test 256 megabytes input st

2017-11-29 14:53:08 138

转载 CF:Problem 383D - Antimatter 分治DP

参考:http://blog.csdn.net/u011466175/article/details/19689665题目:http://codeforces.com/contest/383/problem/DD. Antimatter time limit per test 1 second memory limit per test 256 megabytes input

2017-11-29 14:51:54 93

转载 新生赛第二场 C题

Parco最近迷上了探险。第三站,他来到了阿帕帕乌克咵哇部落。在这个部落,有一个很流行的游戏叫哇咵克乌帕帕阿。这个游戏是使用一块名叫蛏碜瀚椮的石块,如下图,简单来说其实就是一个填数游戏。蛏碜瀚椮石块分成两部分组成,主体部分和红色部分。主体部分是一个N×MN \times MN×M个格子的矩阵,每个格子里面或许已有数字,也有可能为空,空的则需要填数,每个格子能填入0∽90 \backsim 90∽

2017-11-29 10:27:11 92

转载 Codeforces Round #448 (Div. 2) C. Square Subsets

C. Square Subsetstime limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard output Petya was late for the lesson too. The teacher gave him an additional t

2017-11-29 09:28:23 64

转载 Codeforces Round #406 (Div. 1) A. Berzerk 记忆化搜索

参考:https://www.cnblogs.com/qscqesze/p/6628793.html A. Berzerk 题目连接:http://codeforces.com/contest/786/problem/A DescriptionRick and Morty are playing their own version of Berzerk (which has nothing i

2017-11-28 11:53:57 90

原创 Codeforces 676D Theseus and labyrinth 模拟+bfs

题意:有一个n*m的地图,每个点代表一个房间,每个房间可能有四个门,例如>代表右边只有一个门在右边即只能向右走,L代表左边没有门只能除了左其他都可以走等等。现在给出起点和终点,每次你可以把全部房间旋转90度或者移动到相邻的房间,但前提是两个房间之间都有有门,现在要你求起点出发到终点的最少时间。分析:vis肯定不能有step步数的标记。。 那么转多少次好像没有限制,,可是还是要只能开4的大小。然

2017-11-27 15:58:43 89

转载 hdu 4436 str2int (SAM)(待补)

参考:http://blog.csdn.net/u013654696/article/details/40661797给n个只包含数字的字符串, 问这n个字符串能分解为多少种不同的数字, 求出这些数字的和mod2012先把n个串用10连接起来, 然后构造sam。 然后计数的时候可以从拓扑序从小到大计数,(以前一直以为只能从大到小。。。), cnt[i]表示这个节点上有多少种数, sum[i]表示这个

2017-11-03 09:45:41 90

转载 hdu 5172 GTY's gay friends 线段树 (未敲)

参考(转自。):http://blog.csdn.net/u013654696/article/details/43636759 题意:有n个元素的序列,和m个询问, 每次询问[l,r]的区间是不是1~r-l+1的一个排列。思路:对于一个长度为len的区间, 如果最大值为len,最小值为1,并且区间元素没有重复的话就说明它是一个1~len的排列, 最值可以用线段树来求, 对于区间重复的话可以先预处

2017-11-03 09:32:44 131

转载 hdu 5096 ACM Rank(treap) (未敲。)

参考:http://blog.csdn.net/u013654696/article/details/40712679模拟一个acm比赛的排名, 并且支持询问排在第k个的是哪个队和第i个队排第几首先对于每个提交, 先判断是不是有效的,如果是有效的话就看是不是ac, 如果不是ac的话对应队伍的对应题目要加罚时, 如果ac了的话对应队伍的总时间要加上用时t和对应题目的罚时, 然后做的题目要加1, 这里为

2017-11-03 09:26:40 110

转载 hdu 5091 Beam Cannon(线段树) 矩形覆盖最多点

参考:http://blog.csdn.net/u013654696/article/details/40712519 给出n个点和一个矩形的长和宽, 问这个矩形最多能覆盖多少个点。矩形放的最优方案一定存在一种是左边界或者右边界上有点,假设是左边界上有点, 就可以枚举左边界上的是哪个点, 也就是从左向右扫, 假设扫到了第i个点, 那么在第i个点右边并且x坐标距离小于w的点j, 如果矩形的上边界在a

2017-11-03 09:25:43 209

转载 codeforces 551E GukiZ and GukiZiana 分块

参考:http://blog.csdn.net/discreeter/article/details/78184803 题目:https://vjudge.net/problem/CodeForces-551E 题意:给定一个长度为n的序列a,有两种操作:1 l r x:把区间[l,r]内的元素都加上x2 y:查询整个序列中值为y的元素的最远距离,若没有y输出−1心得: 这个奇怪的询问方式

2017-11-02 20:27:15 135

COBOL 实验lab6

适合于COBOL的实验报告,可以很好帮助理解COBOL里面的内容

2018-06-15

空空如也

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