1182A - Filling Shapes - CodeForces Solution


dp math *1000

Please click on ads to support us..

Python Code:

print([2**((n:=int(input()))//2),0][n%2])

C++ Code:

#include <iostream>
#include <algorithm>
#include <math.h>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#define ll long long
#define pp pop_back
#define sz s.size()
#define N 10005
#define ff first
#define ss second
#define pb push_back
using namespace std;

long long t, n, a[N], b[N], c, cnt, ind, d, e;

int main()
{
	cin >> n;
	c = 1;
	if(n % 2 == 0){
		n /= 2;
		while( n-- ){
			c *= 2;
		}

		cout << c;
	}

	else {
		cout << 0;
	}
}


Comments

Submit
0 Comments
More Questions

Removal of vertices
Happy segments
Cyclic shifts
Zoos
Build a graph
Almost correct bracket sequence
Count of integers
Differences of the permutations
Doctor's Secret
Back to School
I am Easy
Teddy and Tweety
Partitioning binary strings
Special sets
Smallest chosen word
Going to office
Color the boxes
Missing numbers
Maximum sum
13 Reasons Why
Friend's Relationship
Health of a person
Divisibility
A. Movement
Numbers in a matrix
Sequences
Split houses
Divisible
Three primes
Coprimes