摘要: You will be given a string which only contains ‘1’; You can merge two adjacent ‘1’ to be ‘2’, or leave the ‘1’ there. Surly, you may get many differen 阅读全文
posted @ 2017-08-19 09:29 joeylee97 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 现有一笔经费可以报销一定额度的发票。允许报销的发票类型包括买图书(A类)、文具(B类)、差旅(C类),要求每张发票的总额不得超过1000元,每张发票上,单项物品的价值不得超过600元。现请你编写程序,在给出的一堆发票中找出可以报销的、不超过给定额度的最大报销额。 Input测试输入包含若干测试用例。 阅读全文
posted @ 2017-08-19 09:27 joeylee97 阅读(271) 评论(0) 推荐(0) 编辑
摘要: Bessie and her friend Elsie decide to have a meeting. However, after Farmer John decorated his fences they were separated into different blocks. John' 阅读全文
posted @ 2017-08-19 09:26 joeylee97 阅读(262) 评论(0) 推荐(0) 编辑
摘要: Alice is going to take all her savings out of the ATM(Automatic Teller Machine). Alice forget how many deposit she has, and this strange ATM doesn't s 阅读全文
posted @ 2017-08-19 09:24 joeylee97 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Jim has a balance and N weights. (1≤N≤20)(1≤N≤20) The balance can only tell whether things on different side are the same weight. Weights can be put o 阅读全文
posted @ 2017-08-19 09:22 joeylee97 阅读(186) 评论(0) 推荐(0) 编辑
摘要: bobo has a sequence a 1,a 2,…,a n. He is allowed to swap twoadjacent numbers for no more than k times. Find the minimum number of inversions after his 阅读全文
posted @ 2017-08-19 09:20 joeylee97 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Given a number x, ask positive integer y≥2y≥2, that satisfy the following conditions: 1. The absolute value of y - x is minimal 2. To prime factors de 阅读全文
posted @ 2017-08-19 09:19 joeylee97 阅读(125) 评论(0) 推荐(0) 编辑
摘要: nn pagodas were standing erect in Hong Jue Si between the Niushou Mountain and the Yuntai Mountain, labelled from 11 to nn. However, only two of them 阅读全文
posted @ 2017-08-19 09:17 joeylee97 阅读(195) 评论(0) 推荐(0) 编辑
摘要: Given a sequence A with length n,count how many quadruple (a,b,c,d) satisfies: a≠b≠c≠d,1≤a<b≤n,1≤c<d≤n,Aa<Ab,Ac>Ada≠b≠c≠d,1≤a<b≤n,1≤c<d≤n,Aa<Ab,Ac>Ad. 阅读全文
posted @ 2017-08-19 09:16 joeylee97 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 直接打表找规律 HazelFan is given two positive integers a,ba,b, and he wants to calculate amodbamodb. But now he forgets the value of bb and only remember the 阅读全文
posted @ 2017-08-19 09:12 joeylee97 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 春天到了, HDU校园里开满了花, 姹紫嫣红, 非常美丽. 葱头是个爱花的人, 看着校花校草竞相开放, 漫步校园, 心情也变得舒畅. 为了多看看这迷人的校园, 葱头决定, 每次上课都走不同的路线去教室, 但是由于时间问题, 每次只能经过k个地方, 比方说, 这次葱头决定经过2个地方, 那他可以先去问 阅读全文
posted @ 2017-08-19 09:10 joeylee97 阅读(321) 评论(0) 推荐(0) 编辑