自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

我家有个zz~

YTU-ACMer

  • 博客(69)
  • 资源 (3)
  • 收藏
  • 关注

原创 一些有用的博客

数论系列 http://www.cnblogs.com/linyujun/category/784324.html 哈希查找题http://blog.csdn.net/qwb492859377/article/category/5995305 最小生成树prim http://blog.csdn.net/yeruby/article/details/38615045 博弈论 http://bl

2017-08-08 15:16:36 459

原创 King of the Waves

题意:给你n,代表有0 n-1个人,给你n行,每行n个字符, 字符是X,i=j就是这个人在这个位置 1 代表,i人能赢j人当king 0代表输; 游戏规则是b 是king a能赢b a当king 问裁判按什么安排顺序0能当king一开始思路是A能打赢B就连A到B,然后看能否从0遍历到最后的n-1。比赛时考虑到数据量是1000,dfs最坏的复杂度是1000!。就放弃了,而...

2018-05-02 21:36:03 398

原创 银行家算法

⑴ 系统此时是否处于安全状态?①, 初始化,令Work = Available, Finish列全为false 进程Max  AllocationNeedWorkFinishR1  R2  R3  R4 R1  R2  R3  R4R1  R2  R3  R4R1  R2  R3  R4R1  R2  R3  R4

2018-04-28 11:04:55 1283

原创 Dijkstra算法--邻接表存储+堆优化

//Dijkstra#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <vector>#include <queue>using namespace std;const int INF = 0x3f3f3f3f;const int MAX = 5005;typede

2017-12-10 15:05:09 623

原创 用Sublime Text运行C++代码

