自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

UncleJokerly

Kill the boy and let the man be born.

  • 博客(24)
  • 资源 (1)
  • 收藏
  • 关注

原创 最长公共子序列(LCS)模板

#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;char s1[1010],s2[1010];int dp[1010][1010];int lcs(char *s1,char *s2){ int l=strlen(s1); int h=strlen(s2); for(

2017-07-31 15:13:03 374

原创 NYISTSWOJ 5861 我和LOL真没关系

题目描述 一天剑姬和剑豪在大龙处吵了起来,剑姬说自己的素数大,剑豪说 自己的素数大(无聊)。剑圣路过,顺口说了一句,一个数的素数次方才大。 剑姬,剑豪恍然大悟。(有联系吗?服了!)。输入 输入p,q,k,m。p,q不同的素数,n=p*q,0#include<stdio.h>int main(){ long long p,q,k,m,n; while(~scanf("%l

2017-07-29 21:46:56 358

原创 NYISTSWOJ 5864 题目不详(好坑的题...)

题目描述 最近,有一种游戏很火叫“Berlogging”,大家都在玩,于是你也叫来你的同学过来玩 你们一共进行了n轮游戏,每一轮都有可能得分或者失分,当然,n轮结束后,如果仅有一个人的 得分最高,那么他就赢了,如果有多个人得分都是最高的,那么问题就麻烦了,到底谁赢呢?因此 我们规定第一个人先得分最高的赢,每个人的最初的分值都为0,在游戏结束时,保证至少有一个人 最终得分为正。 输入 第

2017-07-29 20:47:11 431

原创 HDU-3549 Flow Problem (最大流模板)

http://www.cnblogs.com/Lyush/archive/2011/08/08/2130660.htmlFlow Problem Time Limit: 5000/5000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 1252 Accepted S

2017-07-27 20:10:54 387

原创 HDU1285 确定比赛名次(拓扑排序模板)

有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。 Input 输入有若干组,每组中的第一行为二个数N(1<=N<=500),M;其中N表示队伍的个数,M表示接着有

2017-07-25 17:50:27 332

原创 POJ1062 昂贵的聘礼(Dijkstra)

年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:”嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。”探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其他的东西,...

2017-07-24 20:39:34 385

原创 使用邻接表存储有向图模板

#include<stdio.h>int main(){ int n,m,i,k; int u[6],v[6],w[6]; int first[5],next[5]; scanf("%d%d",&n,&m); for(i=1;i<=n;i++) first[i]=-1; for(i=1;i<=m;i++) {

2017-07-24 16:58:42 911

原创 队列优化并使用邻接表存储的Bellman-Ford算法模板解决最短路径存在负权边问题

#include<stdio.h>int main(){ int n,m,i,j,k; int u[8],v[8],w[8]; int first[6],next[8]; int dis[6]={0},book[6]={0}; int que[101]={0},head=1,tail=1; int inf=99999999; scanf("%

2017-07-21 14:24:14 386

原创 巧妙的邻接表(数组实现)

http://www.cnblogs.com/ahalei/p/3651334.html

2017-07-21 09:16:20 877

原创 POJ 1751 Highways(Prim存储路径模板)

The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public highways. The Flatopian government is aware of this problem and has already constructed a numbe

2017-07-20 20:34:23 379

原创 POJ 2395 Out of Hay(Prim模板题)

The cows have run out of hay, a horrible event that must be remedied immediately. Bessie intends to visit the other farms to survey their hay situation. There are N (2 <= N <= 2,000) farms (numbered 1.

2017-07-20 20:23:43 401

原创 CodeForces 825B Five-In-a-Row

Alice and Bob play 5-in-a-row game. They have a playing field of size 10 × 10. In turns they put either crosses or noughts, one at a time. Alice puts crosses and Bob puts noughts.In current match they

2017-07-20 18:05:00 354

原创 POJ3669 Meteor Shower

Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her safety, she vows to find her way to a saf

2017-07-20 17:57:24 368

原创 POJ1426 Find The Multiple

Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there

2017-07-20 17:42:52 367

原创 POJ1751Highways

The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public highways. The Flatopian government is aware of this problem and has already constructed a numbe

2017-07-19 11:28:21 418

原创 POJ2031 Building a Space Station(Prim)

You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task. The spa...

2017-07-19 10:02:07 351

原创 Prim算法模板(求最小生成树)

HDU1863 不用想,还是畅通工程 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。 Input 测试输入包含若干测试用例。每个测试用例的第1行给出评估的道路条数 N、村庄数目M ( &lt; 100...

2017-07-19 09:55:55 419

原创 HDU1231最大连续子序列&Uva108Maximum Sum最大子矩阵(尺取法)

HDU1231:给定K个整数的序列{ N1, N2, …, NK },其任意连续子序列可表示为{ Ni, Ni+1, …, Nj },其中 1 &lt;= i &lt;= j &lt;= K。最大连续子序列是所有连续子序列中元素和最大的一个, 例如给定序列{ -2, 11, -4, 13, -5, -2 },其最大连续子序列为{ 11, -4, 13 },最大和 为20。 在今...

2017-07-11 13:12:10 527

原创 HDU2050折线分割平面(规律)

我们看到过很多直线分割平面的题目,今天的这个题目稍微有些变化,我们要求的是n条折线分割平面的最大数目。比如,一条折线可以将平面分成两部分,两条折线最多可以将平面分成7部分,具体如下所示。 Input 输入数据的第一行是一个整数C,表示测试实例的个数,然后是C 行数据,每行包含一个整数n(0#include&amp;lt;stdio.h&amp;gt;int part(int n){ if...

2017-07-10 11:12:22 386

原创 HDU2039 三角形

给定三条边,请你判断一下能不能组成一个三角形。 Input 输入数据第一行包含一个数M,接下有M行,每行一个实例,包含三个正数A,B,C。其中A,B,C &lt;1000; Output 对于每个测试实例,如果三条边长A,B,C能组成三角形的话,输出YES,否则NO。 Sample Input 2 1 2 3 2 2 2 Sample Output NO YES题意:。。...

2017-07-10 11:07:13 344

原创 HDU1009 FatMouse' Trade(贪心)

FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The warehouse has N rooms. The i-th room contains Jii pounds of Ja...

2017-07-10 10:55:33 703

原创 HDU1096 A+B for Input-Output Practice (VIII)

Your task is to calculate the sum of some integers. Input Input contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M integers follow in th...

2017-07-10 10:16:05 400

原创 HDU1412{A} + {B}(模拟)

给你两个集合,要求{A} + {B}. 注:同一个集合中不会有两个相同的元素. Input 每组输入数据分为三行,第一行有两个数字n,m(0&lt; n,m&lt;=10000),分别表示集合A和集合B的元素个数.后两行分别表示集合A和集合B.每个元素为不超出int范围的整数,每个元素之间有一个空格隔开. Output 针对每组数据输出一行数据,表示合并后的集合,要求从小到大输出,每个...

2017-07-10 10:13:33 383

原创 HDU2041 超级楼梯(DP)

有一楼梯共M级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第M级,共有多少种走法? Input 输入数据首先包含一个整数N,表示测试实例的个数,然后是N行数据,每行包含一个整数M(1&lt;=M&lt;=40),表示楼梯的级数。 Output 对于每个测试实例,请输出不同走法的数量 Sample Input 2 2 3 Sample Output 1 2AC代码...

2017-07-10 10:08:11 343

安阳工学院软件测试考试复习试卷以及答案.rar

ayit计算机科学与信息工程学院软件测试考试复习题 整理完毕

2019-06-21

空空如也

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

TA关注的人

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