#177. 数字处理与筛选

    ID: 177 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatFunctional-2gesp1循环结构条件结构

数字处理与筛选

Number Processing and Filtering

Background

Congcong is playing a number game. He has a list of integers and needs to perform a series of operations on each number in the list, then filter the final results according to specific rules.

Problem Description

Given a list of integers, return a new list. Each number in the new list is the square of the corresponding number from the original list plus 1010. Additionally, any resulting numbers that end in 55 or 66 should be omitted.

Input Format

Input is given from standard input in the following format.

A list of integers, with integers separated by spaces and enclosed in square brackets [].

Output Format

Output should be printed to standard output in the following format.

A list of processed and filtered integers, with integers separated by a comma and space , and enclosed in square brackets [].

Sample

[3 1 4]
[19, 11]
[1]
[11]
[2]
[14]

Sample Explanation

Sample 1: For input [3 1 4]:

  • For 33: 32+10=9+10=193^2 + 10 = 9 + 10 = 19. 1919 does not end in 55 or 66, keep.
  • For 11: 12+10=1+10=111^2 + 10 = 1 + 10 = 11. 1111 does not end in 55 or 66, keep.
  • For 44: 42+10=16+10=264^2 + 10 = 16 + 10 = 26. 2626 ends in 66, omit. Final result is [19, 11].

Sample 2: For input [1]:

  • For 11: 12+10=1+10=111^2 + 10 = 1 + 10 = 11. 1111 does not end in 55 or 66, keep. Final result is [11].

Sample 3: For input [2]:

  • For 22: 22+10=4+10=142^2 + 10 = 4 + 10 = 14. 1414 does not end in 55 or 66, keep. Final result is [14].

Constraints

Time limit for each test case is 11 second, and memory limit is 10241024 KiB.