mirror of
https://gitlab.com/mfocko/Codeforces.git
synced 2024-11-09 13:49:06 +01:00
chore(cpp): adjust skeleton and makefile
Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
parent
13413ad429
commit
5013af5dcb
2 changed files with 33 additions and 2 deletions
|
@ -1,8 +1,10 @@
|
||||||
CXX=clang++
|
CXX=clang++
|
||||||
CXXFLAGS=-std=c++20 -Wall -Wextra
|
CXXFLAGS=-std=c++20 -Wall -Wextra
|
||||||
|
|
||||||
catch2.o: ../.common/catch_amalgamated.cpp ../.common/catch_amalgamated.hpp
|
COMMON_PATH=../.common/cpp
|
||||||
$(CXX) $(CXXFLAGS) -g -c ../.common/catch_amalgamated.cpp -o catch2.o
|
|
||||||
|
catch2.o: $(COMMON_PATH)/catch_amalgamated.cpp $(COMMON_PATH)/catch_amalgamated.hpp
|
||||||
|
$(CXX) $(CXXFLAGS) -g -c $(COMMON_PATH)/catch_amalgamated.cpp -o catch2.o
|
||||||
|
|
||||||
%: catch2.o %.cpp
|
%: catch2.o %.cpp
|
||||||
$(CXX) $(CXXFLAGS) -DTEST -g $^ -o $@
|
$(CXX) $(CXXFLAGS) -DTEST -g $^ -o $@
|
||||||
|
|
|
@ -8,7 +8,36 @@ void solve() {
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
// for single test case, comment out for ‹N› test cases
|
||||||
|
#define SINGLE
|
||||||
|
|
||||||
|
#ifndef TEST
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
|
|
||||||
|
#ifdef SINGLE
|
||||||
|
|
||||||
solve();
|
solve();
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
// for multiple test cases
|
||||||
|
int N;
|
||||||
|
std::cin >> N >> std::ws;
|
||||||
|
|
||||||
|
for (auto i = 0; i < N; ++i) {
|
||||||
|
solve();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#include "../.common/cpp/catch_amalgamated.hpp"
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in a new issue