书山有径勤为路>>>>>>>>

<<<<<<<<学海无涯苦作舟!

10 2011 档案

DP(一)——邮票个数的统计
摘要:本题是一道相当典型的动态规划题目,值得一看。题目:http://acm.swust.edu.cn/oj/problem/0251/我们用dp[i]线性数组来表示邮票的个数,dp[i]中的i就表示达到的面值了。也就是说当达到面值i的时候要用到dp[i]张邮票。当然,i要从1开始,这样就有了dp[1],这个过程是为了dp[2]做的铺垫,可以说这就是动态规划的精髓了。View Code #include "iostream"using namespace std;#define INF 0x7ffffff #define size 2000001int dp[size];int 阅读全文

posted @ 2011-10-29 21:44 More study needed. 阅读(303) 评论(0) 推荐(0) 编辑

用并查集合并不同的集合
摘要:Description若某个家族人员过于庞大,要判断两个是否是亲戚,确实还很不容易,现在给出某个亲戚关系图,求任意给出的两个人是否具有亲戚关系。 规定:x和y是亲戚,y和z是亲戚,那么x和z也是亲戚。如果x,y是亲戚,那么x的亲戚都是y的亲戚,y的亲戚也都是x的亲戚。Input第一行:三个整数n,m,p,(n<=5000,m<=5000,p<=5000),分别表示有n个人,m个亲戚关系,询问p对亲戚关系。 以下m行:每行两个数Mi,Mj,1<=Mi,Mj<=N,表示Ai和Bi具有亲戚关系。 接下来p行:每行两个数Pi,Pj,询问Pi和Pj是否具有亲戚关系。Outp 阅读全文

posted @ 2011-10-29 20:49 More study needed. 阅读(463) 评论(0) 推荐(0) 编辑

叉乘(六)——点在多边形内吗?
摘要:用途6:判断点P是否在多边形中是计算几何中一个非常基本但是十分重要的算法。以点P为端点,向左方作射线L,由于多边形是有界的,所以射线L的左端一定在多边形外,考虑沿着L从无穷远处开始自左向右移动,遇到和多边形的第一个交点的时候,进入到了多边形的内部,遇到第二个交点的时候,离开了多边形,……所以很容易看出当L和多边形的交点数目C是奇数的时候,P在多边形内,是偶数的话P在多边形外。 但是有些特殊情况要加以考虑。 如图下图(a)(b)(c)(d)所示。 在图(a)中,L和多边形的顶点相交,这时候交点只能计算一次; 在图(b)中,L和多边形顶点的交点不应被计算; 在图(c)和(d) 中,L... 阅读全文

posted @ 2011-10-28 10:33 More study needed. 阅读(607) 评论(0) 推荐(0) 编辑

叉乘(五)——点、线、多边形、圆在矩形中吗?
摘要:1.点: 只要判断该点的横坐标和纵坐标是否夹在矩形的左右边和上下边之间。2.线段、折线、多边形: 因为矩形是个凸集,所以只要判断所有端点是否都在矩形中就可以了。3.矩形: 只要比较左右边界和上下边界就可以了。4.圆: 很容易证明,圆在矩形中的充要条件是: 圆心在矩形中且圆的半径小于等于圆心到矩形四边的距离的最小值。 阅读全文

posted @ 2011-10-28 10:08 More study needed. 阅读(389) 评论(0) 推荐(0) 编辑

叉乘(四)——线段与直线相交吗?
摘要:用途4:明白了用途3以后,再来看用途4那是相当的简单呀。如果线段P1P2和直线Q1Q2相交,则线段P1P2跨立直线Q1Q2,即:( P1 - Q1 ) × ( Q2 - Q1 ) * ( Q2 - Q1 ) × ( P2 - Q1 ) >= 0。没错,就是这么的简单,不用怀疑什么。 阅读全文

posted @ 2011-10-28 09:57 More study needed. 阅读(410) 评论(0) 推荐(0) 编辑

