BOJ - 2028 - 자기복제수

Updated:

import sys

def solution():
    T = int(input())
    for _ in range(T):
        number = int(sys.stdin.readline())
        powNumber = number * number

        if str(powNumber)[len(str(powNumber)) - len(str(number)) : ] == str(number): print("YES")
        else: print("NO")
solution()

https://www.acmicpc.net/problem/2028

Categories:

Updated:

Leave a comment