Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
67624 季洁 最小乘车费用 C++ Accepted 100 0 MS 336 KB 300 2023-01-14 17:45:39

Tests(7/7):


#include<bits/stdc++.h> using namespace std; int dp[30010],m,v[11],x; int main(){ for(int i=1;i<=10;i++) cin>>v[i]; cin>>x; for(int i=1;i<=x;i++) dp[i]=10000; for(int i=1;i<=10;i++){ for(int j=i;j<=10000;j++) if(j>=i) dp[j]=min(dp[j],dp[j-i]+v[i]); } cout<<dp[x]; return 0; }


Judgement Protocol: