1413 - CS I2P 2018 Lee HW3 Scoreboard

Time

2018/03/20 15:30:00 2018/06/25 00:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
9015 Palindrome
11133 String Reverse
11151 rectangle intersection
11533 Christmas tree

9015 - Palindrome   

Description

Palindrome is a string that is identical to its reverse, like "level" or "aba".  Check whether a given string is a palindrome or not.

Input

The input consists of multiple lines. Each line contains a string. The length of each string is less than 100000.  The number of test case is less than 1000.

Output

For each test case, output "Yes" if it's a palindrome or "No" if it's not a palindrome in a line.

Sample Input  Download

Sample Output  Download

Tags




Discuss




11133 - String Reverse   

Description

Given a string S, output the reverse of S.

Input

The input consists of many lines. Each line is a string S with length <= 1000.
The string does not contain any spaces.

Output

Output the the reverse of S. One in each line.

Print '\n' at the end of each line.

 

 

Sample Input  Download

Sample Output  Download

Tags




Discuss




11151 - rectangle intersection   

Description

According to Wikipedia,  the definition of rectangle is as follows: "In Euclidean plane geometry, a rectangle is a quadrilateral(四邊形) with four right angles(直角). It can also be defined as an equiangular quadrilateral, since equiangular means that all of its angles are equal (360°/4 = 90°)."

In this problem, you are asked to calculate the number of rectangle pairs that intersect to each other among a set of given rectangles.  All rectangles are located in a 2-dimensional euclidean space(二維空間), and all their edges are parallel to either the X- or the Y-axis.

Input

The first line contains one number N, where 2 <= N <= 128, standing for the number of given rectangles.

Each of the following N lines describes a rectangle and has 4 integers separated by space, representing

  1. the x coordinate of the bottom-left vertex
  2. the y coordinate of the bottom-left vertex
  3. the width (the length of the edge that is parallel to the x-axis), positive
  4. the height (the length of the edge that is parallel to the y-axis), positive

 Notice that each of the 4 numbers is representable by an int type in C language.

Output

The output should contain only one number, representing the number of rectangle pairs that intersect to each other.

Notice that if the area of overlapping part is zero, then the pair should NOT count.

Sample Input  Download

Sample Output  Download

Tags

Lee Homework



Discuss




11533 - Christmas tree   

Description

請印出聖誕樹

Input

會給3個數字level, width, height

level: 表示樹葉部份的層數,每層為上一層加2(e.g. 1 3 5 7 ...), 1 <= level <= 20

width: 表示樹木的寬度,寬度只會是奇數, 1 <= width <= 39

height: 表示樹木的高度,0 <= height <= 9

Output

請參考sample IO (可以載下來觀看),樹木的寬度可能會超過樹葉部份的寬度,請以最寬的部份為基準,碰在畫面最左邊(如果height是0,不影響畫的位置),樹木的中心點會剛好對應整棵樹的中心點(整棵樹左右會對稱)

每行最右邊的'*'號,請接換行符號('\n'),不要輸出多餘的符號如空白' '

sample IO共有4個例子,用'---'做區隔,實際的IO只會有三個數字,並且只需要輸出一次聖誕樹即可

 

Sample Input  Download

Sample Output  Download

Tags




Discuss