Wmic.'s blog

By Wmic., history, 4 days ago, In English

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"?

  • Vote: I like it
  • +48
  • Vote: I do not like it

»
4 days ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

It may because you hacked std? This blog may help you. link

  • »
    »
    4 days ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    thanks

»
4 days ago, # |
  Vote: I like it +10 Vote: I do not like it
»
3 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Actually a correct solution on that test runs in just 4200 ms lol. We will fix it

  • »
    »
    3 days ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    thanks

    and do you have a better solution? it seems that the tutorial is slower than some participants' solution

    • »
      »
      »
      3 days ago, # ^ |
        Vote: I like it +13 Vote: I do not like it

      Ok it is fixed, so you can try to hack again. About our solution, it worked in 4100 ms on your test lol. I think doing the bruteforce for n <= bigger value produces around the same result in terms of complexity, but works better on all hack tests so far. Also the solution was coded 10 minutes before the round started, so it won't be surprising if gets hacked again. We just decided to fight against gpt and change the problem last moment.