上一页 1 2 3 4 5 6 7 8 9 ··· 50 下一页
摘要: 二维树状数组。。。。 MatrixTime Limit:3000MSMemory Limit:65536KTotal Submissions:15575Accepted:5854DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, j] = 0 (1 2 #include 3 #include 4 5 using names... 阅读全文
posted @ 2013-10-11 17:50 码代码的猿猿 阅读(185) 评论(0) 推荐(0) 编辑
摘要: B. Two HeapsValera has2·ncubes, each cube contains an integer from10to99. He arbitrarily choosesncubes and puts them in the first heap. The remaining cubes form the second heap.Valera decided to play with cubes. During the game he takes a cube from the first heap and writes down the number it h 阅读全文
posted @ 2013-10-11 11:42 码代码的猿猿 阅读(525) 评论(0) 推荐(0) 编辑
摘要: 贪心。。。。 Color a TreeTime Limit:1000MSMemory Limit:30000KTotal Submissions:6647Accepted:2249DescriptionBob is very interested in the data structure of a tree. A tree is a directed graph in which a special node is singled out, called the "root" of the tree, and there is a unique path from the 阅读全文
posted @ 2013-10-10 18:06 码代码的猿猿 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 树形DP /泛化物品的背包。。。可以去看09年徐持衡论文《浅谈几类背包问题》The most powerful forceTime Limit: 16000/8000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 727Accepted Submission(s): 182Problem DescriptionThe leaders of AC country made a decision to regain the TW Island. But they have to face 阅读全文
posted @ 2013-10-10 00:57 码代码的猿猿 阅读(423) 评论(0) 推荐(0) 编辑
摘要: Print ArticleTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 3827Accepted Submission(s): 1195Problem DescriptionZero has an old printer that doesn't work well sometimes. As it is antique, he still like to use it to print articles. But it is to 阅读全文
posted @ 2013-10-09 11:38 码代码的猿猿 阅读(176) 评论(0) 推荐(0) 编辑
摘要: RMQ+二分。。。。枚举 i,找比 i 小的第一个元素,再找之间的第一个最大元素。。。。。 Sticks ProblemTime Limit:6000MSMemory Limit:65536KTotal Submissions:9338Accepted:2443DescriptionXuanxuan has n sticks of different length. One day, she puts all her sticks in a line, represented by S1, S2, S3, ...Sn. After measuring the length of... 阅读全文
posted @ 2013-10-08 22:08 码代码的猿猿 阅读(280) 评论(0) 推荐(0) 编辑
摘要: Expanding RodsTime Limit:1000MSMemory Limit:30000KTotal Submissions:10187Accepted:2593DescriptionWhen 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 he... 阅读全文
posted @ 2013-10-06 22:35 码代码的猿猿 阅读(262) 评论(0) 推荐(0) 编辑
摘要: 一些关于GCD的代码。。。。 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 typedef long long int LL; 8 9 LL EX_GCD(LL a,LL b,LL& x,LL& y)10 {11 if(b==0)12 {13 x=1;y=0;14 return a;15 }16 else17 {18 LL ret=EX_GCD(b,a%b,x,y);19 int t=x;20 ... 阅读全文
posted @ 2013-10-06 11:12 码代码的猿猿 阅读(507) 评论(0) 推荐(0) 编辑
摘要: 扩展GCD。。。一定要(1L 2 #include 3 #include 4 5 using namespace std; 6 7 typedef long long int LL; 8 9 inline LL P(LL k){return (1LL<<k);}10 11 LL GCD(LL a,LL b)12 {13 return b==0?a:GCD(b,a%b);14 }15 16 LL EX_GCD(LL a,LL b,LL& x,LL& y)17 {18 if(b==0)19 {20 x=1;y=0;21 return... 阅读全文
posted @ 2013-10-04 16:08 码代码的猿猿 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 青蛙的约会Time Limit:1000MSMemory Limit:10000KTotal Submissions:82859Accepted:14426Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只乐观的青蛙... 阅读全文
posted @ 2013-10-04 14:11 码代码的猿猿 阅读(226) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 50 下一页