Pagini recente » Cod sursa (job #1851787) | Cod sursa (job #2181722) | Cod sursa (job #2476606) | Cod sursa (job #2064033) | Cod sursa (job #1044791)
#include <cstdio>
#include <vector>
using namespace std;
#define A (*this)
class BigInt : vector<int> {
public :
static const int base = int(1e9);
BigInt() {
A.resize(1<<10,0);
}
BigInt(int value) {
A.resize(1<<10,0);
A = value;
}
void operator = (const int &intValue) {
fill(A.begin(),A.end(),0);
for(int aux = intValue;aux > 0;aux /= base) {
A[++A[0]] = aux%base;
}
}
void operator += (const BigInt &B) {
int i, T;
for(i = 1, T = 0;i <= A[0] || i <= B[0] || T;i++, T /= base) {
A[i] = (T += A[i] + B[i])%base;
}
A[0] = i - 1;
}
void operator += (int intValue) {
BigInt B ;
B = intValue;
A += B;
}
BigInt operator * (int B) {
int i;
long long t = 0;
BigInt ret;
ret = A;
for (i = 1; i <= ret[0] || t; i++, t /= base)
ret[i] = (t += 1ll*ret[i] * B) % base;
ret[0] = i - 1;
return ret;
}
void print() {
if(A[0] == 0) {
printf("0");
} else {
printf("%d",A[A[0]]);
for(int i = A[0] - 1;i;i--) {
printf("%09d",A[i]);
}
}
}
bool isZero() {
return A[0] == 0;
}
};
#undef A
BigInt ret;
int main()
{
freopen("patrate2.in","r",stdin);
freopen("patrate2.out","w",stdout);
int n;
scanf("%d",&n);
ret = 1;
for (int i = 2;i <= n;i++) {
ret = ret * i;
}
int c = n * n / 30;
for (int i = 1;i <= c;i++) {
ret = ret * (1 << 30);
}
ret = ret * (1 << (n * n % 30));
ret.print();
return 0;
}