上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: 一个十进制整数被叫做权势二进制,当他的十进制表示的时候只由0或1组成。例如0,1,101,110011都是权势二进制而2,12,900不是。 当给定一个n的时候,计算一下最少要多少个权势二进制相加才能得到n。 Input单组测试数据。 第一行给出一个整数n (1<=n<=1,000,000)Outp 阅读全文
posted @ 2017-09-05 12:53 山杉三 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑
上一页 1 2 3 4 5 6 ··· 8 下一页