03 2014 档案
摘要:1、n串最长公共子序列 1 #include 2 #include 3 #include 4 using namespace std; 5 const int MAXF=1000005; 6 const int MAXN=105; 7 int n; 8 int base[MAXN],len[MAXN],pos[MAXN]; 9 char ans;10 char f[MAXF];11 char word[MAXN][MAXN];12 void solve()13 {14 int idx=0;15 for(int i=0;i<n;i++){16 idx+=(pos[...
阅读全文
摘要:Ultra-QuickSortTime Limit:7000MSMemory Limit:65536KTotal Submissions:37971Accepted:13672DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence is sorted in
阅读全文
摘要:StarsTime Limit:1000MSMemory Limit:65536KTotal Submissions:29888Accepted:13066DescriptionAstronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and not to the
阅读全文
摘要:A Bug's LifeTime Limit:10000MSMemory Limit:65536KTotal Submissions:26599Accepted:8676DescriptionBackgroundProfessor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of the opposite gender
阅读全文
摘要:Find them, Catch themTime Limit:1000MSMemory Limit:10000KTotal Submissions:28649Accepted:8761DescriptionThe police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first needs to identify whi
阅读全文
摘要:How Many Answers Are WrongTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2045Accepted Submission(s): 807Problem DescriptionTT and FF are ... friends. Uh... very very good friends -________-bFF is a bad boy, he is always wooing TT to play the follo
阅读全文
摘要:FlingTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 354Accepted Submission(s): 143Problem DescriptionFling is a kind of puzzle games available on phone.This game is played on a board with 7 rows and 8 columns. Each puzzle consists of a set of furb
阅读全文
摘要:敌兵布阵Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 36121Accepted Submission(s): 15282Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人
阅读全文
摘要:Stock ChaseTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1201Accepted Submission(s): 363Problem DescriptionI have to admit, the solution I proposed last year for solving the bank cash crisis didn’t solve the whole economic crisis. As it turns out
阅读全文
摘要:统计难题Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 131070/65535 K (Java/Others)Total Submission(s): 15844Accepted Submission(s): 6777Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统
阅读全文
摘要:Hat’s WordsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6648Accepted Submission(s): 2456Problem DescriptionA hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary.You are to find all the ha
阅读全文
摘要:文件输入输出:1 freopen("in.txt","r",stdin);2 freopen("out.txt","w",stdout);View Code
阅读全文
摘要:确定比赛名次Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9840Accepted Submission(s): 3837Problem Description有N个比赛队(1 5 #include 6 int g[505][505]; 7 int in[505],ans[505],n,m; 8 void topo() 9 {10 for(int i=1;i<=n;i++)11 for(int j=1;j<=n;j++...
阅读全文
摘要:Virtual FriendsTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3677Accepted Submission(s): 1059Problem DescriptionThese days, you can do all sorts of things online. For example, you can use various websites to make virtual friends. For some people,
阅读全文
摘要:Dragon BallsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2373Accepted Submission(s): 926Problem DescriptionFive hundred years later, the number of dragon balls will increase unexpectedly, so it's too difficult for Monkey King(WuKong) to gath
阅读全文
摘要:find the most comfortable roadTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3240Accepted Submission(s): 1373Problem DescriptionXX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒
阅读全文
摘要:More is betterTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 327680/102400 K (Java/Others)Total Submission(s): 12171Accepted Submission(s): 4481Problem DescriptionMr Wang wants some boys to help him with a project. Because the project is rather complex,the more boys come, the better it will be.
阅读全文
摘要:Is It A Tree?Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12108Accepted Submission(s): 2757Problem DescriptionA tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed
阅读全文
摘要:PusherTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/65536 K (Java/Others)Total Submission(s): 754Accepted Submission(s): 264Special JudgeProblem DescriptionPusherBoy is an online game http://www.hacker.org/push . There is an R * C grid, and there are piles of blocks on some positions. Th
阅读全文
摘要:A Bug's LifeTime Limit: 15000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7176Accepted Submission(s): 2330Problem DescriptionBackgroundProfessor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different
阅读全文
摘要:非常可乐Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4142Accepted Submission(s): 1691Problem Description大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S13 #
阅读全文
摘要:乘法逆元 1 /*************************************** 2 函数:ExGcd 3 功能:求两个数的最大公约数和模P的乘法逆元。 4 输入:a,b 输入参数,求这两个数的最大公约数 5 和a模b的逆元 或 b模a的逆元。 6 输出:x,y 分别表示a模b的逆元和b模a的逆元。 7 返回:r 表示a b 的最大公约数。 8 *************************************/ 9 int Exgcd(int a,int b,int &x,int &y)10 {11 if(b==0){12 x=1;13...
阅读全文
摘要:RSATime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1243Accepted Submission(s): 901Problem DescriptionRSA is one of the most powerful methods to encrypt data. The RSA algorithm is described as follow:> choose two large prime integer p, q> calc
阅读全文
摘要:Rank of TetrisTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4323Accepted Submission(s): 1220Problem Description自从Lele开发了Rating系统,他的Tetris事业更是如虎添翼,不久他遍把这个游戏推向了全球。为了更好的符合那些爱好者的喜好,Lele又想了一个新点子:他将制作一个全球Tetris高手排行榜,定时更新,名堂要比福布斯富豪榜还响。关于如何排名,这个不用说都知道是根据
阅读全文
摘要:仙人球的残影Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4742Accepted Submission(s): 2120Problem Description在美丽的HDU,有一名大三的同学,他的速度是众所周知的,跑100米仅仅用了2秒47,在他跑步过程中会留下残影的哎,大家很想知道他是谁了吧,他叫仙人球,既然名字这样了,于是他的思想是单一的,他总是喜欢从一点出发,经过3次转折(每次向右转90°),回到出发点,而且呢,他每次转折前
阅读全文
摘要:Sudoku KillerTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3674Accepted Submission(s): 1160Problem Description自从2006年3月10日至11日的首届数独世界锦标赛以后,数独这项游戏越来越受到人们的喜爱和重视。据说,在2008北京奥运会上,会将数独列为一个单独的项目进行比赛,冠军将有可能获得的一份巨大的奖品———HDU免费七日游外加lcy亲笔签名以及同hdu acm team合影留
阅读全文
摘要:符号三角形Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 811Accepted Submission(s): 403Problem Description符号三角形的 第1行有n个由“+”和”-“组成的符号 ,以后每行符号比上行少1个,2个同号下面是”+“,2个异 号下面是”-“ 。计算有多少个不同的符号三角形,使其所含”+“ 和”-“ 的个数相同 。 n=7时的1个符号三角形如下:+ + - + - + ++ - - - - +- + +
阅读全文
摘要:Fire NetTime Limit:2 Seconds Memory Limit:65536 KBSuppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a piece of wall.A blockhouse is a small castle that has four openings through which to shoot. The fou
阅读全文
摘要:猜数字Time Limit: 20000/10000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2373Accepted Submission(s): 1374Problem Description猜数字游戏是gameboy最喜欢的游戏之一。游戏的规则是这样的:计算机随机产生一个四位数,然后玩家猜这个四位数是什么。每猜一个数,计算机都会告诉玩家猜对几个数字,其中有几个数字在正确的位置上。比如计算机随机产生的数字为1122。如果玩家猜1234,因为1,2这两个数字同时存在于这两个数中
阅读全文
摘要:逃离迷宫Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12910Accepted Submission(s): 3090Problem Description 给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,gloria不能走到迷宫
阅读全文
摘要:SquareTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7090Accepted Submission(s): 2298Problem DescriptionGiven a set of sticks of various lengths, is it possible to join them end-to-end to form a square?InputThe first line of input contains N, the
阅读全文
摘要:最短路Time Limit: 5000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 26172Accepted Submission(s): 11289Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数N、M(N12 #inclu
阅读全文
摘要:I Hate ItTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 32083Accepted Submission(s): 12698Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每
阅读全文
摘要:More is betterTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 327680/102400 K (Java/Others)Total Submission(s): 11952Accepted Submission(s): 4417Problem DescriptionMr Wang wants some boys to help him with a project. Because the project is rather complex,the more boys come, the better it will be.
阅读全文
摘要:PeriodTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2402Accepted Submission(s): 1191Problem DescriptionFor each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether
阅读全文
摘要:Kill the monsterTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 778Accepted Submission(s): 556Problem DescriptionThere is a mountain near yifenfei’s hometown. On the mountain lived a big monster. As a hero in hometown, yifenfei wants to kill it.Now
阅读全文