From a3abe6a92467e3f37da279bfa37789453d8fbd03 Mon Sep 17 00:00:00 2001 From: Lam Haoyin Date: Sat, 15 Jan 2022 01:48:47 +0800 Subject: [PATCH] add: 220115-CN --- 2201/220115-CN.cpp | 13 +++++++++++++ 2201/CMakeLists.txt | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 2201/220115-CN.cpp 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