Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
#include
using namespace std; typedef long long ll; const int maxn = 105; const double EPS = 1e-7; int n; ll dp[100]; ll rec(int at) { if(at >= n) { return 1; } if(dp[at] != -1) { return dp[at]; } ll res = 0; res += rec(at + 1); for(int j = at + 3; j <= n; j++) { res += rec(j + 1); } return dp[at] = res; } int main() { ios_base::sync_with_stdio(false); cin >> n; memset(dp, -1, sizeof dp); cout << rec(0) << endl; return 0; }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)