/* length of string * alphabet size DP dp[x][y]:= At index x, what is the mincost to get to alphabet y? */ #include #include using namespace std; typedef long long ll; template inline bool chkmax(T &a, T b) { return a < b ? a = b, true : false; } template inline bool chkmin(T &a, T b) { return a > b ? a = b, true : false; } const ll mn=54; string s; ll f[mn][mn]; int main() { cin>>s; ll n=s.size(); for (ll y=0;y<=26;y++) f[0][y]=y; for (ll x=0;x