思路: 从左到右贪心放置数字,要注意判断这个数字能否放置在当前位。 实现: ...
分类:
其他好文 时间:
2018-01-30 12:17:52
阅读次数:
184
Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get. ...
分类:
其他好文 时间:
2018-01-28 11:15:36
阅读次数:
114
If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123 105 with ...
分类:
其他好文 时间:
2018-01-27 13:35:56
阅读次数:
146
You are given two positive integer numbers a and b. Permute (change order) of the digits of a to construct maximal number not exceeding b. No number i ...
分类:
其他好文 时间:
2018-01-27 00:30:48
阅读次数:
183
习题1:题目:给一个不多于5位的正整数,要求:一、求它是几位数,二、逆序打印出各位数字。 #encoding=utf-8 while True: try: num=int(raw_input("input a number not more than 5 digits:")) except: "Pl... ...
分类:
编程语言 时间:
2018-01-25 00:11:48
阅读次数:
183
Pandigital prime Problem 41 We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 ...
分类:
其他好文 时间:
2018-01-24 13:55:17
阅读次数:
151
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 whic ...
分类:
其他好文 时间:
2018-01-23 22:12:05
阅读次数:
204
import random,string# print(random.randint(1,199))#1-199随机取一个整数# print(string.digits) #所有的数字0-9# print(string.ascii_lowercase) #所有的小写字母# print(string. ...
分类:
编程语言 时间:
2018-01-23 00:47:18
阅读次数:
208
Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specificat ...
分类:
其他好文 时间:
2018-01-21 00:00:55
阅读次数:
208
Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less t ...
分类:
其他好文 时间:
2018-01-20 19:49:23
阅读次数:
166