Compare commits

..

No commits in common. "79ac732c393dda5297870ee2a7c2757559bcd966" and "129447d88f9de471cd0f19b50b2c8712f19b8571" have entirely different histories.

2 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ int main() {
char throwaway; char throwaway;
std::vector<Data> v; std::vector<Data> v;
while (file >> line.min >> throwaway >> line.max) { while (file >> line.min >> throwaway >> line.max) {
v.emplace_back(line); v.push_back(line);
file >> throwaway; file >> throwaway;
} }
std::cout << "Part 1: " << part_1(v) << std::endl; std::cout << "Part 1: " << part_1(v) << std::endl;
@ -67,7 +67,7 @@ int64_t part_2(const std::vector<Data> &v) {
} }
} }
// todo: dead code, delete me, then inline solve_n // todo: dead code, delete me
int64_t foobar = std::accumulate(v.begin(), v.end(), 0, [&ans](int64_t acc, Data d) { int64_t foobar = std::accumulate(v.begin(), v.end(), 0, [&ans](int64_t acc, Data d) {
for (auto n{d.min}; n <= d.max; ++n) { for (auto n{d.min}; n <= d.max; ++n) {
acc += solve_n(n); acc += solve_n(n);

View File

@ -12,7 +12,7 @@ int main() {
std::string line; std::string line;
std::vector<std::string> v; std::vector<std::string> v;
while (std::getline(file, line)) { while (std::getline(file, line)) {
v.emplace_back(line); v.push_back(line);
} }
std::cout << "Part 1: " << part_1(v) << std::endl; std::cout << "Part 1: " << part_1(v) << std::endl;
std::cout << "Part 2: " << part_2(v) << std::endl; std::cout << "Part 2: " << part_2(v) << std::endl;