Cod sursa(job #543651)

Utilizator dornescuvladVlad Eugen Dornescu dornescuvlad Data 28 februarie 2011 13:38:14
Problema Sortari2 Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <iostream>
#include <fstream>

using namespace std;
 
const char iname[] = "sortari2.in";
const char oname[] = "sortari2.out";
const int  mod     =  999017;

ifstream fin(iname);
ofstream fout(oname);

int fact[1005], i, n;

int main()
{
	fin >> n;
	fact[0] = 1;
	for(i = 1; i <= n; i ++)
		fact[i] = (i * fact[i - 1]) % mod;
	fout << fact[n] / 2 - 1;
	return 0;
}