add: 220115-CN

This commit is contained in:
Lam Haoyin 2022-01-15 01:48:47 +08:00
parent fd09252584
commit a3abe6a924
No known key found for this signature in database
GPG Key ID: 8C089CB1A2B7544F
2 changed files with 14 additions and 1 deletions

13
2201/220115-CN.cpp Normal file
View File

@ -0,0 +1,13 @@
#include <iostream>
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;
}

View File

@ -3,4 +3,4 @@ PROJECT(2201)
SET(CMAKE_CXX_STANDARD 23) SET(CMAKE_CXX_STANDARD 23)
ADD_EXECUTABLE(2201 220114-CN.cpp) ADD_EXECUTABLE(2201 220115-CN.cpp)