30,其他都是TLE
查看原帖
30,其他都是TLE
1200551
yuan2795楼主2024/10/24 13:25
#include<bits/stdc++.h>
#define int long long
using namespace std;
int q;
int a[200050];
long long b[3];


signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	cin>>q;
	for(int i=1;i<=q;i++)
	{
		cin>>a[i];
	}
	for(int i=1;i<=q;i++)
	{
		int k=b[1];
		for(int j=a[i-1]+1;j<=a[i];j++)
		{
			k+=(int)cbrt(j+0.5);
				
		}
		cout<<k<<endl;
		
		b[1]=k;
		
	}
	return 0;
}
2024/10/24 13:25
加载中...