Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- long long fastpow(long long x, long long y){
- if (y == 0) return 1;
- if (y % 2 == 1) return x*fastpow(x, y - 1);
- long long tmp = fastpow(x, y/2);
- return tmp*tmp;
- }
- using namespace std;
- long long n;
- int main(){
- cin >> n;
- cout << (n % 2 == 0 ? fastpow(2, n/2) : 0);
- }
Add Comment
Please, Sign In to add comment