蒟蒻全WA,求助大佬。
  • 板块学术版
  • 楼主林螟空梦
  • 当前回复3
  • 已保存回复3
  • 发布时间2020/10/22 20:02
  • 上次更新2023/11/5 10:09:30
查看原帖
蒟蒻全WA,求助大佬。
350952
林螟空梦楼主2020/10/22 20:02
#include<bits/stdc++.h>
using namespace std;
char hh[1000],ll[1000],p[1000][1000];
int main(){
	int a,b;
	 scanf("%d%d", &a, &b);
	    for(int i=1;i<=a;i++){
		        for(int i=0;i<=b;i++){
			        for(int j=1;j<=b;j++){
			        p[j][i]=p[j-1][i];
			   	        if(i-hh[j]>=0){
			   	            if (p[j][i]<p[j-1][i-hh[j]]+ll[j])
                                p[j][i]=p[j-1][i-hh[j]]+ll[j];
				   }
			}
		}
	}
	cout<<p[b][a];
	return 0;
}
2020/10/22 20:02
加载中...