diff --git a/2201/220115-CN.cpp b/2201/220115-CN.cpp new file mode 100644 index 0000000..2f90b01 --- /dev/null +++ b/2201/220115-CN.cpp @@ -0,0 +1,13 @@ +#include + +class Solution { +public: + static auto totalMoney(auto n) { + return (28 + n % 7) * (n / 7) + (n / 7) * (n / 7 - 1) / 2 * 7 + (1 + n % 7) * (n % 7) / 2; + } +}; + +int main() { + std::cout << Solution::totalMoney(20); + return 0; +} \ No newline at end of file diff --git a/2201/CMakeLists.txt b/2201/CMakeLists.txt index 27aa1d8..7afa65b 100644 --- a/2201/CMakeLists.txt +++ b/2201/CMakeLists.txt @@ -3,4 +3,4 @@ PROJECT(2201) SET(CMAKE_CXX_STANDARD 23) -ADD_EXECUTABLE(2201 220114-CN.cpp) \ No newline at end of file +ADD_EXECUTABLE(2201 220115-CN.cpp) \ No newline at end of file