上一页 1 2 3 4 5 6 ··· 16 下一页
  2013年11月26日
摘要: Time Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 279ADescriptionValera the horse lives on a plane. The Cartesian coordinate system is defined on this plane. Also an infinite spiral is painted on the plane. The spiral consists of segments:[(0, 0),  阅读全文
posted @ 2013-11-26 17:16 straw_berry 阅读(200) 评论(0) 推荐(0) 编辑
  2013年11月24日
摘要: http://poj.org/problem?id=1201题意:给出N个整数区间[ai,bi],并且给出一个约束ci,( 1= ci个,求出数组Z的最小长度。思路:建立差分约束系统。因为这里要求数组长度的最小值,要变为x-y>=k的标准形式。设数组 s[j] 表示数组 Z 区间[0,j]里包含的元素个数。所以 s[bi+1] - s[ai] >= ci,注意是 j+1,隐含条件 0 = ci;s[i+1] - s[i] >= 0;s[i] - s[i+1] >= -1;然后邻接表建图求最长路。 1 #include 2 #include 3 #include 4 #i 阅读全文
posted @ 2013-11-24 19:31 straw_berry 阅读(440) 评论(0) 推荐(0) 编辑
  2013年11月23日
摘要: DescriptionWhen Valera has got some free time, he goes to the library to read some books. Today he's gottfree minutes to read. That's why Valera tooknbooks in the library and for each book he estimated the time he is going to need to read it. Let's number the books by integers from 1 ton 阅读全文
posted @ 2013-11-23 21:24 straw_berry 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 还没写过大数减法,今天比赛还WA了两次。。。 1 #include 2 #include 3 using namespace std; 4 5 void sub(string a, string b) 6 { 7 string tmp,ans = "",c = ""; 8 int flag = 0;//借位 9 int k = 0;10 bool flag1 = false;//判断是否加负号11 12 if(a.length() = 0 && j >= 0)22 {23 if(a[i] + flag > b[j])24 .. 阅读全文
posted @ 2013-11-23 17:34 straw_berry 阅读(239) 评论(0) 推荐(0) 编辑
  2013年11月22日
摘要: http://poj.org/problem?id=3159题意:flymouse是幼稚园班上的班长,一天老师给小朋友们买了一堆的糖果,由flymouse来分发,在班上,flymouse和snoopy是死对头,两人势如水火,不能相容,因此fly希望自己分得的糖果数尽量多于snoopy,而对于其他小朋友而言,则只希望自己得到的糖果不少于班上某某其他人就行了。比如A小朋友强烈希望自己的糖果数不能少于B小朋友m个,即B- A 2 #include 3 #include 4 using namespace std; 5 6 const int INF = 0x3f3f3f3f; 7 const in. 阅读全文
posted @ 2013-11-22 22:01 straw_berry 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Long long ago, There was a country named X, the country has N citieswhich are numbered from 1 to N. The king of Country-X wants to construct some roads. Please note that Country-X is blessed by an angel. He(The angel is a boy? This is no science, but do not care about those details, this ange.. 阅读全文
posted @ 2013-11-22 18:55 straw_berry 阅读(202) 评论(0) 推荐(0) 编辑
  2013年11月16日
摘要: DescriptionA programming coach hasnstudents to teach. We know thatnis divisible by3. Let's assume that all students are numbered from1ton, inclusive.Before the university programming championship the coach wants to split all students into groups of three. For some pairs of students we know that 阅读全文
posted @ 2013-11-16 19:53 straw_berry 阅读(604) 评论(0) 推荐(0) 编辑
  2013年11月12日
摘要: Time Limit:8000MSMemory Limit:262144KTotal Submissions:17538Accepted:5721DescriptionIn the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They have printed inv 阅读全文
posted @ 2013-11-12 21:56 straw_berry 阅读(405) 评论(0) 推荐(0) 编辑
  2013年11月10日
摘要: http://acm.sdut.edu.cn:8080/vjudge/contest/view.action?cid=42#problem/D改了N多次之后终于A了,一直在改判断正方形和矩形那,判断正方形时算出六条边再排序,若前四条边相等并且与后两条边满足勾股定理,说明是正方形,判断矩形时,我先对结构体二级排序,这样四个点有确定的顺序,再用点积判断是否有三个角是直角,是的话就是矩形。 1 #include 2 #include 3 #include 4 using namespace std; 5 6 struct node 7 { 8 int x,y; 9 }po... 阅读全文
posted @ 2013-11-10 20:38 straw_berry 阅读(412) 评论(0) 推荐(0) 编辑
  2013年11月8日
摘要: Scandinavians often make vacation during the Easter holidays in the largest ski resort Are. Are provides fantastic ski conditions, many ski lifts and slopes of various difficulty profiles. However, some lifts go faster than others, and some are so popular that a queue forms at the bottom.Per is a be 阅读全文
posted @ 2013-11-08 21:31 straw_berry 阅读(343) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 16 下一页