2005D std get TLE

Revision en2, by Wmic., 2024-09-15 04:48:37

by using this generator

#include<bits/stdc++.h>
using namespace std;
int t=16129,n=31;
// int t=5,n=100000
int w1=30360,w2=994593600;
// int w1=994593600,w2=994593600
vector<int> d;
void divi(int n)
{
	for(int i=1;i*i<=n;i++)
	{
		if(n%i==0)
		{
			d.emplace_back(i);
			if(i*i!=n) d.emplace_back(n/i);
		}
	}
}
int main()
{
	// freopen("test.in","w",stdout);
	cout<<t<<"\n";
	divi(w2);
	int p=0;
	while(t--)
	{
		cout<<n<<"\n";
		// w1=d[p];
		// p=(p+1)%d.size();
		for(int i=1;i<=n;i++)
		{
			if(i!=1) cout<<w1;
			else cout<<w2;
			if(i!=n) cout<<" ";
		}
		cout<<"\n";
		for(int i=1;i<=n;i++)
		{
			if(i!=1) cout<<w1;
			else cout<<w2;
			if(i!=n) cout<<" ";
		}
		cout<<"\n";
	}
}

the code in Tutorial will be TLE(it runs 6s)

And why using hacks by this generator i get "Unexpected verdict"?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Wmic. 2024-09-15 04:48:37 2 Tiny change: 'enerator\n~~~~~\n#' -> 'enerator\n\n~~~~~\n#'
en1 English Wmic. 2024-09-15 04:48:21 881 Initial revision (published)