Title: Power of Cryptography
Solution: 8263971
Topic type: Divide and conquer (probably, not very sure)
Knowledge Point: Pow () function of the underlying operation mechanism (because this problem incredibly can use a function on AC off!!?? ), the number of digits of the determination, the array phase multiplication (that is, the multiplication of two super-large integers, can only be stored with an array), two-point lookup method (save time, after all, the topic gives time only 1 seconds!) )
Title: Niu class online https://www.nowcoder.com/acm/contest/75#question Attack! Factorial
Solution:
#include <stdio.h>//array multiplication, res_size: Indicates how many bits, the number of bits returned by the resultintMultiplyintXintRes[],intres_size) { intcarry =0;//Rounding for(intI=0; i<res_size; i++) { intPROD = res[i] * x +carry; Res[i]= prod%Ten; Carry= prod/Ten; printf ("carry =%d\n", carry); } while(carry!=0) {Res[res_size]= carry%Ten; Carry= carry/Ten; Res_size++; } printf ("res_size =%d\n", res_size); returnres_size;}voidFactorial (intN) {intres[36000];//10000! number of digits not exceeding 36000//Initializeres[0] =1; intRes_size =1;//indicates how many bits are//Calculate n! for(intx=2; x<=n; X + +) {res_size=Multiply (x, res, res_size); } for(inti=res_size-1; i>=0; i--) {printf ("%d", Res[i]); } printf ("\ n");}intMain () {Long LongN; while(SCANF ("%lld", &n)! =EOF) {factorial (N); } return 0;}
Topic Knowledge Points: Array multiplication
Array multiplication (large integer multiplication)