Initial commit
This commit is contained in:
commit
832cd997b3
28 changed files with 425 additions and 0 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
.DS_Store
|
||||
/build
|
||||
d*/.txt
|
||||
36
CMakeLists.txt
Normal file
36
CMakeLists.txt
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
cmake_minimum_required(VERSION 3.9)
|
||||
project(aoc24 LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
|
||||
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build)
|
||||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
|
||||
|
||||
set(CMAKE_CXX_COMPILER clang++)
|
||||
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
|
||||
endif()
|
||||
|
||||
set(executables d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 d21 d22 d23 d24 d25)
|
||||
|
||||
foreach(executable ${executables})
|
||||
file(GLOB_RECURSE sources ${executable}/*.cxx ${executable}/*.hxx)
|
||||
add_executable(${executable} ${sources})
|
||||
endforeach()
|
||||
|
||||
# For brute forcing
|
||||
find_package(OpenMP)
|
||||
if(OpenMP_CXX_FOUND)
|
||||
foreach(executable ${executables})
|
||||
target_link_libraries(${executable} PUBLIC OpenMP::OpenMP_CXX)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_CLANG_TIDY
|
||||
clang-tidy;
|
||||
-checks=*;
|
||||
-header-filter=.*;
|
||||
)
|
||||
11
README.md
Normal file
11
README.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# AOC 24
|
||||
|
||||
In C++
|
||||
|
||||
## Build
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
```
|
||||
15
d1/main.cxx
Normal file
15
d1/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d1/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d10/main.cxx
Normal file
15
d10/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d10/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d11/main.cxx
Normal file
15
d11/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d11/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d12/main.cxx
Normal file
15
d12/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d12/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d13/main.cxx
Normal file
15
d13/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d13/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d14/main.cxx
Normal file
15
d14/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d14/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d15/main.cxx
Normal file
15
d15/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d15/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d16/main.cxx
Normal file
15
d16/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d16/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d17/main.cxx
Normal file
15
d17/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d17/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d18/main.cxx
Normal file
15
d18/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d18/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d19/main.cxx
Normal file
15
d19/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d19/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d2/main.cxx
Normal file
15
d2/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d2/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d20/main.cxx
Normal file
15
d20/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d20/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d21/main.cxx
Normal file
15
d21/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d21/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d22/main.cxx
Normal file
15
d22/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d22/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d23/main.cxx
Normal file
15
d23/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d23/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d24/main.cxx
Normal file
15
d24/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d24/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d25/main.cxx
Normal file
15
d25/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d25/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d3/main.cxx
Normal file
15
d3/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d3/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d4/main.cxx
Normal file
15
d4/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d4/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d5/main.cxx
Normal file
15
d5/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d5/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d6/main.cxx
Normal file
15
d6/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d6/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d7/main.cxx
Normal file
15
d7/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d7/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d8/main.cxx
Normal file
15
d8/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d8/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
15
d9/main.cxx
Normal file
15
d9/main.cxx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using std::cout, std::endl;
|
||||
|
||||
int main() {
|
||||
std::ifstream file{"../d9/input.txt"};
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line)) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue