https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=1&problemLevel=2&problemLevel=3&contestProbId=AXO72aaqPrcDFAXS&categoryId=AXO72aaqPrcDFAXS&categoryType=CODE&problemTitle=&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=3&pageSize=10&pageIndex=3

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

 

  • 1. 숫자의 맨 앞과 맨 뒤가 같은 수인지
  • 2. 제곱근 값이 int 형인지 (정수형)

 

import math 
t=int(input())
for tc in range(t):
    a,b = map(int,input().split())
    cnt = 0
    for i in range(a,b+1):
        rute = math.sqrt(i) //  i**(1/2)과 동일
        if rute ==int(rute):
            i = str(i)
            rute = str(int(rute))
            if i == i[::-1] and rute == rute[::-1]:
                cnt+=1
    print(f'#{tc+1} {cnt}')

 

 

📮개인 공부를 위한 공간으로 틀린 부분이 있을 수도 있습니다.📮

문제점 및 수정 사항이 있을 시, 언제든지 댓글로 피드백 주시기 바랍니다.

'algorithm > swea' 카테고리의 다른 글

[swea/python] #9997 #10032 #10059 #10505 #10200  (0) 2022.04.27