c++ solution
\nclass Solution {\npublic:\n    int dp[201][201];\n    int find(vector<vector<int>>&ss,vector<vector<int>>&ts,int day,int city,int n,int k){\n        if(day==k
```\nclass Solution {\npublic:\n    int dp[201][201];\n    int find(vector<vector<int>>&ss,vector<vector<int>>&ts,int day,int city,int n,int k){\n        if(day==k) return 0;\n        if(dp[day][city]!=-1) return dp[day][city];\n        int ans=ss[day][city]+find(ss,ts,day+1,city,n,k);\n        for(int i=0;i<n;i++){\n            if(i!=city){\n                ans=max(ans,ts[city][i]+find(ss,ts,day+1,i,n,k));\n            }\n        }\n        return dp[day][city]= ans;\n    }\n    int maxScore(int n, int k, vector<vector<int>>& ss, vector<vector<int>>& ts) {\n        int ans=0;\n        memset(dp,-1,sizeof(dp));\n        for(int i=0;i<n;i++){\n            ans=max(ans,find(ss,ts,0,i,n,k));\n        }\n        return ans;\n    }\n};\n```
[]