题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1042[代码]
原创 2021-08-04 16:15:16
38阅读
#include<stdio.h> #include<iostream> using namespace std; int a[8000]; int main() {int n;int i;while(scanf("%d",&n)!=EOF)//碰到有EOF的时候一定要用scanf。不要用cin>>n&&n这样的的,不让这样的错误你非
转载 2017-05-19 20:45:00
44阅读
2评论
  #include<iostream> #include<stdio.h> #include<string> #include<iomanip> #include<algorithm> using namespace std; #include "time.h" const int MAX_GROUPS = 20000;//最多2
HDU
转载 2021-07-28 16:45:11
59阅读
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1042 #include<iostream> #include<stdio.h> #include<string> #include<iomanip> #include<algorithm> 
原创 2009-09-14 16:23:00
1011阅读
问题链接:HDU1042 n!。问题描述:参见上文。问题分析:看似简单的问题,背后实际上有许多道理。阶乘值随着n的增大,增大的速度相当的快,是一个大整数。似乎这个题可以使用大整数类进行计算,然而类计算相对复杂,时间上溢出的可能性比较大。一般的整数计算,在计算机中是一种...
转载 2016-05-29 09:51:00
17阅读
2评论
N!Time Limit: 10000/5000 MS (Java/Others)    Me
原创 2022-08-08 18:04:19
64阅读
题目大意: 求 n。(可能会超过整数范围,这里用数组模拟n!的值) http://acm.hdu.edu.cn/showproblem.php?pid=1042 AC代码: /** *数组模拟n!,循环太多可能超时, */ #include<iostream> #include<cstdio> #i
原创 2021-08-06 18:07:16
141阅读
我的代码,由于时间的问题,以后找机会优化了!
原创 2021-07-28 16:49:01
57阅读
Problem Description Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N! Input One N in one line, process to the end of file. Output For ea
HDU
原创 2021-07-14 16:00:54
77阅读
题解:高精度乘法压位。#include #include const int mod=10000;int l,n,a[1000000];int main(){ while(~scanf("%d",&n)){ memset(a,0,sizeof a); a[1]=1;...
转载 2014-08-29 15:24:00
9阅读
N!Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 40204Accepted Submission(s): 11162 Problem DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N!InputOne N in one line, process to the end of file.OutputFor each N, output N!
转载 2013-03-30 10:08:00
45阅读
2评论
N!http://acm.hdu.edu.cn/showproblem.php?pid=1042Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 37977 Accepted Submission(s): 10555 Problem DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N!InputOne N in one line, process
转载 2012-12-26 16:55:00
54阅读
2评论
N! Time Limit: 10000/5000 MS (J
原创 2023-07-17 15:52:52
34阅读
//123*20 相当于 100*20 + 20*20+3 //常规方法N>=13就溢出 #include#incl
转载 2012-07-30 14:58:00
49阅读
2评论
N! Problem Description Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N! Input One N in one line, process to the end of file. Output For eac
转载 2013-11-01 19:32:00
32阅读
2评论
2011-12-23 07:49:22地址:http://acm.hdu.edu.cn/showproblem.php?pid=1042题意:算n!。最高10000。1w的时候n!有不超过4w位(Log10(10000^10000) = 40000)。代码:# include <stdio.h># define MOD 10000int num[40000] ;void mul(int n){ int i, cc = 0 ; for (i = 1 ; i <= num[0] ; i++) { num[i] = num[i]*n + cc ; cc ...
转载 2012-01-06 23:29:00
50阅读
N!Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 33314 Accepted Submission(s): 9234Problem Description Given an integer N(0 ≤ N ≤ 10000), your task is to calculate NInput One N in one line, process to the end of file.Output For each N, output N!
转载 2012-07-23 18:28:00
52阅读
N!    Problem Description    Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N!    Input    One N in one line, process to the end of file.    Sample Input    1    2    3
原创 2023-08-15 17:21:41
40阅读
http://acm.hdu.edu.cn/showproblem.php?pid=1042集训第一天比赛上有这个题 以前做过一个求150的 效率比较低 用在这个上面就超时 然后在刘汝佳书上看到一种方法 勉强可以过 3400+msView Code 1 #include<stdio.h> 2 #include<string.h> 3 int x[40000]; 4 int main() 5 { 6 int i, n,g,s,d; 7 while(scanf("%d", &n)!=EOF) 8 { 9 int max = 40000;10 ..
转载 2012-07-18 16:05:00
56阅读
2评论
题目大意:输入n,输出n!解题思路:数据可能很大。用java的大数代码如下:package com.njupt.bigInteger;import java.math.BigInteger;import java.util.Scanner;public class HDU_1042 { public static void main(String[] ar
原创 2013-08-11 20:09:38
23阅读
  • 1
  • 2
  • 3
  • 4
  • 5