#include <iostream> using namespace std; #define endl '\n' const int N = 1e5 + 5; int n, dp[N] = {1, 1, 2}; signed main() { cin >> n; for (int i = 3; i <= n; i++) dp[i] = dp[i - 3] + i / 2 + 1; cout << dp[n]; return 0; }
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 追梦算法网 universal account