叉乘(三)——线段与线段相交吗?
摘要:用途3:我们现在的任务就是判断线段P1P2和线段Q1Q2是否相交。我们分两步确定两条线段是否相交: (1)快速排斥试验 设以线段 P1P2 为对角线的矩形为R, 设以线段 Q1Q2 为对角线的矩形为T, 如果矩形R和矩形T不相交,显然两线段不会相交。 (2)跨立试验 如果两线段相交,则两线段必然相互跨立对方。 若P1P2跨立Q1Q2 ,则矢量 ( P1 - Q1 ) 和( P2 - Q1 )位于矢量( Q2 - Q1 ) 的两侧, 即1.(P1 - Q1) x (Q2 - Q1)<0, 这个式子表明Q1Q2在P1Q1的右方,也就是说P1Q1在Q1Q2的... 阅读全文

posted @ 2011-10-28 00:24 More study needed. 阅读(837) 评论(0) 推荐(0) 编辑

叉乘(二)——点在线段上吗?
摘要:用途2:其实这个还是用的叉乘的性质,“左边还是右边”,只不过这个在线上,也就是说是性质的第三条。设点为Q,线段为P1、P2 ,判断点Q在该线段上的依据是:1.( Q - P1 ) × ( P2 - P1 ) = 0;2.Q 在以 P1,P2为对角顶点的矩形内第一点是为了保证Q点在直线P1P2上,第二点是为了保证Q点不在线段P1P2的延长线或反向延长线上对于第二点这一步骤的判断可以用以下过程实现: ON-SEGMENT(pi,pj,pk) //pk就是要判断的点了,pi,pj就是线段的两个端点。 if min(xi,xj) <= xk <= max(xi,xj) and m 阅读全文

posted @ 2011-10-27 23:49 More study needed. 阅读(426) 评论(0) 推荐(0) 编辑

DFS解决任意组合问题
摘要:描述在IOI98的节日宴会上,我们有N(10<=N<=100)盏彩色灯,他们分别从1到N被标上号码。 这些灯都连接到四个按钮:按钮1:当按下此按钮,将改变所有的灯:本来亮着的灯就熄灭,本来是关着的灯被点亮。 按钮2:当按下此按钮,将改变所有奇数号的灯。按钮3:当按下此按钮,将改变所有偶数号的灯。按钮4:当按下此按钮,将改变所有序号是3*K+1(K>=0)的灯。例如:1,4,7...一个计数器C记录按钮被按下的次数。当宴会开始,所有的灯都亮着,此时计数器C为0。你将得到计数器C(0<=C<=10000)上的数值和经过若干操作后某些灯的状态。写一个程序去找出所有灯最后 阅读全文

posted @ 2011-10-24 23:02 More study needed. 阅读(389) 评论(0) 推荐(0) 编辑

快女
摘要:1.金银玲2.DL组合3.陆翊4.喻佳丽5.付梦妮6.王艺洁7.李斯丹妮8.杨洋9.苏妙龄 阅读全文

posted @ 2011-10-24 18:59 More study needed. 阅读(149) 评论(0) 推荐(0) 编辑

加上减去DFS解决USACO Healthy Holsteins
摘要:DescriptionFarmer John prides himself on having the healthiest dairy cows in the world. He knows the vitamin content for one scoop of each feed type and the minimum daily vitamin requirement for the cows. Help Farmer John feed his cows so they stay healthy while minimizing the number of scoops that 阅读全文

posted @ 2011-10-23 14:47 More study needed. 阅读(417) 评论(0) 推荐(0) 编辑

一道简单的并查集题目
摘要:Description现在很多的程序设计语言中,赋值已经是一个不容忽视的问题,如果一个变量在未进行赋值的情况下使用,那么这个值将是不定的(哈哈,我已经被遭了好多次了)!而我写的程序用到的变量实在是太多了,又不想自己统计哪些变量是已经赋值了的,现在就请你帮我统计一下哪些变量已经赋值了。为了简化问题,我们假设最开始仅有变量a中有确定的值。变量为单个小写字母,每行恰好有三个字符,中间一个是赋值运算符'='。请编程求出含N行的程序段运行以后有哪些变量中有确定的值。并且该赋值表达式的出现顺序也即是其在程序中的相对顺序。InputT(1<= T <= 27) 表示测试实例个数 阅读全文

posted @ 2011-10-22 22:25 More study needed. 阅读(472) 评论(0) 推荐(0) 编辑

