- 博客(101)
- 资源 (2)
- 收藏
- 关注
原创 Human Gene Functions
http://acm.hdu.edu.cn/showproblem.php?pid=1080Problem DescriptionIt is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by f
2012-05-05 14:50:11 410
原创 Tian Ji -- The Horse Racing
http://acm.hdu.edu.cn/showproblem.php?pid=1052Problem DescriptionHere is a famous story in Chinese history."That was about 2300 years ago. General Tian Ji was a high official in the country
2012-05-05 10:16:10 441
原创 Fire Net
点击打开链接Problem DescriptionSuppose 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.
2012-05-03 14:24:52 439
原创 我的第一个半平面交(1007: [HNOI2008]水平可见直线)
点击打开链接DescriptionInput第一行为N(0 Output从小到大输出可见直线的编号,两两中间用空格隔开.Sample Input3-1 01 00 0Sample Output1 2YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY首先处理直线将斜率相同的按B值得大小排序
2012-05-01 19:31:19 731
原创 筛选素数个数(10^8以内)
int sushu(int m){ char *is=new char[m+1]; memset(is,0,sizeof(char)*(m+1)); int i,j,k=1; for(i=3;i<=m;i+=2) { for(j=3;j<=i,j*i<=m;j+=2) { is[i*j]=1; } if(is[i]==0) k++; } delete is
2012-04-23 19:48:35 1226
原创 Count Color
http://poj.org/problem?id=2777DescriptionChosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem.There
2012-04-19 21:50:32 518
原创 Color the ball
点击打开链接Problem DescriptionN个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a Input每个测试实例第一行为一个整数N,(N 当N = 0,输入结束。 Output每个测试实例输出一行,包括N个整数,第I个数代表第I个气球总共被涂色的次数。 Sample Input
2012-04-19 11:42:10 479
原创 Courses
点击打开链接Problem DescriptionConsider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it is possible to form a committee
2012-04-18 18:33:28 459
原创 Pyramids
点击打开链接Recently in Farland, a country in Asia, a famous scientist Mr. Log Archeo has discovered ancient pyramids. But unlike those in Egypt and Central America, they have triangular (not rectangula
2012-04-12 15:21:34 550
原创 Pick-up Sticks
点击打开链接Stan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top sticks, that is these sticks such that th
2012-04-09 20:31:03 463
原创 TOYS
点击打开链接DescriptionCalculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away when he is finished
2012-04-09 19:01:56 537
原创 Transmitters
点击打开链接In a wireless network with multiple transmitters sending on the same frequencies, it is often a requirement that signals don't overlap, or at least that they don't conflict. One way of accompl
2012-04-08 20:20:43 526
原创 Beauty Contest
http://poj.org/problem?id=2187DescriptionBessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bessie will make
2012-04-05 15:26:22 481
原创 Surround the Trees
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=453There are a lot of trees in an area. A peasant wants to buy a rope to surround all these trees. So at first he must know the minimal r
2012-04-05 14:01:47 504
原创 Triangle
点击打开链接DescriptionA lattice point is an ordered pair (x, y) where x and y are both integers. Given the coordinates of the vertices of a triangle (which happen to be lattice points), you are to co
2012-04-04 21:21:56 513
原创 The centre of polygon (多边形重心)
描述Given a polygon, your task is to find the centre of gravity for the given polygon.输入The input consists of T test cases. The number of them (T) is given on the first line of the input f
2012-04-04 18:50:47 1434
原创 Points Within
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=81Statement of the Problem Several drawing applications allow us to draw polygons and almost all of them allow us to fill them with some
2012-04-02 17:40:02 472
原创 全排列
任意输入n个不重复的整数序列,输出序列的全排列next_permutation(a,a+n),如果有下个排列,就返回1,否则返回0;#include#includeusing namespace std;int a[1200];int main(){ int t,n,k; scanf("%d",&t); while(t--) { scanf("%d",&n);
2012-03-28 19:18:14 739
原创 Leftmost Digit
点击打开链接Problem DescriptionGiven a positive integer N, you should output the leftmost digit of N^N. InputThe input contains several test cases. The first line of the input is a single in
2012-03-27 21:17:01 537
原创 Area
点击打开链接Jerry, a middle school student, addicts himself to mathematical research. Maybe the problems he has thought are really too easy to an expert. But as an amateur, especially as a 15-year-old
2012-03-26 16:35:49 765
原创 求多条线段相交(暴力了点)
#include#includestruct point { double x,y;};struct line{ point a,b;}g[120];double MAX(double a,double b){ return a>b?a:b;}double MIN(double a,double b){ return a<b?a:b;}double cross_
2012-03-26 12:24:58 709
原创 判断线段相交
#include#includedouble MAX(double a,double b){ return a>b?a:b;}double MIN(double a,double b){ return a<b?a:b;}struct point { double x,y;};double dirction(point a,point b,point c){ ret
2012-03-26 12:02:30 422
原创 判断多边形凹凸
任意给定一个多边形,判断它是凸还是凹。多边形的顶点以逆时针方向的序列来表示。%%%%%%%%%%%%%%%%#include#includestruct point{ double x,y;}g[15000];int ploy(point a,point b,point c){ int d=(c.x-a.x)*(b.y-a.y)-(b.x-a.x)*(c.y-a.y);
2012-03-25 20:35:44 1757
原创 Point of Intersection
点击打开链接Given two circles on the same plane which are centered at (x1,y1) and (x2,y2) ,with radiuses r1 and r2, respectively.We can see that they have two common tangent lines in most of the cases
2012-03-19 19:16:55 484
原创 坐标变换
根据线性代数32页:编写的,任意1点坐标绕某一点坐标逆时针旋转degree度,可用公式:{x=x1*cos(degree)-y1*sin(degree);}y=x1*sin(degree)+y1*sin(degree);很方便;#include#include#define pi 2*acos(0)int main(){ int i,j,k,m,n; double x,
2012-03-15 15:32:49 463
原创 Quoit Design
http://acm.hdu.edu.cn/showproblem.php?pid=1007Problem 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 enc
2012-03-10 21:16:28 1860 3
原创 Circuit Board
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=164On the circuit board, there are lots of circuit paths. We know the basic constrain is that no two path cross each other, for otherwise
2012-03-08 15:59:28 525
原创 You can Solve a Geometry Problem too
http://acm.hdu.edu.cn/showproblem.php?pid=1086Problem DescriptionMany geometry(几何)problems were designed in the ACM/ICPC. And now, I also prepare a geometry problem for this final exam. Accord
2012-03-08 15:40:19 445
转载 Marriage is Stable
http://acm.hdu.edu.cn/showproblem.php?pid=1522Problem DescriptionAlbert, Brad, Chuck are happy bachelors who are in love with Laura, Marcy, Nancy. They all have three choices. But in fact, they
2012-03-02 21:36:09 478
原创 R(N)
http://acm.hdu.edu.cn/showproblem.php?pid=3835Problem DescriptionWe know that some positive integer x can be expressed as x=A^2+B^2(A,B are integers). Take x=10 for example,10=(-3)^2+1^2.W
2012-02-24 18:51:36 1088
原创 Atlantis
点击打开链接DescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunatel
2012-02-17 09:32:04 322
原创 Just a Hook
http://acm.hdu.edu.cn/showproblem.php?pid=1698Problem DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several
2012-02-13 19:30:55 383
原创 I Hate It
http://acm.hdu.edu.cn/showproblem.php?pid=1754Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 In
2012-02-13 10:24:54 329
原创 敌兵布阵
http://acm.hdu.edu.cn/showproblem.php?pid=1166Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握
2012-02-13 09:44:11 416
原创 The Unique MST
http://poj.org/problem?id=1679DescriptionGiven a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a connected, undirected gra
2012-02-12 21:29:01 346
原创 The Perfect Stall
点击打开链接DescriptionFarmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, due to engineering problems, all the stalls in the new bar
2012-02-12 12:44:08 336
原创 Kindergarten
http://poj.org/problem?id=3692DescriptionIn a kindergarten, there are a lot of kids. All girls of the kids know each other and all boys also know each other. In addition to that, some girls and bo
2012-02-12 11:04:34 369
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人