Last digit of 51nod1004 n ^ n, 51nod1004 last digitSource: Author Ignatius. L (Hdu 1061) benchmark time limit: 1 second space limit: 131072 KB score: 5 difficulty: Level 1 algorithm question collection attention to give an integer N, output the last digit in decimal format of N ^ N (N's N power. Input
N (1 Output
Output the last number of N ^ NInput example
13Output example
3Li Ye (subject provider) C ++ ru
'******************************
' Function: Generator (Length)
' Parameters: Length, number of arbitrary lengths, random code digits
' Author: Arisisi
' Date: 2007/7/15
' Description: Generate random code function with arbitrary English + digit digit length
' Example: Generator (80)
'******************************
Function Generator (Length)
Dim I, TempS
TempS = "abcdefghijklmnopqrstuvwxyz1234567890"
Genera
Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...
Note:N is positive and would fit within the range of a 32-bit signed integer (n
Example 1:
Input:3
Output:3Example 2:
Input:11
Output:0
Explanation:The 11th digit of the sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, one, one, ... is a 0, which are part of the number 10.
Here are the practices of C + +
We first analyze the rela
From 1 to 9, the nine digits form a nine-digit number with no duplicates. If a number is extracted from the left, it must be divisible by 1. The number composed of two numbers can be divisible by 2. The number composed of three numbers can be divisible by 3, and so on... The number of each fetch is obtained from the left. Q: What is this number? Returns the numberAlgorithm.
CodeAs follows:
Import Java. util. arrays;
From: http://yangguo.j
A friend encountered a problem during the interview, write programs in Java, calculate two 20-digit multiplication. Listen, it's funny, just try to make it.The idea is to use code to simulate the process of multiplying the hand, that is, the multiplication of a bit, the result remains on the corresponding bit, and the rounding problem is solved.Ask if the other side is solved, the other side told me that Java has a Java.math.BigInteger package, there
http://poj.org/problem?id=3187The exhaustion search is arranged in ascending order before the sum of the rules is sorted by the ruleThis guarantees that the first and k are the results that match the minimum sequence.1#include 2#include 3#include 4 5 using namespacestd;6 7 intSumintA[],intN)8 {9 ints[ One];Ten for(inti =0; I ) One { AS[i] =A[i]; - } - while(n! =1) the { -n--; - for(inti =0; I ) - { +S[i] + = s[i+1]; - } + } A returns[0];
Title: https://www.lydsy.com/JudgeOnline/problem.php?id=1026Quite simple digital DP, pre-F[I][J] represents the number of I digits, the number of windy starting with J;But do not understand why the last one to take out a special sentence ret++ wrong, and write in the loop, special i==1 on the right ...The code is as follows:#include #include#include#includeusing namespacestd;inta,b,f[ the][ the],num[ the];intAbbintx) {return(x>0)? x:-x;}intGetnum (intx) { intCnt=0; while(x) num[++cnt]=x%Ten,
This article mainly introduces how to generate a unique number in PHP. In this article, convert the hexadecimal value to 36 to obtain more than 60 million unique numbers that are not repeated, with the number of digits being 10 digits, if you need a large data number, you can refer to the following, for example, the five-digit license plate number, the ten-digit license number, the Order serial number, and
This article mainly introduces how to generate a unique number in PHP. in this article, convert the hexadecimal value to 36 to obtain more than 60 million unique numbers that are not repeated, with the number of digits being 10 digits, if you need a large data number, you can refer to the following, for example, the five-digit license plate number, the ten-digit license number, the order serial number, and
When we want to numbers a large number of data, there is a limit on the number of digits, such as a five-digit license plate number, a ten-digit license number, order serial number, and a short URL, we can use the 36-digit system to calculate non-repeated numbers that match the number of digits.
We use 0-Z (0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ) to represent the
Because I needed to perform the escalation, verification, and query of the 15-digit old ID card number, and did not find any ready-made functions, I wrote a simple process and hoped to help my friends.This function has a single function and can only verify whether the 18th-bit number is correct or obtain the 18th-bit number. Other functions can be expanded by yourself!'Version: 1.0.1'Author: sfply (sfply@163.com)'Last modified: 2004/7/17 12:03'Src is
Hdu 1066 Last non-zero Digit in N! (Number Theory -- n! ), Hdunon-zero
Last non-zero Digit in N!
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission (s): 6432 Accepted Submission (s): 1593
Problem DescriptionThe expression N !, Read as "N factorial," denotes the product of the first N positive integers, where N is nonnegative. So, for example,
N!
0 1
1 1
2 2
3
Jiang Yongjiang Altera Cup National Graduate Electronic Design Competition has a simple question of "representing-37 as a three-digit complement code. The instructor with a score raised an objection to the answer as soon as he came up, believing that 1122
(3) The result is incorrect, because "except the highest sign bit", 122(3) = 1 × 32 + 2 × 31 + 2 × 30 = 17. This shows that there are problems in our long-term theoretical teaching of digital circuit
Topic links Topic: Of the 9 numbers obtained by the first digit of the permutation, six are prime numbers: 13,23,43,53,73 and 83. By replacing the third and fourth digits of the 56**3 with the same number, this five-digit number is the first number that can get seven prime numbers, the prime numbers are: 56003, 56113, 56333, 56443, 56663, 56773, and 56993. So the smallest of the 56003 is the smallest prime
What is the vampire number.
A vampire number is a number that has an even number of digits, and can be multiplied by a pair of numbers, and this pair of digits contains the half digits of the product,
The number that is selected from the initial number can be sorted arbitrarily. The number ending with two 0 is not allowed,
For example, the following numbers are "vampire" numbers:
1260 = 21 * 60
1827 = 21 * 87
2187 = 27 * 81
Programming Ideas
The first step , first, is to split the given four
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.