Home > other >  Blue cup special palindrome python
Blue cup special palindrome python

Time:02-24

 n=int (input ()) 
Temp=[]
For a in range (1, 1) :
A for b in the range (10) :
For c in range (10) :
If 2 * (a + b + c)==n:
Temp. Append (a + b + c * 1000 * 10000 * 100000 * 100 + c * 10 + a + b)
Elif 2 * (a + b) + c==n:
Temp. Append (a + b + c * 100 * 1000 * 10000 * 10 + a + b)
For I in sorted (temp) :
Print (I)


Why only 80 points out problems which this code

CodePudding user response:

What subject requirements

CodePudding user response:

CodePudding user response:

reference 1st floor chuifengde response:
what topic request
bosses I have pasted the topic request below

CodePudding user response:

In addition to a positive integers not up to par, the rest will be a problem, whether to add a abs

CodePudding user response:

Use cycle can think of is who, complexity is too high. My idea is that since it is symmetrical, with n=25 to explain, so the middle to the central is (0,8,9,8,0) , then gradually XiaoPing mountains, in the middle of the 9 "flow" :
 (0,8,9,8,0) 
(0,9,7,9,0)
(1,9,5,9,1)
(2,9,3,9,2)
(3,9,1,9,3)
and then the two 8 to outflow:
 (0,8,9,8,0) 
(1,7,9,7,1)
(2,6,9,6,2)
.
will eventually become the mountain basin (9,3,1,3,9). The word of six similar. Don't write code, don't know whether it is feasible.
  • Related