Cod sursa(job #983421)
| Utilizator | Data | 11 august 2013 19:15:47 | |
|---|---|---|---|
| Problema | Patrate2 | Scor | 90 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.63 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("patrate2.in");
ofstream fout("patrate2.out");
long n, h[5000];
inline void Mul(long x)
{
short t = 0;
for(int i=1; i<=h[0]; i++)
{
h[i] = h[i] * x + t;
t = h[i] / 10;
h[i] %= 10;
}
while(t)
{
h[++h[0]] = t % 10;
t /= 10;
}
}
int main()
{
fin>>n;
h[0] = h[1] = 1;
for(int i=1; i<=n; i++)
Mul(i);
for(int i=1; i<=n; i++)
for(int j=1; j<=n; j++)
Mul(2);
for(int i=h[0]; i>0; i--)
fout<<h[i];
return 0;
}
