Codeforces Global Round 5E (structure, thinking)

HAVE_STRUCT_TIMESPEC #define
#include <bits / STDC ++ H.>
the using namespace STD;
int main () {
iOS :: sync_with_stdio (to false);
cin.tie (NULL);
cout.tie (NULL);
int n-; // satisfied because the most number of nodes lower right meaning of the title of the largest and the same root parity, so the tree right subtree must have an even number of nodes, the left subtree and right subtree can have as many nodes can be more than a node
CIN >> n;
int x =. 1;
the while (x <= n) {
IF (n == == x x || + n. 1) {// x is equal to n or n is equal to x + 1, x x + 1 that is based on the increase in the left subtree of a node, the tree remains left subtree of nodes is even, so that some may be left subtree of nodes +1
COUT <<. 1;
return 0 ;
}
IF (x &. 1) // if x is odd, on the basis of x plus a right subtree of node it as a new tree, together with it as a new x tree left subtree, plus a root
x = x + x + +. 1. 1;
the else // if x is even, on the basis of x plus x to act as a new tree left subtree, plus a new node as a root of the tree
= X + X + X. 1;
}
COUT << 0;
return 0;
}

Guess you like

Origin www.cnblogs.com/ldudxy/p/11701399.html
Recommended