mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
Partial day 06.
This commit is contained in:
1477
2019/inputs/06.txt
Normal file
1477
2019/inputs/06.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,20 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <regex>
|
||||||
#include "days.hpp"
|
#include "days.hpp"
|
||||||
|
|
||||||
void aoc2019::day06_part1(std::istream &input, std::ostream &output) {
|
void aoc2019::day06_part1(std::istream &input, std::ostream &output) {
|
||||||
|
std::string buffer;
|
||||||
|
std::regex regex("^([A-Z0-9]+)\\)([A-Z0-9]+)$");
|
||||||
|
|
||||||
|
while (std::getline(input, buffer)) {
|
||||||
|
std::smatch match_results;
|
||||||
|
|
||||||
|
if (!std::regex_match(buffer, match_results, regex)) {
|
||||||
|
std::string error = "Invalid line: ";
|
||||||
|
error += buffer;
|
||||||
|
throw std::domain_error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
output << "Not implemented\n";
|
output << "Not implemented\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
11
2019/tests/samples/06-1-1.in
Normal file
11
2019/tests/samples/06-1-1.in
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
COM)B
|
||||||
|
B)C
|
||||||
|
C)D
|
||||||
|
D)E
|
||||||
|
E)F
|
||||||
|
B)G
|
||||||
|
G)H
|
||||||
|
D)I
|
||||||
|
E)J
|
||||||
|
J)K
|
||||||
|
K)L
|
||||||
1
2019/tests/samples/06-1-1.out
Normal file
1
2019/tests/samples/06-1-1.out
Normal file
@@ -0,0 +1 @@
|
|||||||
|
42
|
||||||
Reference in New Issue
Block a user