摘要: 有多个不同面值的硬币,任意找,输入金额S,输出最少硬币数。 列如:有1,3,5三种面值的硬币,我有9元钱,能兑换的硬币数最少是多少枚?5+3+1=9,最少兑换三枚。 0元兑换0个, 1元兑换1个, 2元兑换2个,在1元的基础上加一个, 3元兑换1个, 4元兑换2个,4-3=1元,在3元的基础上加一个 阅读全文
posted @ 2020-03-31 17:10 梦娃子 阅读(1229) 评论(0) 推荐(0)
摘要: Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popula 阅读全文
posted @ 2020-03-30 20:09 梦娃子 阅读(205) 评论(0) 推荐(0)
摘要: 给你n个整数,请按从大到小的顺序输出其中前m大的数。 Input每组测试数据有两行,第一行有两个数n,m(0<n,m<1000000),第二行包含n个各不相同,且都处于区间[-500000,500000]的整数。 Output对每组测试数据按从大到小的顺序输出前m大的数。 Sample Input 阅读全文
posted @ 2020-03-29 20:14 梦娃子 阅读(260) 评论(0) 推荐(0)
摘要: A binary tree is a finite set of vertices that is either empty or consists of a root r and two disjoint binary trees called the left and right subtree 阅读全文
posted @ 2020-03-29 18:38 梦娃子 阅读(180) 评论(0) 推荐(0)
摘要: A new parliament is elected in the state of MMMM. Each member of the parliament gets his unique positive integer identification number during the parl 阅读全文
posted @ 2020-03-28 20:31 梦娃子 阅读(559) 评论(0) 推荐(0)
摘要: Limak is a grizzly bear who desires power and adoration. He wants to win in upcoming elections and rule over the Bearland. There are n candidates, inc 阅读全文
posted @ 2020-03-27 11:12 梦娃子 阅读(194) 评论(0) 推荐(0)
摘要: Given a string of balanced parentheses output all the matching pairs.(给定一串平衡括号,输出所有匹配对。) Input A string consisting of only parentheses '(' and ')'. Th 阅读全文
posted @ 2020-03-26 10:45 梦娃子 阅读(302) 评论(0) 推荐(0)
摘要: ACboy was kidnapped!! he miss his mother very much and is very scare now.You can't image how dark the room he was put into is, so poor :(. As a smart 阅读全文
posted @ 2020-03-26 09:53 梦娃子 阅读(196) 评论(0) 推荐(0)
摘要: Calculate A + B. InputEach line will contain two integers A and B. Process to end of file. OutputFor each case, output A + B in one line. Sample Input 阅读全文
posted @ 2020-03-25 15:57 梦娃子 阅读(171) 评论(0) 推荐(0)
摘要: 1 #include<stdio.h> 2 int fun(int n) 3 { 4 if(n==1) //递归终止条件 5 return 1; 6 return n*fun(n-1);//关键 7 } 8 int main() 9 { 10 int n; 11 scanf("%d",&n);//输 阅读全文
posted @ 2020-03-24 20:23 梦娃子 阅读(441) 评论(0) 推荐(0)