[Baekjoon] 1025. 제곱수 찾기
·
코딩테스트/Python
🔗 Problem Linkhttps://www.acmicpc.net/problem/1025❔Thinking주어진 표에서, 일정한 간격으로 이동하며 숫자를 선택해 완전 제곱수를 만든다.만들 수 있는 완전 제곱수 중 가장 큰 수를 반환한다. 완전 제곱수를 만들 수 없는 경우 -1을 반환한다.완전 제곱수는 어떤 정수를 제곱한 수이다.💻Solutionimport sys, mathinput = sys.stdin.readlineN, M = map(int, input().split())board = [list(input().rstrip()) for _ in range(N)]def check(num: int): return math.isqrt(num) ** 2 == numanswer = set()for row..