|
@ -21,7 +21,7 @@ Input parse() |
|
|
unsigned p1(const Input &trees) |
|
|
unsigned p1(const Input &trees) |
|
|
{ |
|
|
{ |
|
|
int height = trees.size(); |
|
|
int height = trees.size(); |
|
|
int width = trees[0].size(); |
|
|
int width = trees.front().size(); |
|
|
|
|
|
|
|
|
// C++ is nice except when it isn't
|
|
|
// C++ is nice except when it isn't
|
|
|
bool (*vis)[width] = (bool (*)[width])new bool[width * height]; |
|
|
bool (*vis)[width] = (bool (*)[width])new bool[width * height]; |
|
@ -78,7 +78,7 @@ unsigned p1(const Input &trees) |
|
|
unsigned p2(const Input &trees) |
|
|
unsigned p2(const Input &trees) |
|
|
{ |
|
|
{ |
|
|
int height = trees.size(); |
|
|
int height = trees.size(); |
|
|
int width = trees[0].size(); |
|
|
int width = trees.front().size(); |
|
|
|
|
|
|
|
|
unsigned score = 0; |
|
|
unsigned score = 0; |
|
|
for (int y = 1; y < height - 1; y++) { |
|
|
for (int y = 1; y < height - 1; y++) { |
|
|