Sierpinski Triangle Problem

Revision en1, by tuna, 2015-11-14 15:28:03

I need help with this problem Triangles Problem Idea: The given input is N the level of the triangle, how can I calculate the number of all fragments(lines that contain one or more line segments in the triangle)? Do you have any ideas? I tried N!/2 but it is not efficient and probably incorrect becase 1<= N=2m < 64000.

Sample Input:

3 (number of tests)

1

2

4

Sample Output:

3

12

60

Tags triangles

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English tuna 2015-11-14 15:28:03 586 Initial revision (published)