Skip to content

Instantly share code, notes, and snippets.

@asuka-mirai
Created September 14, 2017 13:31
Show Gist options
  • Save asuka-mirai/de73e34f7e571ad84cee47b20139dc8c to your computer and use it in GitHub Desktop.
Save asuka-mirai/de73e34f7e571ad84cee47b20139dc8c to your computer and use it in GitHub Desktop.
import math
def order(A, B):
ord_A = int(math.log10(A) + 1)
ord_B = int(math.log10(B) + 1)
return max(ord_A, ord_B)
def solve():
N = int(input())
d = 10**12
i = 1
while i**2 <= N:
if N % i == 0:
d = min(d, order(i, N//i))
i += 1
print(d)
if __name__ == '__main__':
solve()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment