|
|
Pro3979 篮球 题解
×
dfs意义:从x过来的最小值
记忆化dfs定义f数组存储结果
//dfs函数
long long int dfs(int x,int lwalk,int rwalk)
{
if(f[x][lwalk][rwalk]!=0x7f7f7f7f7f7f7f7f) return f[x][lwalk][rwalk];
if(x==0) return f[x][lwalk][rwalk]=0;
if(lwalk==0&&rwalk==0&&mp[b[x]]) return f[x][lwalk][rwalk]=min(min(min(min(dfs(x-1,0,0),dfs(x-1,1,0)),dfs(x-1,2,0)),dfs(x-1,0,1)),dfs(x-1,0,2));
else if(lwalk==0&&rwalk==1) return f[x][lwalk][rwalk]=min(min(dfs(x-1,1,0)+r[x],dfs(x-1,2,0)+r[x]),dfs(x-1,0,0)+r[x]);
else提示!该题解未通过审核,建议分享者本着启发他人,照亮自己的初衷以图文并茂形式完善之,请勿粘贴代码。........................................................................ 该题解等待再次审核........................................................................(剩余 492 个中英字符)
题目3979 篮球
AAAAAAAAAAAAAAAAAAAA
2024-06-22 03:56:21
|
|
|
Pro3979 篮球 题解
×
#include<bits/stdc++.h> using namespace std; int main() { freopen("split.in","r",stdin); freopen("split.out","w",stdout); int a,i=2; cin>>a; &n提示!该题解未通过审核,建议分享者本着启发他人,照亮自己的初衷以图文并茂形式完善之,请勿粘贴代码。........................................................................ 该题解等待再次审核........................................................................(剩余 568 个中英字符)
题目3979 篮球
2024-05-28 20:36:09
|