枚举
yinyeqiqi
只因岁月蒙尘。
展开
-
Min Number
Min NumberDescriptionNow you are given one non-negative integer n in 10-base notation, it will only contain digits ('0'-'9'). You are allowed to choose 2 integers i and j, such that: i原创 2014-12-14 20:33:38 · 509 阅读 · 0 评论 -
Star
StarDescriptionOverpower often go to the playground with classmates. They play and chat on the playground. One day, there are a lot of stars in the sky. Suddenly, one of Overpower’s cl原创 2014-12-14 20:38:25 · 523 阅读 · 0 评论 -
排列2
Problem DescriptionRay又对数字的列产生了兴趣:现有四张卡片,用这四张卡片能排列出很多不同的4位数,要求按从小到大的顺序输出这些4位数。 Input每组数据占一行,代表四张卡片上的数字(0 Output对每组卡片按从小到大的顺序输出所有能由这四张卡片组成的4位数,千位数字相同的在同一行,同一行中每个四位原创 2015-03-12 21:33:43 · 710 阅读 · 0 评论 -
最大乘积 Uva 11059
输入n个元素组成的序列S,你需要找出一个乘积最大的连续子序列。如果这个最大的乘积不是正数,应输出0(表示 无解)。1样例输入:32 4 -352 5 -1 2 -1样例输出:820思路: 枚举第一个和最后一个#include#includeusing namespace std;int main(){ int n,m,i,j; i原创 2015-03-12 21:42:08 · 653 阅读 · 0 评论 -
Uva 除法
输入正整数n,按从小到大的顺序输出所有形如abcde/fghij=n的表达式,其中a~j恰好为数字0-9的一个排列(可以有前导0,)2样例输入:63样例输出:79546 / 01283 = 6294736 / 01528 = 62思路:枚举fghij,算出abcde,判断每一个都不相等//用sprintf#include#include#include#inc原创 2015-03-12 21:47:08 · 747 阅读 · 0 评论