Selected subset

#include<cstdio>
using namespace std;
typedef long long LL;
LL n , k , p = 1e9 + 7;

inline LL fpow(LL x , LL y)
{
    LL res = 1;
    while (y)
    {
        if (y & 1) res = res * x % p;
        x = x * x % p , y >>= 1;
    }
    return res;
}

int main()
{
    freopen("subset.in" , "r" , stdin);
    freopen("subset.out" , "w" , stdout);
    scanf("%lld%lld" , &n , &k);
    printf("%lld" , fpow(2 , n * k % (p - 1)));
    fclose(stdin) , fclose(stdout);
}

Guess you like

Origin www.cnblogs.com/leiyuanze/p/12337118.html