Canadian Computing Competition: 2014 Stage 2, Day 1, Problem 1
Troy loves triangles. He especially likes counting triangles. He has an .
or #
characters. Help him count the number of triangles formed only by #
characters in the grid. Triangles are of the form
#
# ###
#, ###, #####, etc.
More formally, a triangle of height #
characters for
Input Specification
The first line contains the number
You can assume that for test cases worth 20% of the marks,
Output Specification
Output the number of triangles in the grid.
Sample Input
5
.....
.###.
.###.
#####
.....
Output for Sample Input
16
Explanation of Output for Sample Input
There are
Comments
https://dmoj.ca/problem/dwite12c5p3 ??!??!?!?!
N goes up to 2000 for this version, but 256 for the dwite version
Watch out for edge cases (literally)
badum tss