Dynamic Summation

Cerinta completa Given a tree of N nodes, where each node is uniquely numbered in between [1, N]. Each node also has a value which is initially 0. You need to perform following two operations in the tree. Update Operation

Direct Connections

Cerinta completa Enter-View is a linear, street-like country. By linear, we mean all the cities of the country are placed on a single straight line – the -axis. Thus every city’s position can be defined by a single coordinate, ,

Vertical Paths

Cerinta completa You have a rooted tree with vertices numbered from through where the root is vertex . You are given triplets, the triplet is denoted by three integers . The triplet represents a simple path in the tree with

Xor and Sum

Cerinta completa You are given two positive integers and in binary representation. You should find the following sum modulo : where operation means exclusive OR operation, operation means binary shift to the left. Please note, that we consider ideal model

Vertical Rooks

Cerinta completa HackerChess is a variant of chess played at HackerRank. It is a game played between two players who make moves in turns until one of them cannot make any move. The player who cannot make a move loses