求助!运行时错误
查看原帖
求助!运行时错误
1042497
1313113lmx楼主2023/12/25 19:13
#include<bits/stdc++.h>
using namespace std;

int main(){
	long long w,f[1000001],cost;
	cin>>w;
	for(long long i=1;i<=w;i++){
		cost=LONG_MAX;
		if(i-1>=0)cost=min(cost,f[i-1]+1);
		if(i-5>=0)cost=min(cost,f[i-5]+1);
		if(i-11>=0)cost=min(cost,f[i-11]+1);
		f[i]=cost;
	}
	cout<<f[w];
    return 0;
}

2023/12/25 19:13
加载中...