Created
September 5, 2018 03:39
BOJ 11508 - 크리보드
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
typedef long long lld; | |
int main(){ | |
int n; | |
scanf("%d", &n); | |
lld dp[101]={}; | |
for(int i=1; i<=n; ++i){ | |
dp[i] = dp[i-1]+1; | |
for(int k=n-3; j>=0; --j){ | |
dp[n] = max(dp[n], dp[k] * (n-k-1)); | |
} | |
} | |
printf("%lld", dp[n]); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment