[作業] 計程單班Homework「Double palindrome」
有強者能分享一下大略的思考或解題方向嗎??
想了很久還是不知道該從哪裡下手才好= =+
題目附在下面
雙班的強者也可以看看XD
--
Double palindrome
We define a palindrome as a sequence of at least one integer that reads the
same either forward or backward. For example "1 3 5 3 1" and "1 2 2 1" are
both palindromes. To the extreme case "1" is also a palindrome.
We also define a double palindrome as the concatenation of two palindromes.
For example "1 3 5 3 1 1 2 2 1" is a double palindrome. To the extreme case
"1 3 5 3 1 1" is also a double palindromes.
Now given a sequence of at least two integers, please find the longest double
palindrome. If there are multiple longest double palindromes, print the one
that appears last.
The number of intergers in the given sequence is no more than 100.
Sample Input
7 1 3 5 3 1 1
Sample Output
1 3 5 3 1 1
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.167.184.2
推
09/29 00:20, , 1F
09/29 00:20, 1F
推
09/29 01:18, , 2F
09/29 01:18, 2F
→
09/29 01:21, , 3F
09/29 01:21, 3F
→
09/29 01:23, , 4F
09/29 01:23, 4F
→
09/29 01:27, , 5F
09/29 01:27, 5F
→
09/29 01:27, , 6F
09/29 01:27, 6F
※ 編輯: rod24574575 來自: 218.167.184.2 (09/29 03:10)
→
09/29 03:11, , 7F
09/29 03:11, 7F
→
09/29 16:08, , 8F
09/29 16:08, 8F
推
09/29 18:58, , 9F
09/29 18:58, 9F
推
09/29 20:15, , 10F
09/29 20:15, 10F
→
09/29 20:15, , 11F
09/29 20:15, 11F
→
09/29 20:56, , 12F
09/29 20:56, 12F
推
09/29 20:59, , 13F
09/29 20:59, 13F
→
09/29 21:01, , 14F
09/29 21:01, 14F
→
09/29 21:04, , 15F
09/29 21:04, 15F
→
09/29 21:06, , 16F
09/29 21:06, 16F
推
09/29 21:09, , 17F
09/29 21:09, 17F
→
09/29 21:12, , 18F
09/29 21:12, 18F
→
09/29 21:15, , 19F
09/29 21:15, 19F
推
09/29 22:38, , 20F
09/29 22:38, 20F
→
09/30 15:46, , 21F
09/30 15:46, 21F
推
09/30 19:11, , 22F
09/30 19:11, 22F
推
09/30 21:27, , 23F
09/30 21:27, 23F
推
09/30 23:35, , 24F
09/30 23:35, 24F
推
10/01 01:02, , 25F
10/01 01:02, 25F
→
10/01 01:06, , 26F
10/01 01:06, 26F
推
10/01 01:07, , 27F
10/01 01:07, 27F
→
10/01 01:17, , 28F
10/01 01:17, 28F
推
10/01 09:00, , 29F
10/01 09:00, 29F
→
10/01 09:00, , 30F
10/01 09:00, 30F
→
10/01 09:02, , 31F
10/01 09:02, 31F
→
10/01 09:02, , 32F
10/01 09:02, 32F
討論串 (同標題文章)