摘要: Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it's Hal 阅读全文
posted @ 2017-08-16 20:48 山杉三 阅读(428) 评论(0) 推荐(0) 编辑
摘要: John never knew he had a grand-uncle, until he received the notary's letter. He learned that his late grand-uncle had gathered a lot of money, somewhe 阅读全文
posted @ 2017-08-16 20:41 山杉三 阅读(479) 评论(0) 推荐(0) 编辑
摘要: Farmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the smallest numbe 阅读全文
posted @ 2017-08-16 20:33 山杉三 阅读(282) 评论(0) 推荐(0) 编辑
摘要: The title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have seem this title.If you haven't 阅读全文
posted @ 2017-08-16 20:25 山杉三 阅读(280) 评论(0) 推荐(0) 编辑
摘要: "Fat and docile, big and dumb, they look so stupid, they aren't much fun..." - Cows with Guns by Dana Lyons The cows want to prove to the public that 阅读全文
posted @ 2017-08-16 20:21 山杉三 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。 某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的 阅读全文
posted @ 2017-08-16 20:13 山杉三 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 给定两个整数A和B,求出二者的和。Input The first line of the input contains an integer T(1<=T<=20) which means the number of test cases. Then T lines follow, each lin 阅读全文
posted @ 2017-08-16 20:07 山杉三 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 度熊手上有一本字典存储了大量的单词,有一次,他把所有单词组成了一个很长很长的字符串。现在麻烦来了,他忘记了原来的字符串都是什么,神奇的是他竟然记得原来那些字符串的哈希值。一个字符串的哈希值,由以下公式计算得到: H(s)=∏i≤len(s)i=1(Si−28) (mod 9973)SiSi代表 S[ 阅读全文
posted @ 2017-08-16 20:03 山杉三 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Lily特别喜欢养花,但是由于她的花特别多,所以照料这些花就变得不太容易。她把她的花依次排成一行,每盆花都有一个美观值。如果Lily把某盆花照料的好的话,这盆花的美观值就会上升,如果照料的不好的话,这盆花的美观值就会下降。有时,Lily想知道某段连续的花的美观值之和是多少,但是,Lily的算术不是很 阅读全文
posted @ 2017-08-16 19:49 山杉三 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。现得到城镇道路统计表,表中列出了任意两城镇间修建道路的费用,以及该道路是否已经修通的状态。现请你编写程序,计算出全省畅通需要的最低成本。 Input测试输入包含若干测试用例。每个 阅读全文
posted @ 2017-08-16 19:45 山杉三 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。 现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。 Input本题目包含多组数据,请 阅读全文
posted @ 2017-08-16 19:38 山杉三 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input本题目包含多组测试,请处理到文件结束。 在每个测试的第一行, 阅读全文
posted @ 2017-08-16 19:34 山杉三 阅读(111) 评论(0) 推荐(0) 编辑
摘要: A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary. You are to find all the hat’s words i 阅读全文
posted @ 2017-08-16 19:32 山杉三 阅读(148) 评论(0) 推荐(0) 编辑