Блог пользователя Wmic.

Автор Wmic., история, 5 дней назад, По-английски

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

  • Проголосовать: нравится
  • +48
  • Проголосовать: не нравится

»
5 дней назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    5 дней назад, # ^ |
      Проголосовать: нравится +10 Проголосовать: не нравится

    thanks

»
5 дней назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится
»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    4 дня назад, # ^ |
      Проголосовать: нравится +10 Проголосовать: не нравится

    thanks

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

    • »
      »
      »
      4 дня назад, # ^ |
        Проголосовать: нравится +13 Проголосовать: не нравится

      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.