摘要:
How Many TablesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6073Accepted Submission(s): 2894Problem DescriptionToday is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he need 阅读全文
摘要:
Sorting It All OutTime Limit:1000MSMemory Limit:10000KTotal Submissions:21042Accepted:7226DescriptionAn ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequence A, B, C, D i 阅读全文
摘要:
Language:MPI MaelstromTime Limit:1000MSMemory Limit:10000KTotal Submissions:3274Accepted:1924Description BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee's rese 阅读全文
摘要:
Stockbroker GrapevineTime Limit:1000MSMemory Limit:10000KTotal Submissions:20558Accepted:11141DescriptionStockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to give your employer the tactical edge in the st 阅读全文
摘要:
#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;
int w[3500],v[3500],f[13000];
int max(int i,int j){return i>j?i:j;}
int main()
{
// freopen("in.txt... 阅读全文
摘要:
ReversiTime Limit: 5000/2000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 805Accepted Submission(s): 332Problem DescriptionReversi, also called Othello, is a two-sided game.Each of the two sides corresponds to one player; they are referred to here as light and dark a 阅读全文
摘要:
Language:ZipperTime Limit:1000MSMemory Limit:65536KTotal Submissions:12609Accepted:4399Description Given three strings, you are to determine whether the third string can be formed by combining the characters in the first two strings. The first two strings can be mixed arbitrarily, but each must stay 阅读全文
摘要:
OverflowWrite a program that reads an expression consisting of two non-negative integer and an operator. Determine if either integer or the result of the expression is too large to be represented as a ``normal'' signed integer (typeinteger if you are working Pascal, type int if you are worki 阅读全文
摘要:
这里主要是归纳了一些他人博客上的对于JAVA大数处理的一些方法.主要是BigInteger类的应用转载虽然要注明出处...但是我已经找不到地址了...见谅Ⅰ基本函数:1.valueOf(parament); 将参数转换为制定的类型比如 int a=3; BigInteger b=BigInteger.valueOf(a);则b=3;String s=”12345”; BigInteger c=BigInteger.valueOf(s); 则c=12345;2.add(); 大整数相加 BigInteger a=new BigInteger(“23”); BigInteger b=new Big 阅读全文
摘要:
1124: Robots on a gridTime Limit:1 SecMemory Limit:128 MBSubmit:326Solved:56[Submit][Status][Web Board]DescriptionYou have recently made a grid traversing robot that can finnd its way from the top left corner of a grid to the bottom right corner. However, you had forgotten all your AI programming sk 阅读全文
摘要:
LIS(Longest Increasing Subsequence)最长上升(不下降)子序列有两种算法复杂度为O(n*logn)和O(n^2)O(n^2)算法分析如下: (a[1]...a[n] 存的都是输入的数)1、对于a[n]来说,由于它是最后一个数,所以当从a[n]开始查找时,只存在长度为1的不下降子序列;2、若从a[n-1]开始查找,则存在下面的两种可能性:(1)若a[n-1] a[n] 则存在长度为1的不下降子序列 a[n-1]或者a[n]。3、一般若从a[t]开始,此时最长不下降子序列应该是按下列方法求出的:在a[t+1],a[t+2],...a[n]中,找出一个比a[t]大的. 阅读全文
摘要:
Language:AlignmentTime Limit:1000MSMemory Limit:30000KTotal Submissions:8028Accepted:2535DescriptionIn the army, a platoon is composed by n soldiers. During the morning inspection, the soldiers are aligned in a straight line in front of the captain. The captain is not satisfied with the way his sold 阅读全文
摘要:
Language:反正切函数的应用Time Limit:1000MSMemory Limit:10000KTotal Submissions:12424Accepted:4490Description 反正切函数可展开成无穷级数,有如下公式(其中0 #includeint main(){ __int64 a,i; scanf("%I64d",&a); for(i = a+1 ; i >= 1 ; i--) { if((a*a+1)%i == 0) { printf("%I64d\n",a+a+i+(a*a+1)/i); break; } } 阅读全文
摘要:
Goldbach's ConjectureTime Limit:1000MSMemory Limit:65536KTotal Submissions:28052Accepted:10800Description In 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the following conjecture:Every even number greater than 4 can bewritten as the s 阅读全文
摘要:
取石子游戏Time Limit:1000MSMemory Limit:10000KTotal Submissions:26466Accepted:8426Description有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者。Input输入包含若干行,表示若干种石子的初始情况,其中每一行包含两个非负整数a和b,表示两堆石子的数目,a和b都不大于1,00 阅读全文
摘要:
/*
Snowflake Snow Snowflakes
Time Limit: 4000MS Memory Limit: 65536K
Description 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 collection of snowflakes, and search for a pair.. 阅读全文
摘要:
/*Monthly ExpenseTime Limit: 2000MS Memory Limit: 65536KDescriptionFarmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ moneyi ≤ 10,000) that he will need to spend each day ov. 阅读全文
摘要:
/*DescriptionWhen a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion. When a thin rod is mounted on two solid walls and then heated, it expands and takes the shape of a circular segment, the original rod being the cho 阅读全文
摘要:
/*
Description
Consider equations having the following form: a1x13+ a2x23+ a3x33+ a4x43+ a5x53=0 The coefficients are given integers from the interval [-50,50]. It is consider a solution a system (x1, x2, x3, x4, x5) that verifies the equation, xi∈[-50,50], xi != 0, any i∈{1,2,3,4,5}. Determine... 阅读全文
摘要:
/*
2002 - Squares
Time Limit:3500MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
Status
Description
A square is a 4-sided polygon whose sides have equal length and adjacent sides form 90-degree angles. It is also a polygon such that rotating about its centre by 90 degrees gives the sam... 阅读全文
摘要:
/*PieTime Limit: 1000MS Memory Limit: 65536K Total Submissions: 6186 Accepted: 2327 Special Judge DescriptionMy birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party 阅读全文
摘要:
/*我自己的代码一直WA,但是不知道为什么,所以只好贴别人的了,下一节,HASH+二分搜索~!!!Catch That CowTime Limit: 2000MS Memory Limit: 65536K Total Submissions: 27986 Accepted: 8622 DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on .. 阅读全文
摘要:
/* A Knight's JourneyTime Limit: 1000MS Memory Limit: 65536K DescriptionBackground The knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey around the world. Whenever a knight moves, it is ... 阅读全文
摘要:
/*棋盘问题Time Limit: 1000MS Memory Limit: 10000K Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n #includeint n,k,t,way,q = 0;char map[10][10];int listx[100],listy[. 阅读全文
摘要:
/*
Children of the Candy Corn
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5995 Accepted: 2622
Description The cornfield maze is a popular Halloween treat. Visitors are shown the entrance and must wander through the maze facing zombies, chainsaw-wielding psychopaths, hippies, and o... 阅读全文