TLE 0pts求调 玄关
  • 板块灌水区
  • 楼主Lastheart
  • 当前回复26
  • 已保存回复26
  • 发布时间2024/12/26 20:10
  • 上次更新2024/12/27 13:39:55
查看原帖
TLE 0pts求调 玄关
979476
Lastheart楼主2024/12/26 20:10

https://cdn.luogu.com.cn/upload/image_hosting/vlpqs50u.png

#include<bits/stdc++.h>
using namespace std;
typedef __int128 intpro;
int in()
{
    int k=0,f=1;
    char c=getchar();
    while(c<'0'||c>'9')
    {
        if(c=='-')f=-1;
        c=getchar();
    }
    while(c>='0'&&c<='9')k=k*10+c-'0',c=getchar();
    return k*f;
}
void out(intpro x)
{
    if(x<0) putchar('-'),x=-x;
    if(x<10) putchar(x+'0');
    else out(x/10),putchar(x%10+'0');
}
intpro fun(int n)
{
	intpro mx=0;
	for(intpro i=1;i<n-1;i++)
	{
		for(intpro j=1;j<n-i;j++)
		{
			int h=n-i-j;
			if(h>0)
			{
				intpro tot=i*j*h;
				if(tot>mx) mx=tot;
			}
		}
	}
	return mx;
}
signed main()
{
	int t=in();
	while(t--)
	{
		int n=in();
		intpro x=fun(n);
		out(fun(x));
		cout<<"\n";
	}
}
2024/12/26 20:10
加载中...