For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decre ...
分类:
其他好文 时间:
2018-09-05 17:36:31
阅读次数:
119
Problem UVA12107-Digit Puzzle Accept:85 Submit:612 Time Limit: 3000 mSec Problem Description Input The input contains several test cases. Each test ca ...
分类:
其他好文 时间:
2018-09-05 09:05:05
阅读次数:
238
[抄题]: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. Example: [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空 ...
分类:
其他好文 时间:
2018-09-05 08:58:49
阅读次数:
149
输入: 每行输入1个正整数n,(0<n<1000 000) 输出: 对于每个n,输出n!的(十进制)位数 digit, 和最高位数firstNum。(n!约等于 firstNum * 10^[digit-1] ) 方法一: 利用数学库及相关知识。 采用蛮力,根据定义,直接求解! 所谓n!的十进制位数 ...
分类:
其他好文 时间:
2018-09-05 00:45:56
阅读次数:
159
题目描述 给定两个正整数a和b,求在[a,b]中的所有整数中,每个数码(digit)各出现了多少次。 输入输出格式 输入格式: 输入文件中仅包含一行两个整数a、b,含义如上所述。 输出格式: 输出文件中包含一行10个整数,分别表示0 9在[a,b]中出现了多少次。 输入输出样例 输入样例 1: 1 ...
分类:
其他好文 时间:
2018-09-03 20:30:05
阅读次数:
166
题目: Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit t ...
分类:
编程语言 时间:
2018-09-03 19:30:13
阅读次数:
184
Description Given a positive integer N, you should output the leftmost digit of N^N. Description Given a positive integer N, you should output the lef ...
分类:
其他好文 时间:
2018-09-01 14:02:49
阅读次数:
159
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-08-31 00:32:27
阅读次数:
157
Radix Sorting 稳定 O(d(r+n)) 不需要进行关键字之间的比较、交换、移动,借助分配和收集完成排序 扑克牌 最主位关键字 最次位关键字 最高位优先 most significant digit first 先按照最主位关键字排序,知道最后一个关键字,必须将序列逐层分割成若干个子序列 ...
分类:
编程语言 时间:
2018-08-30 16:42:43
阅读次数:
200
1 #include 2 using namespace std; 3 4 /* 5 *判断素数 6 */ 7 8 bool isPrime(unsigned long digit) 9 { 10 if(digit 1; 12 else if(digit % 2 == 0 || digit % 3 ... ...
分类:
其他好文 时间:
2018-08-30 00:15:47
阅读次数:
130