Cod sursa(job #1203977)
| Utilizator | Data | 1 iulie 2014 17:29:38 | |
|---|---|---|---|
| Problema | Patrate2 | Scor | 50 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.57 kb |
#include <fstream>
using namespace std;
ifstream fin("patrate2.in");
ofstream fout("patrate2.out");
int n, V[10000];
const int Base = 1000000;
inline void mul (int A[], int B)
{
int i, t = 0;
for (i=1; i<=A[0] || t; i++, t/=Base)
A[i] = (t += A[i] * B) % Base;
A[0] = i - 1;
}
int main()
{
fin >> n;
V[0] = V[1] = 1;
for (int i=1; i<=n; i++)
{
mul (V, i);
for (int j=1; j<=n; j++)
{
mul (V, 2);
}
}
for (int i=V[0]; i>=1; i--) fout << V[i];
fout << '\n';
fout.close();
return 0;
}