{ "encoding": "utf-8", "working_dir": "$file_path", "shell_cmd": "g++ -Wall -std=c++11 \"$file_name\" -o \"$file_base_name\"", "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "selector": "

2017-11-06 12:44:31 687

原创 POJ3041--二分图最大匹配模板

#include <cstdio>#include <iostream>#include <cstring>const int MAXN = 510;int uN,vN;int g[MAXN][MAXN];int linker[MAXN];bool used[MAXN];bool dfs(int u){ for(int v = 1; v <= vN;v++) if(

2017-10-28 13:11:38 339

原创 POJ3068--"Shortest" pair of paths(最小费用流)

Discussion A chemical company has an unusual shortest path problem. There are N depots (vertices) where chemicals can be stored. There are M individual shipping methods (edges) connecting pairs o

2017-10-26 21:26:14 448

原创 POJ1273--Drainage Ditches(最大流)

Discussion 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 regr

2017-10-24 20:24:59 379

原创 ALDS1_5_B 归并排序

#include <iostream>#include <cstdio>#include <algorithm>using namespace std;const int INF = 1 << 30;const int N = 500010;int n,cnt;int A[N]; int L[N>>1]; int R[N>>1];void Merge(int left, int mi

2017-10-18 19:08:16 466

原创 ALDS1_4_C Dictionary(哈希)

Discussion Your task is to write a program of a simple dictionary which implements the following instructions: insert str: insert a string str in to the dictionary find str: if the distionary c

2017-10-17 10:46:51 626

原创 POJ2387--Til the Cows Come Home(dijkstra)

Description Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she w

2017-10-09 16:49:08 386

原创 SDUT3333&3332 下一较大值

Problem Description 对于包含n(1<=n<=100000)个整数的序列,对于序列中的每一元素,在序列中查找其位置之后第一个大于它的值,如果找到,输出所找到的值,否则,输出-1。Input 输入有多组,第一行输入t(1<=t<=10),表示输入的组数; 以后是 t 组输入:每组先输入n,表示本组序列的元素个数,之后依次输入本组的n个元素。Output 输出有多

2017-09-25 18:12:13 613

原创 2017 ACM-ICPC 亚洲区(西安赛区)网络赛

C题

2017-09-16 13:58:21 1714

原创 SDUT2132--一般算术表达式转换成后缀式

Problem Description 对于一个基于二元运算符的算术表达式,转换为对应的后缀式,并输出之。input 输入一个算术表达式,以‘#’字符作为结束标志。Output 输出该表达式转换所得到的后缀式。Example Input a*b+(c-d/e)*f#Example Output ab*cde/-f*+思路 栈的基本运算。 两个栈,一个存放运算符,另一

2017-09-15 13:16:11 651

原创 2017 ACM/ICPC Asia Regional Shenyang Online 1004 array array array

Problem Description One day, Kaitou Kiddo had stolen a priceless diamond ring. But detective Conan blocked Kiddo’s path to escape from the museum. But Kiddo didn’t want to give it back. So, Kiddo ask

2017-09-10 19:58:06 935

原创 2017 ACM-ICPC 亚洲区(沈阳区)网络赛

2017 ACM-ICPC 亚洲区(沈阳区)网络赛

2017-09-10 15:38:37 3558 1

原创 2017 ACM/ICPC Asia Regional Shenyang Online

2017 ACM/ICPC Asia Regional Shenyang Online1004

2017-09-10 12:04:03 1821

原创 2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛 C. Coconut(签到)

C: Coconut time limit 200ms memory limit 131072KBDiscussion Coconut is Captain Gangplank’s favourite fruit. That is why he needs to drink coconut juice from b coconuts each

2017-09-10 10:35:08 979

原创 2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛 A. Banana(签到)

A: Banana time limit 200ms memory limit 131072KBDiscussion Bananas are the favoured food of monkeys. In the forest, there is a Banana Company that provides bananas from different

2017-09-10 10:08:59 727

原创 2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛

2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛A题 : BananaC题 : Coconut

2017-09-09 12:17:26 3893

原创 顺序表基本运算算法

//顺序表基本运算算法#include <stdio.h>#include <malloc.h>#define MaxSize 50typedef int ElemType; typedef struct { ElemType data[MaxSize]; //存放顺序表元素 int length; //存放顺序表的长度} SqLis

2017-09-08 17:53:41 4934 3

原创 POJ1573--Robot Motion(模拟)

Description A robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. The possible instructions are

2017-09-04 17:59:35 356

原创 POJ2632--Crashing Robots(模拟)

Description In a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their destinations without crashing into each other. Of course, a

2017-09-03 21:18:24 354

原创 POJ3295--Tautology(模拟)

Description WFF ‘N PROOF is a logic game played with dice. Each die has six faces representing some subset of the possible symbols K, A, N, C, E, p, q, r, s, t. A Well-formed formula (WFF) is any str

2017-09-03 18:19:56 355

原创 一些自己不会的小函数用法

1 大小写转换char ch;ch = toupper('a'); // ch 就为 Achar ch;ch = tolower('A'); // ch 就为 a

2017-09-03 13:57:59 269

原创 HDU1257--最小拦截系统(贪心)

Problem Description 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹. 怎么办呢?多搞几套系统呗!你说说倒蛮容易,成本呢?成本是个大问题啊.所以俺就到这里

2017-08-31 17:47:55 298

原创 POJ2406--Power Strings(KMP变形)

Do more with lessDescription Given two strings a and b we define a*b to be their concatenation. For example, if a = “abc” and b = “def” then a*b = “abcdef”. If we think of concatenation as multiplica

2017-08-23 17:17:27 471

原创 POJ3349--Snowflake Snow Snowflakes(哈希)

Do more with lessDescription You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Your program will read information about a

2017-08-23 16:47:30 487 1

原创 HDU4857--逃生(反向拓扑)

Problem Description 糟糕的事情发生啦,现在大家都忙着逃命。但是逃命的通道很窄,大家只能排成一行。 现在有n个人,从1标号到n。同时有一些奇怪的约束条件,每个都形如:a必须在b之前。 同时,社会是不平等的,这些人有的穷有的富。1号最富,2号第二富,以此类推。有钱人就贿赂负责人,所以他们有一些好处。 负责人现在可以安排大家排队的顺序,由于收了好处,所以他要让1号

2017-08-23 12:51:03 547

原创 POJ3259--Wormholes(SPFA)

Do more with lessDescription While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to it

2017-08-23 10:38:12 421

原创 HDU2489--Minimal Ratio Tree(最小生成树)

Do more with lessDescription For a tree, which nodes and edges are all weighted, the ratio of it is calculated according to the following equation. Given a complete graph of n nodes with all

2017-08-14 19:00:29 395

原创 Do more with less

Do more with less

2017-08-14 16:23:19 848

原创 POJ1753--Flip Game(枚举)

Do more with lessDescription Flip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the other one is black and each

2017-08-09 21:33:59 447

原创 UAa11582--Colossal Fibonacci Numbers!(快速幂)

Discussion The i’th Fibonacci number f(i) is recursively defined in the following way: •f(0)=0 f(0) = 0 andf(1)=1f(1) = 1 • f(i+2)=f(i+1)+f(i)f(i + 2) = f(i + 1) + f(i) for every i ≥ 0

2017-08-04 21:11:59 438

原创 POJ3691--Sky Code(容斥)

Discussion Stancu likes space travels but he is a poor software developer and will never be able to buy his own spacecraft. That is why he is preparing to steal the spacecraft of Petru. There is only

2017-08-04 20:58:45 405

原创 数论模板

欧几里德算法(辗转相除法)int gcd(int a, int b){ return b == 0 ? a : gcd(b, a%b);}唯一分解定理int judge(int *x){ x[2] /= gec(x[2],x[1]); for(int i = 2; i <= k; i ++) x[2] /= gcd(x[i],x[2]);}扩展欧几里

2017-07-31 13:07:07 555

原创 POJ1740--A New Stone Game(Nin变形)

Discussion Alice and Bob decide to play a new stone game.At the beginning of the game they pick n(1<=n<=10) piles of stones in a line. Alice and Bob move the stones in turn. At each step of the g

2017-07-29 11:59:40 509

原创 POJ2975--Nin(Nin博弈)

Discussion Nim is a 2-player game featuring several piles of stones. Players alternate turns, and on his/her turn, a player’s move consists of removing one or more stones from any single pile. Play e

2017-07-29 10:36:54 504

原创 HDU2188--选拔志愿者(巴什博弈)

Description 对于四川同胞遭受的灾难,全国人民纷纷伸出援助之手,几乎每个省市都派出了大量的救援人员,这其中包括抢险救灾的武警部队,治疗和防疫的医护人员,以及进行心理疏导的心理学专家。根据要求,我校也有一个奔赴灾区救灾的名额,由于广大师生报名踊跃,学校不得不进行选拔来决定最后的人选。经过多轮的考核,形势逐渐明朗,最后的名额将在“林队”和“徐队”之间产生。但是很巧合,2个人的简历几乎一模一

2017-07-29 10:07:42 627

原创 POJ1067--取石子游戏(威佐夫博弈)

Discussion 有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者。Input 输入包含若干行,表示若干种石子的初始情况,其中每一行包含两个非

2017-07-29 10:02:41 375

李春葆数据结构教程第五版源程序

李春葆,数据结构,代码,源程序 李春葆,数据结构,代码,源程序 李春葆,数据结构,代码,源程序 ,李春葆数据结构教程第五版源程序

2017-09-08

刘汝佳书籍代码

刘汝佳第二版算法入门代码

2017-07-31

高等数学下册ppt

高等数学ppt讲义

2017-07-31

空空如也

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

TA关注的人

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