Palindrome 썸네일형 리스트형 Problem 36 - Find the sum of all numbers less than one million, which are palindromic in base 10 and base 2. 링크 The decimal number, 585 = 10010010012 (binary), is palindromic in both bases. Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2. (Please note that the palindromic number, in either base, may not include leading zeros.) python def binary(n): res = '' while n > 0: res += str(n % 2) n /= 2 return res def palindrom(k): b = binary(k) rb = b[::-1] retur.. 더보기 Problem 4 - Find the largest palindrome made from the product of two 3-digit numbers. 링크 A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99. Find the largest palindrome made from the product of two 3-digit numbers. python ans = 0 for i in range(100, 1000): for j in range(i, 1000): n = i * j sn = str(n) if sn == sn[::-1] and n > ans: ans = n print ans python - 1 line print max([x*y for x in range(900,1.. 더보기 Palindrome Numbers http://acm.pku.edu.cn/JudgeOnline/problem?id=2402 Description A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, the name "anna" is a palindrome. Numbers can also be palindromes (e.g. 151 or 753357). Additionally numbers can of course be ordered in size. The first few palindrome numbers are: 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, ... The number 10 i.. 더보기 이전 1 다음