Skip to content

Instantly share code, notes, and snippets.

@joonas-yoon
Created September 5, 2018 03:39
BOJ 11508 - 크리보드
#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