UVA10323:

Factorial! You Must be Kidding!!!

#include <iostream>

using namespace std;

long long table[100001];

long long factorial(long a){
	if(a == 0 || a == 1){
		return 1; 

	} else {
		if(table[a] != 0) {
			return table[a];
		} else {
			return a * factorial(a-1);
		}
	
	}
}

int main(){

	for(int i = 0; i < 100001; i++){
		table[i] = 0;
	}

	long long factorial = factorial(100000); 
	// cout << factorial(10) << endl;

	return 0; 
}
[Back to Listing Page]

Home

Posts

Projects

Github

Contact

janzzen

Developed by Janzzen Ang powered by Vercel