Balanced numbers have been used by mathematicians for centuries. A positive integer is considered a balanced number if: 1) Every even digit appears an ...
分类:
其他好文 时间:
2018-09-29 20:30:52
阅读次数:
225
A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128 ...
分类:
编程语言 时间:
2018-09-23 15:02:39
阅读次数:
143
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to le ...
分类:
其他好文 时间:
2018-09-22 15:13:26
阅读次数:
132
def radix_sort(array): bucket, digit = [[]], 0 while len(bucket[0]) != len(array): bucket = [[], [], [], [], [], [], [], [], [], []] for i in range(le... ...
分类:
编程语言 时间:
2018-09-22 10:34:39
阅读次数:
155
#include"bits/stdc++.h" using namespace std; int quick_pow(int n, int k) { int ans=1; while(k) { if(k & 1) ans = ans * n % 10; n = n * n % 10; k >>= 1... ...
分类:
Web程序 时间:
2018-09-20 17:27:30
阅读次数:
161
题目描述 给定两个正整数a和b,求在[a,b]中的所有整数中,每个数码(digit)各出现了多少次。 输入输出格式 输入格式: 输入文件中仅包含一行两个整数a、b,含义如上所述。 输出格式: 输出文件中包含一行10个整数,分别表示0-9在[a,b]中出现了多少次。 输入输出样例 输入样例#1: 1 ...
分类:
其他好文 时间:
2018-09-16 23:01:25
阅读次数:
276
我还想把它当成一道数学题做,但是发现代码实现太繁琐。直接搜索肯定会超时的,所以我要确定遍历的区间。区间的上界我找到了,但是我无法准确的确定区间下界。所以我觉得这个方法不靠谱,就看了题解。 题解用的预处理,先把所有十万以内的正整数都遍历一遍,得到离i最近的以i为最小生成元的数t。以t为下标,将i赋值给 ...
分类:
其他好文 时间:
2018-09-12 14:01:34
阅读次数:
138
Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is a ...
分类:
其他好文 时间:
2018-09-11 23:51:29
阅读次数:
203
描述 Given an N-digit number, you should remove K digits and make the new integer as large as possible. Given an N-digit number, you should remove K dig ...
分类:
其他好文 时间:
2018-09-08 11:41:36
阅读次数:
139
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 12 using namespace std; 13 14 int ha... ...
分类:
其他好文 时间:
2018-09-06 14:38:39
阅读次数:
159