Cod sursa(job #1395941)
Utilizator | Data | 21 martie 2015 20:05:24 | |
---|---|---|---|
Problema | 12-Perm | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <fstream>
using namespace std;
ifstream fin("12-perm.in");
ofstream fout("12-perm.out");
long long countPermutations(long long n)
{
const long long kMod = (1 << 20);
if (n == 1)
return 1;
return n * (n - 1) % kMod;
}
int main()
{
int n; fin >> n;
fout << countPermutations(n) << '\n';
return 0;
}