|
@ -4,9 +4,11 @@ |
|
|
|
|
|
|
|
|
using namespace std; |
|
|
using namespace std; |
|
|
|
|
|
|
|
|
vector<array<unsigned, 2>> parse() |
|
|
typedef vector<array<unsigned, 2>> Input; |
|
|
|
|
|
|
|
|
|
|
|
Input parse() |
|
|
{ |
|
|
{ |
|
|
vector<array<unsigned, 2>> input; |
|
|
Input input; |
|
|
for (string line; getline(cin, line);) { |
|
|
for (string line; getline(cin, line);) { |
|
|
if (line.at(1) != ' ') throw "parse"; |
|
|
if (line.at(1) != ' ') throw "parse"; |
|
|
unsigned oppo = line.at(0) - 'A'; |
|
|
unsigned oppo = line.at(0) - 'A'; |
|
@ -17,7 +19,7 @@ vector<array<unsigned, 2>> parse() |
|
|
return input; |
|
|
return input; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
unsigned p1(vector<array<unsigned, 2>> &input) |
|
|
unsigned p1(Input &input) |
|
|
{ |
|
|
{ |
|
|
unsigned score = 0; |
|
|
unsigned score = 0; |
|
|
for (auto i : input) { |
|
|
for (auto i : input) { |
|
@ -28,7 +30,7 @@ unsigned p1(vector<array<unsigned, 2>> &input) |
|
|
return score; |
|
|
return score; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
unsigned p2(vector<array<unsigned, 2>> &input) |
|
|
unsigned p2(Input &input) |
|
|
{ |
|
|
{ |
|
|
unsigned score = 0; |
|
|
unsigned score = 0; |
|
|
for (auto i : input) { |
|
|
for (auto i : input) { |
|
|