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

16326번 - Numbers 다국어

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

문제

A palindrome is an integer which reads the same backward as forward. For example, numbers 142241 and 102201 are palindromes, but 1023401 and 10510 — no. You want to represent a number n as the sum of two palindromes. Find the number of ways to do it.

입력

There is only one line containing the integer n (1 ≤ n ≤ 1018).

출력

Output one number — the number of ways to represent the number n as the sum of two palindromes.

제한

예제 입력 1

156

예제 출력 1

4

예제 입력 2

9524

예제 출력 2

4

예제 입력 3

42657

예제 출력 3

6

예제 입력 4

5735832847451

예제 출력 4

28

힌트

In the first test, the following pairs of numbers are suitable: (5, 151), (55, 101), (101, 55), (151, 5).

In the second test, the following pairs of numbers are suitable: (515, 9009), (636, 8888), (8888, 636), (9009, 515).

In the third test, the following pairs of numbers are suitable: (33, 42624), (333, 42324), (4884, 37773), (37773, 4884), (42324, 333), (42624, 33).

출처

ICPC > Regionals > Europe > Southeastern European Regional Contest > SEERC 2018 A번

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

출처

대학교 대회

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

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