上一页 1 2 3 4 5 6 7 8 9 ··· 16 下一页
  2013年10月22日
摘要: Time Limit:1000MSMemory Limit:65536KTotal Submissions:22207Accepted:9846Special JudgeDescriptionThe 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all pa 阅读全文
posted @ 2013-10-22 20:36 straw_berry 阅读(502) 评论(0) 推荐(0) 编辑
  2013年10月20日
摘要: Time Limit:3000MSMemory Limit:65536KTotal Submissions:8351Accepted:3068DescriptionStan 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 there is no stick on top of th 阅读全文
posted @ 2013-10-20 20:06 straw_berry 阅读(247) 评论(0) 推荐(0) 编辑
摘要: AreaTime Limit:1000MSMemory Limit:10000KTotal Submissions:4373Accepted:1983DescriptionBeing well known for its highly innovative products, Merck would definitely be a good target for industrial espionage. To protect its brand-new research and development facility the company has installed the latest 阅读全文
posted @ 2013-10-20 14:57 straw_berry 阅读(178) 评论(0) 推荐(0) 编辑
  2013年10月19日
摘要: Time Limit:3000MSMemory Limit:65536KTotal Submissions:29059Accepted:12565DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInput consists of up to 10 阅读全文
posted @ 2013-10-19 18:38 straw_berry 阅读(286) 评论(0) 推荐(0) 编辑
摘要: Time Limit:1000MSMemory Limit:65536KTotal Submissions:6700Accepted:1922DescriptionRJ Freight, a Japanese railroad company for freight operations has recently constructed exchange lines at Hazawa, Yokohama. The layout of the lines is shown in Figure 1.Figure 1: Layout of the exchange linesA freight t 阅读全文
posted @ 2013-10-19 18:30 straw_berry 阅读(226) 评论(0) 推荐(0) 编辑
  2013年10月15日
摘要: http://poj.org/problem?id=3096题意容易理解,开始直接暴力,还是用map写下吧,熟练一下; 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 int main() 8 { 9 char s[100];10 char t[5];11 int n,i;12 map mymap;13 14 while(~scanf("%s",s))15 {16 if(s[0] == '*')17 break... 阅读全文
posted @ 2013-10-15 20:28 straw_berry 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Time Limit:1000MSMemory Limit:131072KTotal Submissions:8476Accepted:2554DescriptionElina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as following:Choosekdifferent positive integersa1,a2,…,ak. For some non-negativem, di 阅读全文
posted @ 2013-10-15 18:57 straw_berry 阅读(211) 评论(0) 推荐(0) 编辑
  2013年10月14日
摘要: http://poj.org/problem?id=1006中国剩余定理模板题 1 #include 2 #include 3 int p,e,i,d; 4 int a[5],m[5]; 5 int item = 1; 6 int extend_gcd(int a,int b,int &x,int &y) 7 { 8 if(b == 0) 9 {10 x = 1;11 y = 0;12 return a;13 }14 else15 {16 int r = extend_gcd(b,a%b,x... 阅读全文
posted @ 2013-10-14 19:55 straw_berry 阅读(145) 评论(0) 推荐(0) 编辑
  2013年10月12日
摘要: http://poj.org/problem?id=2115题意:对于C的循环(for i = A; i != B; i+=C)问在k位存储系统内循环多少次结束; 若循环有限次能结束输出次数,否则输出FOREVER;解:设x为循环次数; (A+C*x)%2^k = B; 则 C*x+A = 2^k*y+B; 所以 C*x - 2^k*y = B-A; 类似于a*x+b*y = c (或 a*x = c(mod b))模线性方程的形式,所以可以根据扩展欧几里得算法解决 1 #include 2 #include 3 4 long long exGcd(long long a,... 阅读全文
posted @ 2013-10-12 21:56 straw_berry 阅读(204) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1845题意:求A^B的所有约数的和再对9901取模;做了这个学到了N多数学知识;一:任意一个整数都可以唯一分解成素因子的乘积;A = p1^k1*p2^k2*......*pn^kn; A先对2不断取模,当A%2==0时,2的次数加1,直到A%2!=0,A再尝试着对3不断取模.....依次进行下去,直到A = 1; 当A本身就是素数时,A^1就是素数本身的分解式(特殊情况,别忘了加判断); 这样A^B = p1^(k1*B) * p2(k2*B) * .......*pn^(kn*B);二:一个数用素因子乘积表示后其约数和公式; A... 阅读全文
posted @ 2013-10-12 20:14 straw_berry 阅读(760) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 16 下一页