F - Zero or One Editorial by shadow9


Check all values of \(b \in [2,1000]\). Now for any \(b > 1000\) , \(N\) can have at most 7 digits in base \(b\). Use bitmasking to iterate over all possible masks and find the appropriate \(b\) using binary search.

Submission - https://atcoder.jp/contests/abc293/submissions/39648391

posted:
last update: