Cod sursa(job #3339021)

Utilizator uncrownedHojda Adelin uncrowned Data 5 februarie 2026 18:59:49
Problema Patrate2 Scor 10
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.49 kb
#include <bits/stdc++.h>
using namespace std;

ifstream fin("patrate2.in");
ofstream fout("patrate2.out");

#define cin fin
#define cout fout
#define ll long long

ll power(ll a, ll b) {
    ll s=1;
    while(b>0) {
        if (b%2==1) {
            s *= a;
        }
        b/=2;
        a*=a;
    }
    return s;
}

int main() {
    int n;
    cin >> n;
    if (n==1) {
        cout << 2;
        return 0;
    }
    cout << 1LL* 4 * power(2, n*n-1);
    return 0;
}