Cod sursa(job #1819667)
Utilizator | Data | 30 noiembrie 2016 18:44:09 | |
---|---|---|---|
Problema | Patrate2 | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <fstream>
using namespace std;
ifstream fin("patrate2.in");
ofstream fout("patrate2.out");
long cn, n, x;
int main()
{
fin>>n;
long long s1=1, s2=1;
x=2;
cn=n;
n=n*n;
while(n>0)
{
if(n%2==1)
{
s1=s1*x;
x=x*x;
n=n/2;
}
else
{
x=x*x;
n=n/2;
}
}
while(cn>1)
{
s2=s2*cn;
cn--;
}
fout<<s1*s2;
return 0;
}