Solution written by @Brifuture.
Best score: 2.8s online
/ 4.1s offline
(my laptop: intel 8250U, 8G memory).
Change definitions in definitions.h
to deploy different configuration.
Dataset could be downloaded from github repo.
Download this repo and move test_data_*.txt
into the build directory of CMakeProject (If you build without CMake, the program will try to find data file in /data/test_data.txt
).
Change DataInputFile
in definitions.h
with the actual filename which contains the data you downloaded.
Download PThread.7z
from Tag-hw2020swc, then extracted it into directory like D:/software
.
CMake is used to generate project based on MSVC/gcc. If PThread is installed into location other than D:/software/pthread
, you have to change target_include_directories
and target_link_libraries
in the file CMakeLists.txt
.
Note: pthread.dll wont be found when running the project. You can add it into path by either of the following:
- Add pthread dll location into PATH.
- Open VistualStudio click project
Main
properties, ChooseDebug
tag, setPATH=%PATH%D:\software\pthread\dll\x64;
in the environment variables.
In the shell terminal, type ./run.sh
without CMake, type ./runcmake.sh
to build project with CMake.
See main.cpp
to get more details.