Logo
(追記) (追記ここまで)

22301번 - Palindrome Numbers 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB163584134.167%

문제

A word is considered a palindrome if it is the same when read left to right or right to left. For this problem, a positive integer is considered a palindrome if its base 10 (decimal) representation is the same from left to right as right to left. For each number, determine the smallest palindrome by value that is greater than or equal to that number. Unlike with Nascar car numbers, leading zeroes are insignificant and do not appear in any number in the input or output of this problem.

입력

The first line of input will contain the number of test cases, T (1 ≤ T ≤ 50). Each of the following T lines contains a positive integer N that is no more than 80 digits in length.

출력

The output of each test case will be a single line containing the smallest palindrome that is greater than or equal to the input number.

제한

예제 입력 1

2
42
321

예제 출력 1

44
323

힌트

출처

ICPC > Regionals > North America > South Central USA Regional > 2014 South Central USA Regional Programming Contest 5번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /