PROBLEM LINK:Author: Md Shahid Tester: Arkapravo Ghosh Editorialist: Md Shahid DIFFICULTY:SIMPLE PROBLEM:Given $N$ and array $A_i$.You need to find $AND$ of $ANDs$ of $A_i$ i.e, $X$ and if GCD(X,1000000007)=1 print $X$ else print $1$ EXPLANATION:In this problem,you have to find $AND$ of $ANDs$ of the given array $A_i$.
This approach will give you $TLE$(Time limit exceed) because you are using two nested loop so time complexity will be $O(n^2)$.To reduce time complexity you have to use the property of $AND$
AND of same numbers will give you the same number i.e
$ Time$ $complexity $ : $O(n)$ AUTHOR'S, TESTER'S AND EDITORIALIST'S SOLUTIONS:Author's and editorialist’s solution can be found here. Tester's solution can be found here. Tags: ENCODING AOA dshahid380
This question is marked "community wiki".
asked 09 Oct, 10:37
