The Multiplayer Action Game - Toph

You are given two n-sphere, centered at C1, C2 and having a radius of R1, R2 respectively The velocity vector of the two n-sphere is V1, V2 respectively. Find the minimum time, when the smaller n-sphere will be fully inside of the bigger one. If it is impossible/minimum time is greater than 100000, then print -1. Constraints click to hide There will be atmost $10^{5}$ testcases.
Read more →

Modulo - Toph

You will be given an array, $A$ of length $n$ and $q$ queries. In each query you will be given a value $x$. You have to perform $A_{i} = A_{i} \text{ (mod $x$)} , 1 \le i \le n$ for each query , and after all the query print the array. Constraints click to hide $A_{i} \le 2^{60}$ $n\le 10^{5}$ $q\le 10^{5}$ $x \le 2^{60}$ Solution: When $A_{i} = A_{i} \text{ (mod $x$)}$ operation change $A_{i}$ ?
Read more →

Complex Tashreef - Toph

Statement: In this problem you are asked to calculate : $\sum_{i=L}^{R}{\sum_{j=0}^{i}{[\binom{i}{j} \text{ (mod 2)} \equiv 0]}}$ , for given $L$ and $R$. Inside Math: From the lucas' theorem we can state that, $\sum_{j=0}^{i}{[\binom{i}{j} \text{ (mod 2)}\equiv 1]} = 2^{f(i)}$ . [$f(i) = \text{ number of one in binary representation of } i$] Suppose , $S(x) = \sum_{i=0}^{x}{\sum_{j=0}^{i}{[\binom{i}{j} \text{ (mod 2)} \equiv 0]}}$ . Hence , our answer will be $S(R)-S(L-1)$
Read more →

Prime Factor Love - Toph

Find sum of sum-of-divisor from 1 to n
Read more →