叉乘+二分解决POJ 2398
摘要:DescriptionMom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. They gave Reza a rectangular box to put his toys in. Unfortunately, Reza is rebellious and obeys his parents by simply throwing his toys into the box. All the toys get mixed up, 阅读全文

posted @ 2011-10-21 19:41 More study needed. 阅读(291) 评论(0) 推荐(0) 编辑

再次相遇sort, 再次的感悟
摘要:以前本人曾经在CSDN上面发表过一篇关于sort的用法的文章。现在摘录如下:sort 函数是经常要用到的高级函数,用到好处,你会感觉你真的很棒!但是,第一个问题就是,你十分了解sort函数吗?其实不然。如果你就不彻底了解它,怎能用好呢?现在让我小露一手吧!我们可以自定义sort函数呢,当然,它要和结构体共同使用,那样更爽,它的这个功能主要用在多级排序上,方便死了。例如:struct student{ char name; int x, y, z;}stu[1000];bool check(strdent a, student b){ if(a.x > b.x)return true; i 阅读全文

posted @ 2011-10-21 10:36 More study needed. 阅读(436) 评论(0) 推荐(0) 编辑

叉乘+二分解决POJ 2318
摘要: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 playing with them. They gave John a rectangular box to put his toys in, but John is rebellious and obeys his parents by si 阅读全文

posted @ 2011-10-20 22:43 More study needed. 阅读(443) 评论(0) 推荐(0) 编辑

叉乘(一)——左边还是右边
摘要:用途1: 众所周知,叉乘是用来计算面积的,但是是什么样的面积呢?设两个矢量P(x1, y1), Q(x2, y2); 那么P x Q=x1*y2 - x2*y1的结果是一个标量,表示的就是以(0,0), p1, p2和p1+p2构成的平行四边形。其实个人觉得这个用途不是很大,更有用的是它的一个有趣的性质,也就是它的第二个用途了。用途2: 叉乘的一个非常重要的性质是:可以通过它的符号来判断两矢量相互之间的逆顺的关系。 (1). P x Q > 0; 表示P在Q的顺时针方向; (2). p x Q < 0; 表示P在Q的逆时针方向; (3). P x Q = 0; 表示P和Q是共线的, 阅读全文

posted @ 2011-10-20 20:37 More study needed. 阅读(1012) 评论(0) 推荐(0) 编辑

什么是叉乘,用它我们可以做什么?
摘要:什么是叉乘呢,它表示什么含义呢?答:叉乘有什么用呢?(用来求三角形的面积)答:我们以二维的情况为例来说明,其实三维的时候也是同样的道理。但是在使用上式求面积的时候要注意用fabs取绝对值。有了面积我们可以做什么?(求内接圆半径,求外接圆半径)答:除了求内接圆半径,我们可以求外接圆半径吗?答:可以:好了,这个就是叉乘了。但是,这个并不是叉乘的全部。我们还可以通过叉乘的结果的正负来判断一个点是在一点的左边还是右边。另外,我们还可以用它来进行更复杂的研究,也是凸包了。 阅读全文

posted @ 2011-10-20 13:36 More study needed. 阅读(2151) 评论(0) 推荐(0) 编辑

Stack解决——括号匹配
摘要:Description题意描述: 在算术表达式中,除了加、减、乘、除等运算外,往往还有括号。包括有大括号{},中括号[],小括号(),尖括号<>等。 对于每一对括号,必须先左边括号,然后右边括号;如果有多个括号,则每种类型的左括号和右括号的个数必须相等;对于多重括号的情形,按运算规则,从外到内的括号嵌套顺序为:大括号->中括号->小括号->尖括号。例如,{[()]},{()},{{}}为一个合法的表达式,而([{}]),{([])},[{<>}]都是非法的。Input文件的第一行为一个整数n(1≤n≤100),接下来有n行仅由上述四类括号组成的括号表达 阅读全文

posted @ 2011-10-18 21:42 More study needed. 阅读(802) 评论(0) 推荐(0) 编辑

感悟Floyd
摘要:今天做了一道Jump题目,本以为是一道搜索的题目,没想到竟然用Floyd就轻松的解决了。 先来看看这个题目吧! Description There is n pillar, their heights are (A1,A2,A3,…An).you can jump at the top of the pillars. But you will lose abs(a[j]-a[i])*abs(j-i) power when you jump from i-th pillar to j-th pillar. At first you have m power. Can you jump f... 阅读全文

posted @ 2011-10-18 11:22 More study needed. 阅读(887) 评论(0) 推荐(1) 编辑

Floyd算法解决 Jump
摘要:DescriptionThere is n pillar, their heights are (A1,A2,A3,…An).you can jump at the top of the pillars. But you will lose abs(a[j]-a[i])*abs(j-i) power when you jump from i-th pillar to j-th pillar. At first you have m power. Can you jump from s-th pillar to e-th pillar.InputThe input consists of sev 阅读全文

posted @ 2011-10-18 11:03 More study needed. 阅读(271) 评论(0) 推荐(0) 编辑

感悟DFS
摘要:昨天看到了一句话让我对DFS算法有极深的感悟。这句话就是:DFS有三个条件:1.最深深度 2.结束条件 3.如何扩展。其实对于1, 2,两点,感觉不是问题的关键,第三点才是问题的核心。如何说呢?还是来结合一个实例吧,不然,很难说清楚。例题:有三个容量分别是A,B,C升的桶,A,B,C分别是三个从1到20的整数,最初,A和B桶都是空的,而C桶是装满牛奶的。有时,约翰把牛奶从一个桶倒到另一个桶中,直到被灌桶装满或原桶空了。当然每一次灌注都是完全的。由于节约,牛奶不会有丢失。写一个程序去帮助约翰找出当A桶是空的时候,C桶中牛奶所剩量的所有可能性。解题思路:每次最多无非有6种倒法,即a->b;a 阅读全文

posted @ 2011-10-17 09:33 More study needed. 阅读(355) 评论(0) 推荐(0) 编辑

位运算处理N皇后
摘要:n皇后问题位运算版n皇后问题是啥我就不说了吧,学编程的肯定都见过。下面的十多行代码是n皇后问题的一个高效位运算程序,看到过的人都夸它牛。初始时,upperlim:=(1 shl n)-1。主程序调用test(0,0,0)后sum的值就是n皇后总的解数。procedure test(row,ld,rd:longint);varpos,p:longint;begin{ 1}if row<>upperlim then{ 2}begin{ 3} pos:=upperlim and not (row or ld or rd);{ 4} while pos<>0 do{ 5} be 阅读全文

posted @ 2011-10-17 08:45 More study needed. 阅读(800) 评论(0) 推荐(0) 编辑

最基本的位运算
摘要:=== 1. and运算 ===( & ) and运算通常用于二进制取位操作,例如一个数 and 1的结果就是取二进制的最末位。这可以用来判断一个整数的奇偶,二进制的最末位为0表示该数为偶数,最末位为1表示该数为奇数. 相同位的两个数字都为1,则为1;若有一个不为1,则为0。 00111 11100 (&或者and) ---------------- 00100=== 2. or运算 ===( | ) or运算通常用于二进制特定位上的无条件赋值,例如一个数or 1的结果就是把二进制最末位强行变成1。如果需要把二进制最末位变成0,对这个数or 1之后再减一就可以了,其实际意义就是 阅读全文

posted @ 2011-10-16 19:53 More study needed. 阅读(1788) 评论(0) 推荐(5) 编辑

DFS解决USACO——Mother's Milk
摘要:DescriptionFarmer John has three milking buckets of capacity A, B, and C liters. Each of the numbers A, B, and C is an integer from 1 through 20, inclusive. Initially, buckets A and B are empty while bucket C is full of milk. Sometimes, FJ pours milk from one bucket to another until the second bucke 阅读全文

posted @ 2011-10-16 18:45 More study needed. 阅读(751) 评论(0) 推荐(0) 编辑

经典进制转换——USACO Palindromic Squares
摘要:DescriptionPalindromes are numbers that read the same forwards as backwards. The number 12321 is a typical palindrome.Given a number base B (2 <= B <= 20 base 10), print all the integers N (1 <= N <= 300 base 10) such that the square of N is palindromic when expressed in base B; also pri 阅读全文

posted @ 2011-10-16 11:00 More study needed. 阅读(235) 评论(0) 推荐(0) 编辑

动态规划解决USACO——Number Triangles
摘要:DescriptionConsider the number triangle shown below. Write a program that calculates the highest sumof numbers that can be passed on a route that starts at the top and ends somewhere on the base. Each step can go either diagonally down to the left or diagonally down to the right. 7 3... 阅读全文

posted @ 2011-10-16 10:50 More study needed. 阅读(911) 评论(0) 推荐(0) 编辑

归并排序
摘要:#include<iostream>using namespace std;const int SIZE = 100;int arr[SIZE];void mergeSort(int fir,int end){ //当子序列就只有一个元素的时候就弹出 if(fir==end)return; //分治 int mid = (fir+end)/2; mergeSort(fir,mid); mergeSort(mid+1,end); //合并 int tempArr[SIZE]; int fir1=fir,fir2=mid+1; for(int i=fir;i<=end;i++) 阅读全文

posted @ 2011-10-14 13:19 More study needed. 阅读(172) 评论(0) 推荐(0) 编辑

二分查找
摘要:这个是精简了的二分查找,个人觉得实在是无法简化了,如果还可以的话,请高人指点一二,先谢谢了。View Code #include "iostream"#include "algorithm"using namespace std;int BinSearch(int *R, int n, int KeyNum){ int low = 0, high = n+1, mid=0; //mid设置为0,是为了利用R[mid]来查找,这样更加精简代码 while(low <= high) { if(R[mid] == KeyNum) //包含了R[0]的情况 阅读全文

posted @ 2011-10-13 22:53 More study needed. 阅读(215) 评论(0) 推荐(0) 编辑

大整数乘法——简单
摘要:写这个程序的时候有三个关键点,知道了这个,你Win, Or, 你Lose!我将它们一一注释在了代码中。View Code #include "iostream"#include "cstring"#include "string"using namespace std;#define maxlen 200int a[maxlen]; int b[maxlen]; int c[2*maxlen+1]; //这个地方也是个关键,一定要多加一个正数,不然错string s1;string s2;int main(){ while(cin&g 阅读全文

posted @ 2011-10-12 11:24 More study needed. 阅读(312) 评论(0) 推荐(0) 编辑

大整数加法——带有负数的
摘要:#include "iostream"#include "string"#include "cstring"using namespace std;#define maxlen 2001int a[maxlen];int b[maxlen];int len1, len2, i, j;int bigger(int a, int b){ return a>b?a:b;}void Add(int underzero){ if(underzero) cout<<'-'; int big = bigger(le 阅读全文

posted @ 2011-10-10 21:53 More study needed. 阅读(497) 评论(0) 推荐(0) 编辑

大整数加法——最简单的
摘要:#include<iostream>#include<string>#include<cstring>using namespace std;#define maxlen 200int a[maxlen];int b[maxlen];int bigger(int a, int b){ return a>b?a:b;}int main(){ string s1, s2; while(cin>>s1>>s2) { int len1 = s1.length(); int len2 = s2.length(); memset(a, 0, 阅读全文

posted @ 2011-10-10 21:51 More study needed. 阅读(202) 评论(0) 推荐(0) 编辑

spfa算法解决POJ 2387
摘要:DescriptionBessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to get back as quickly as possible.Farmer John's field has N (2 <= N <= 1000) landmarks 阅读全文

posted @ 2011-10-07 10:20 More study needed. 阅读(230) 评论(0) 推荐(0) 编辑

BellmanFord解决POJ 3259
摘要:题目:http://poj.org/problem?id=3259题目大意:一个famer有一些农场,这些农场里面有一些田地,田地里面有一些虫洞,田地和田地之间有路,虫洞有这样的性质: 时间倒流。问你这个农民能不能看到他自己,也就是说,有没有这样一条路径,能利用虫洞的时间倒流的性质,让这个人能在这个点出发前回去,这样他就是能看到他自己了 其实要想搞明白这道题目十分的简单,但前提是,你看了我的“Dijkstra算法解决POJ 2263”这篇文章,其余的也就不多说了,该说的我都在注释中说明白了。View Code #include<iostream>using namespace st 阅读全文

posted @ 2011-10-04 20:27 More study needed. 阅读(462) 评论(0) 推荐(0) 编辑

Floyd算法解决POJ 2263
摘要:DescriptionBig Johnsson Trucks Inc. is a company specialized in manufacturing big trucks. Their latest model, the Godzilla V12, is so big that the amount of cargo you can transport with it is never limited by the truck itself. It is only limited by the weight restrictions that apply for the roads al 阅读全文

posted @ 2011-10-04 11:52 More study needed. 阅读(383) 评论(0) 推荐(0) 编辑

Dijkstra解决POJ 2263
摘要:题目:http://poj.org/problem?id=2263题目大意:有n个城市,r条连接两个城市的道路,每条道路有自己的最大复载量。现在问从城市cst到城市cen,车上的最大载重能为多少。虽然是提交了,也搞懂了,但是还没有彻底的明白。因此,也不便多说什么,当我彻底明白的时候再说吧。呵呵,终于完全的明白了,下面指出一二。1.一定要明白map[][]的双关性,何为双关? (1).map[i][j]表示i到j的距离 (2).map[i][j]=0表示i到j不可以直接可达 要达到这种效果,首先将map[][]全部赋值为0, 然后存储建图,在建图的过程中自然的将直接可达 的两点赋值为不... 阅读全文

posted @ 2011-10-03 22:21 More study needed. 阅读(1206) 评论(2) 推荐(2) 编辑

Floyd算法解决POJ 1603
摘要:DescriptionRisk is a board game in which several opposing players attempt to conquer the world. The gameboard consists of a world map broken up into hypothetical countries. During a player's turn, armies stationed in one country are only allowed to attack only countries with which they share a c 阅读全文

posted @ 2011-10-03 19:42 More study needed. 阅读(542) 评论(0) 推荐(0) 编辑

sscanf 你会用吗?
摘要:DescriptionYou 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 100,000 dictionary entries, followed by a blank line, followed by a message 阅读全文

posted @ 2011-10-02 17:21 More study needed. 阅读(242) 评论(0) 推荐(0) 编辑

Trie解决POJ 2503
摘要:题目:http://poj.org/problem?id=2503就是一个字典树的简单应用, 不解释。View Code #include "iostream"using namespace std;typedef struct node{ char word[21]; int mark; struct node * next[26];}node;node * root;void InitRoot(){ root = new node(); root->mark=0; memset(root->next, NULL, sizeof(root->next)) 阅读全文

posted @ 2011-10-02 17:10 More study needed. 阅读(277) 评论(0) 推荐(0) 编辑

线段树和下移操作解决HDOJ 1698
摘要:Problem 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 consecutive metallic sticks which are of the same length.Now Pudge wants to do some operations on the hook.Let us number the consecutive metallic stick 阅读全文

posted @ 2011-10-02 10:22 More study needed. 阅读(315) 评论(0) 推荐(2) 编辑

线段树解决HDOJ 1754
摘要:Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每个测试的第一行,有两个正整数 N 和 M ( 0<N<=200000,0<M<5000 ),分别代表学生的数目和操作的数目。学生ID编号分别从1编到N。第二行包含N个整数,代表这N个学生的初始成绩,其中第i个数代表ID为i的学生的成绩。接下来有M行。每一行有一个 阅读全文

posted @ 2011-10-01 17:05 More study needed. 阅读(271) 评论(0) 推荐(0) 编辑

线段树重温——刷墙
摘要:描述在一面很长的墙壁上,工人们用不同的油漆去刷墙,然而可能有些地方刷过以后觉得不好看,他们会重新刷一下。有些部分因为重复刷了很多次覆盖了很多层油漆,toshio很好奇那些地方被刷过多少种颜色的油漆。输入若干行输入,每行两个数字B[i],E[i](0<=B[i]<=E[i]<=200000)表示这次刷的墙壁是哪一段(假设每次刷的时候油漆颜色都和之前的不同),以0 0结束又若干行输入,每行两个数字begin[i],end[i](0<=begin[i]<=end[i]<=200000)表示toshio询问的段,以0 0结束输出对于每个toshio的询问输出(end 阅读全文

posted @ 2011-10-01 14:45 More study needed. 阅读(398) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

书山有径勤为路>>>>>>>>

<<<<<<<<学海无涯苦作舟!

点击右上角即可分享
微信分享提示