我这个题,这个代码为啥TLE啊?

题目
TLE92pts(只错了一个样例)代码:

#include<bits/stdc++.h>
using namespace std;
int a[10];
bool vis[1005];
int cnt;

int main(){
	for(int i=1;i<=6;i++){
		cin>>a[i];
	}
	cout<<"Total=";
	for(int x=0;x<=a[1];x++){
		int ans=0;
		ans+=(x);
		for(int b=0;b<=a[2];b++){
			ans+=(b*2);
			for(int c=0;c<=a[3];c++){
				ans+=(c*3);
				for(int d=0;d<=a[4];d++){
					ans+=(d*5);
					for(int e=0;e<=a[5];e++){
						ans+=(e*10);
						for(int f=0;f<=a[6];f++){
							ans+=(f*20);
							if(!ans){
								continue;
							}
							if(vis[ans]){
								continue;
							}
							vis[ans]=1;
							cnt++;
						}
					}
				}
			}
		}
	}
	cout<<cnt;
	return 0;
}
/*
0 1 2 3 4 5 6 7 8 9
6 2 5 5 4 5 6 3 7 6

*/

deepseek回答:


我寻思着这复杂度也妹超啊?

那是砝码数量的最大乘积,你的循环范围是 [0,a_i] ,它算的是 [1,a_i] 的乘积,能一样吗?