Advertisement
CyberN00b

Untitled

Sep 25th, 2021
909
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. num = int(input())
  2. if num == 1:
  3.     print(1)
  4. else:
  5.     num -= 1
  6.     ab = 10
  7.     l =1
  8.     n = 2
  9.     while num > 0:
  10.         if num > l:
  11.             num -= l
  12.             n += 1
  13.             t = n ** 2
  14.             while ab < t:
  15.                 ab *= 10
  16.                 l += 1
  17.         else:
  18.             res = 0
  19.             t = n ** 2
  20.             for i in range(l - num + 1):
  21.                 res = t % 10
  22.                 t //= 10
  23.             break
  24.     print(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement