PROBLEM LINK:Author: Misha Chorniy DIFFICULTY:CAKEWALK PREREQUISITES:None PROBLEM:You're given array $D$ of size $N$ and $Q$ queries $X$. In each query you have to compute the result of the program
QUICK EXPLANATION:You should consider only $O(\log X)$ terms such that $D_i\neq 1$. EXPLANATION:You may keep keep first $\min(2\cdot\log_2 X, N)$ terms of $D$ which aren't equal one. If there are more nonone terms than $X$ wiil definitely be equal zero at the end of procedure. ALTERNATIVE SOLUTION:You can keep product $P$ of nonone terms of $D$ instead of keeping this terms and divide $X$ by $P$. But you should check then that you output zero if there are too much such terms. AUTHOR'S AND TESTER'S SOLUTIONS:Author's solution can be found here. RELATED PROBLEMS:
This question is marked "community wiki".
asked 25 Nov '17, 08:28

why is there no TLE in solution? answered 28 Nov '17, 10:04
Is there only test cases for removing 1? In some of programme even in single loop there is TLE but here using two loops and Ac ?
(28 Nov '17, 10:31)

Hey GUYS, PLz Give it a look , when i was doing this question i came to know an interesting fact that if i was using floor func then it's giving TLE for subtask 2 , and if I was using int then it's giving correct ans NOTE: always use int type only. SOLN : / AUTHOR : fad_coder00000 "FAD means enthusiasm for something" * include <iostream>include <bits stdc++.h="">define ll long long intusing namespace std; int main() { ll t;
} answered 01 Dec '17, 00:50
