Description
The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers
on their offices.
— ...
分类:
其他好文 时间:
2015-08-21 15:45:32
阅读次数:
205
Given a non-negative integer num, repeatedly add all its digits until the result has only
one digit.
For example:
Given num = 38, the process is like: 3
+ 8 = 11, 1 + 1 = 2. Since 2 has
on...
分类:
其他好文 时间:
2015-08-21 15:37:26
阅读次数:
147
暴力解决不了问题,有规律可循, 只需看末尾数字即可, 末尾数字的 n 次方是有规律的
#include
using namespace std;
int main(){
int n;
int t;
while(scanf("%d",&t) != EOF){
while(t--){
scanf("%d", &n);
...
分类:
Web程序 时间:
2015-08-21 09:36:42
阅读次数:
137
Problem 34145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.Find the sum of all numbers which are equal to the sum of the factorial of the...
分类:
其他好文 时间:
2015-08-21 09:23:31
阅读次数:
130
Description:Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process ...
分类:
其他好文 时间:
2015-08-20 22:31:12
阅读次数:
241
[九度OJ] 1080 进制转换题目描述:将M进制的数X转换为N进制的数输出。输入:输入的第一行包括两个整数:M和N(2#include #define maxsize 1000struct biginteger{int size;int digit[maxsize];void init(){mem...
分类:
其他好文 时间:
2015-08-19 22:41:10
阅读次数:
426
Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is like:3 + ...
分类:
其他好文 时间:
2015-08-19 19:36:09
阅读次数:
115
【POJ 1850】 Code
还是很想说
数位dp真的很方便!!!
数位dp真的很方便!!!
数位dp真的很方便!!!
重要的事说三遍
#include
#include
#include
using namespace std;
int dp[11][27];
int digit[11];
/*
1~26表示加的字母 0表示不加
有前导...
分类:
其他好文 时间:
2015-08-19 17:02:36
阅读次数:
102
Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is like: 3...
分类:
其他好文 时间:
2015-08-19 00:30:45
阅读次数:
126
1 题目
You are giventwo linked lists representing two non-negative numbers. The digits are storedin reverse order and each of their nodes contain a single digit. Add the twonumbers and return it as a l...
分类:
其他好文 时间:
2015-08-18 22:47:47
阅读次数:
204