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

7746번 - Reverse numbers 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 32 MB5000.000%

문제

Lots of numbers have many interesting properties. In this task we will take a look at one such property. First let's define the reverse of a number: The reverse of a number N with decimal notation an...a1a0 is the number a0a1...an (i.e., the number obtained by writing the digits of N in reverse order). We will denote the reverse of a number N as Rev(N). For example Rev(123) = 321 and Rev(7400) = 47.

You will be given several natural numbers. For each of them your task will be to decide whether it is equal to N +Rev(N) for some natural number N.

입력

The input will consist of up to 10 001 lines. On each line there will be one positive number with less than 10 000 digits. The last line of the input file contains the number 0. This number should not be processed.

출력

For each number M in the input file the output shall contain one line with the word "YES" (if for some N we have M = N + Rev(N)) or "NO" (otherwise).

제한

예제 입력 1

1
2
11
13
14003
767513456469789456166547987979741366664879441
0

예제 출력 1

NO
YES
YES
NO
YES
NO

힌트

출처

Camp > Czech, Polish and Slovak Preparation Camp > CPSPC 2004 2-3번

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

출처

대학교 대회

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

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