题解 | #自守数#
自守数
https://www.nowcoder.com/practice/88ddd31618f04514ae3a689e83f3ab8e
n=int(input()) def check(n): ns=str(n) nns=str(n*n) if int(nns[len(nns)-len(ns):])==n: return 1 else: return 0 ans=0 for i in range(n+1): if check(i): ans+=1 print(ans)