算法编程题
文章平均质量分 70
pigofzhou
知行合一,行胜于言!Hello New World!
展开
-
hdu 1026
Ignatius and the Princess I Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...原创 2017-03-21 20:10:22 · 267 阅读 · 0 评论 -
hdu 2102
A计划 Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...原创 2017-03-20 22:46:04 · 455 阅读 · 0 评论 -
竹之书(2017浙江工业大学-校赛决赛)
竹之书Problem Description由于某些原因菲莉丝拿到了贤者之石,所以好像变得很厉害了好像变得很厉害的菲莉丝想要炼成幻想乡,其中有一个原料是稗田一族对幻想乡历史的记录。现在菲莉丝拿到了一个被某只魔粘性精神体加密过的的卷轴。密文通过原文和一个正整数key加密形成,而key和密文又有一定关联。现给出密文,求key值已知密文s和key值关系如下已知密文s是一串正整数s1,s2,s3……sn,...原创 2017-03-19 11:04:22 · 1358 阅读 · 0 评论 -
POJ 3414
PotsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 16103 Accepted: 6796 Special JudgeDescriptionYou are given two pots, having the volume of A and B liters respectively. The following opera...原创 2017-03-15 21:51:24 · 292 阅读 · 0 评论 -
Fire Game
Problem 2150 Fire GameAccept: 2003 Submit: 7010Time Limit: 1000 mSec Memory Limit : 32768 KB Problem DescriptionFat brother and Maze are playing a ki...原创 2017-03-15 11:48:29 · 380 阅读 · 0 评论 -
UVA 11624
Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fire escape plan. Help Joe escape the maze. Given Joe...原创 2017-03-15 10:31:11 · 296 阅读 · 0 评论 -
专题一 简单搜索题集
棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 42226 Accepted: 20563Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输...原创 2017-03-14 21:48:02 · 436 阅读 · 0 评论 -
Codeforces 592
A. PawnChesstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputGalois is one of the strongest chess players of Byteforces. He has even invented a new ...原创 2017-03-08 21:24:04 · 250 阅读 · 0 评论 -
Codeforces 591
A. Wizards' Dueltime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputHarry Potter and He-Who-Must-Not-Be-Named engaged in a fight to the death once aga...原创 2017-03-08 19:34:23 · 250 阅读 · 0 评论 -
Codeforces 776
A. A Serial Killertime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOur beloved detective, Sherlock is currently trying to catch a serial killer who...原创 2017-03-08 14:44:22 · 567 阅读 · 0 评论 -
Codeforces 779
A. Pupils Redistributiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn Berland each high school student is characterized by academic performanc...原创 2017-03-08 11:24:30 · 931 阅读 · 0 评论 -
Codeforces 777A
A. Shell Gametime limit per test0.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBomboslav likes to look out of the window in his room and watch lads outside playin...原创 2017-03-08 10:39:54 · 523 阅读 · 0 评论 -
Codeforces 782A
A. Andryusha and Sockstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndryusha is an orderly boy and likes to keep things in their place.Today he...原创 2017-03-08 10:46:04 · 425 阅读 · 0 评论 -
hdu 1018
Big NumberProblem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem ...原创 2016-11-27 22:34:21 · 196 阅读 · 0 评论 -
hdu 1098
Ignatius's puzzleProblem DescriptionIgnatius is poor at math,he falls across a puzzle problem,so he has no choice but to appeal to Eddy. this problem describes that:f(x)=5*x^13+13*x^5+k*a*x,input a no...原创 2016-11-28 21:21:22 · 312 阅读 · 0 评论 -
hdu 2053
Switch GameProblem DescriptionThere are many lamps in a line. All of them are off at first. A series of operations are carried out on these lamps. On the i-th operation, the lamps whose numbers are th...原创 2016-12-01 19:52:41 · 273 阅读 · 0 评论 -
hdu 2054
A == B ?Problem DescriptionGive you two numbers A and B, if A is equal to B, you should print "YES", or print "NO". Inputeach test case contains two numbers A and B. Outputfor each case, if A is equal...原创 2017-01-09 21:08:31 · 227 阅读 · 0 评论 -
Codeforces 777B
B. Game of Credit Cardstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter the fourth season Sherlock and Moriary have realized the whole foolis...原创 2017-03-08 10:31:38 · 275 阅读 · 0 评论 -
华东交通大学2016年ACM“双基”程序设计竞赛
1001简单题Problem Description输入一个非负的int型整数,是奇数的话输出"ECJTU",是偶数则输出"ACM"。Input多组数据,每组数据输入一个x。输入到文件结尾结束(scanf函数返回值不为EOF时),例如:#include<cstdio>using namespace std;int main(){int x;while (scanf("%d", &...原创 2016-11-22 19:11:34 · 2283 阅读 · 0 评论 -
hdu 2096
小明A+BProblem Description小明今年3岁了, 现在他已经能够认识100以内的非负整数, 并且能够进行100以内的非负整数的加法计算.对于大于等于100的整数, 小明仅保留该数的最后两位进行计算, 如果计算结果大于等于100, 那么小明也仅保留计算结果的最后两位.例如, 对于小明来说:1) 1234和34是相等的2) 35+80=15给定非负整数A和B, 你的任务是代表小明计算出...原创 2016-11-23 14:55:43 · 275 阅读 · 0 评论 -
hdu 2097
Sky数Problem DescriptionSky从小喜欢奇特的东西,而且天生对数字特别敏感,一次偶然的机会,他发现了一个有趣的四位数2992,这个数,它的十进制数表示,其四位数字之和为2+9+9+2=22,它的十六进制数BB0,其四位数字之和也为22,同时它的十二进制数表示1894,其四位数字之和也为22,啊哈,真是巧啊。Sky非常喜欢这种四位数,由于他的发现,所以这里我们命名其为Sky数。但...原创 2016-11-23 15:01:36 · 302 阅读 · 0 评论 -
hdu 2098
分拆素数和Problem Description把一个偶数拆成两个不同素数的和,有几种拆法呢? Input输入包含一些正的偶数,其值不会超过10000,个数不会超过500,若遇0,则结束。 Output对应每个偶数,输出其拆成不同素数的个数,每个结果占一行。 Sample Input30260 Sample Output32 Source2007省赛集训队练习赛(2) /*分析:把一个偶数n拆成...原创 2016-11-23 15:08:02 · 543 阅读 · 0 评论 -
hdu 2099
整除的尾数Problem Description一个整数,只知道前几位,不知道末二位,被另一个整数除尽了,那么该数的末二位该是什么呢? Input输入数据有若干组,每组数据包含二个整数a,b(0<a<10000, 10<b<100),若遇到0 0则处理结束。 Output对应每组数据,将满足条件的所有尾数在一行内输出,格式见样本输出。同组数据的输出,其每个尾数之间空一格,行...原创 2016-11-23 15:15:23 · 201 阅读 · 0 评论 -
hdu 2095
find your present (2)Problem DescriptionIn the new year party, everybody will get a "special present".Now it's your turn to get your special present, a lot of presents now putting on the desk, and onl...原创 2016-11-23 16:19:28 · 193 阅读 · 0 评论 -
hdu 2094
产生冠军Problem Description有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最多打一场比赛。球赛的规则如下:如果A打败了B,B又打败了C,而A与C之间没有进行过比赛,那么就认定,A一定能打败C。如果A打败了B,B又打败了C,而且,C又打败了A,那么A、B、C三者都不可能成为冠军。根据这个规则,无需循环较量,或许就能确定冠军。你的任务就是面对一群比赛选手,在经过了若干场撕杀之后,...原创 2016-11-23 16:21:00 · 275 阅读 · 0 评论 -
hdu 2092
整数解Problem Description有二个整数,它们加起来等于某个整数,乘起来又等于另一个整数,它们到底是真还是假,也就是这种整数到底存不存在,实在有点吃不准,你能快速回答吗?看来只能通过编程。例如:x + y = 9,x * y = 15 ? 找不到这样的整数x和y1+4=5,1*4=4,所以,加起来等于5,乘起来等于4的二个整数为1和47+(-8)=-1,7*(-8)=-56,所以,加...原创 2016-11-23 16:27:27 · 511 阅读 · 0 评论 -
hdu 2093
考试排名Problem DescriptionC++编程考试使用的实时提交系统,具有即时获得成绩排名的特点。它的功能是怎么实现的呢?我们做好了题目的解答,提交之后,要么“AC”,要么错误,不管怎样错法,总是给你记上一笔,表明你曾经有过一次错误提交,因而当你一旦提交该题“AC”后,就要与你算一算帐了,总共该题错误提交了几回。虽然你在题数上,大步地跃上了一个台阶,但是在耗时上要摊上你共花去的时间。特别...原创 2016-11-23 17:08:09 · 301 阅读 · 0 评论 -
hdu 2087
剪花布条Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。如果遇见#字符...原创 2016-11-25 16:02:14 · 260 阅读 · 0 评论 -
hdu 2085
核反应堆Problem Description某核反应堆有两类事件发生:高能质点碰击核子时,质点被吸收,放出3个高能质点和1个低能质点;低能质点碰击核子时,质点被吸收,放出2个高能质点和1个低能质点。假定开始的时候(0微秒)只有一个高能质点射入核反应堆,每一微秒引起一个事件发生(对于一个事件,当前存在的所有质点都会撞击核子),试确定n微秒时高能质点和低能质点的数目。 Input输入含有一些整数n(...原创 2016-11-25 16:23:23 · 409 阅读 · 0 评论 -
hdu 2083
简易版之最短距离Problem Description寒假的时候,ACBOY要去拜访很多朋友,恰巧他所有朋友的家都处在坐标平面的X轴上。ACBOY可以任意选择一个朋友的家开始访问,但是每次访问后他都必须回到出发点,然后才能去访问下一个朋友。比如有4个朋友,对应的X轴坐标分别为1, 2, 3, 4。当ACBOY选择坐标为2的点做为出发点时,则他最终需要的时间为 |1-2|+|2-2|+|3-2|+|...原创 2016-11-25 16:33:38 · 433 阅读 · 0 评论 -
hdu 1097
A hard puzzleProblem Descriptionlcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how to know the a^b.everybody objects to this BT problem,so lcy makes the problem easier th...原创 2016-11-25 16:44:55 · 180 阅读 · 0 评论 -
hdu 1088
Write a simple HTML BrowserProblem DescriptionIf you ever tried to read a html document on a Macintosh, you know how hard it is if no Netscape is installed.Now, who can forget to install a HTML browse...原创 2016-11-25 17:00:17 · 329 阅读 · 0 评论 -
hdu 1040
As Easy As A+BProblem DescriptionThese days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking n...原创 2016-11-27 10:20:11 · 269 阅读 · 0 评论 -
hdu 1007
Quoit DesignProblem DescriptionHave you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some toys, with all the toys encircled awarded.In the field of Cyberground...原创 2016-11-27 10:42:24 · 147 阅读 · 0 评论 -
hdu 1009
FatMouse' TradeProblem DescriptionFatMouse 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...原创 2016-11-27 11:15:37 · 237 阅读 · 0 评论 -
hdu 1108
最小公倍数Problem Description给定两个正整数,计算这两个数的最小公倍数。 Input输入包含多组测试数据,每组只有一行,包括两个不大于1000的正整数. Output对于每个测试用例,给出这两个数的最小公倍数,每个实例输出一行。 Sample Input10 14 Sample Output70 #include <cstdio>#include <cstri...原创 2016-11-27 11:30:33 · 230 阅读 · 0 评论 -
Codeforces 782B
B. The Meeting Place Cannot Be Changedtime limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe main road in Bytecity is a straight line from south to n...原创 2017-03-08 11:02:28 · 450 阅读 · 1 评论 -
计算几何总结
几何总结:int sgn(double x){ if(fabs(x)<eps) return 0; if(x<0) return -1; else return 1;}struct Point{ double x,y; Point(){} Point(double _x,double _y){x=_x,y=_y;} Po...原创 2018-03-08 15:35:23 · 201 阅读 · 0 评论 -
最强外挂输入输出模板
/* 2017年多校第一场最后一题需要外挂输入输出进化版来处理数据,否则将会不停的TLE,从没想到是在外挂输入输出模板上面卡住了 从那场后长姿势了,马上更换成了这个模板,该代码是从标程中提取出来的,比一般的都强大,从此以后再没有在这上面被卡过。 需要freopen文件输入输出来测试样例答案,否则用命令行输入不会返回结果,交题时记得注释掉freopen喔~*/#inclu...原创 2018-03-08 15:58:56 · 733 阅读 · 0 评论 -
求重心到表面的最短距离
/* 给一个三维凸包,求重心到表面的最短距离 模板题:三维凸包+多边形重心+点面距离*/#include <cstdio>#include <cstring>#include <cmath>#include <iostream>#include <algorithm>#include <string>#...原创 2018-03-08 16:05:58 · 252 阅读 · 0 评论