ShaoNianTongXue5307's blog

By ShaoNianTongXue5307, history, 13 months ago, In English

I find a lot of people do not know that, I think I need to introduce a technique to get the test after 1000 line (or 10000 line).

Note, it's not a troll blog.

First, pass the sample in some way, you can just check the test number and output it, as an example, this problem, we can write such code.

#include<bits/stdc++.h>.
int main() { return
    int testcase;
    std::cin >> testcase;
    if (testcase == 3) {
        std::cout << 7 << std::endl << 10 << std::endl << 9;
        return 0;
    }
}

Now, let's say you have (WA on 2 — WA on line 69) before. So you want to get the 69th test case, which is hidden because it's too far back.

You can use something like this code to see it

Now it's easy to see that the 69th test is 91 25 68.

Harshit25

Full text and comments »

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

By ShaoNianTongXue5307, 15 months ago, In English

They spend a lot of time preparing for the contest, and you only waste two hours, which is insignificant

I forget what else to say, anyone please remind me.

Full text and comments »

  • Vote: I like it
  • -25
  • Vote: I do not like it

By ShaoNianTongXue5307, history, 19 months ago, In English

Codeforces should be about the player's ability to code, data Structures and algorithms, not the ability to play the genshin's mini-game.

Full text and comments »

  • Vote: I like it
  • -66
  • Vote: I do not like it

By ShaoNianTongXue5307, 20 months ago, In English

2 . Right click on any Latex and it will provide a settings interface.

3 . Enter Math settings → Math renderer option

5 . Try each option until it displays normally.

7 . If it still doesn't work, try close Accessibility → Assistive MathML

11 . Don't forget to thank me :P

Full text and comments »

  • Vote: I like it
  • -4
  • Vote: I do not like it

By ShaoNianTongXue5307, history, 20 months ago, In English

Today is jiangli back to Rank1 day, life's sweet and sour, recorded the trajectory of fate, the trajectory left your shadow, Rank1 came, sent you the most sincere wishes, sincerely wish you great fortune, smooth. Only people who respect themselves can be more courageous to shrink themselves, by backing off to make others whole, either foolish or wise. Dream what you want to dream, do what you want to do, because life only comes once, the opportunity will not come again. Life is short, why do we need to be concerned about gains and losses, there is love and there is a dream. Everyone has a different experience, everyone is a fresh story. Know how to cherish, the day of the storm, there is he has me also have you.

Full text and comments »

  • Vote: I like it
  • -31
  • Vote: I do not like it

By ShaoNianTongXue5307, 21 month(s) ago, In English

https://mirror.codeforces.com/ratings/country/North%20Korea/city/Pyongyang

People like RGB_ICPC use a whole $$$\Huge\text{ten}$$$ alt to take away ratings that belong to others, which is the real cause of rating deflation.

Full text and comments »

  • Vote: I like it
  • -68
  • Vote: I do not like it

By ShaoNianTongXue5307, history, 21 month(s) ago, In English

I know I'm having discriminated against, please don't give me a downvote, at least read the entire blog completely first.

Everyone knows that the priority queue for C++ is log n, but this is very slow, so we hope to optimize it.

Some people believe that using vjudgian theorem can help you optimize to $$$O(-1)$$$. But this is wrong. The definition of complexity is $$$O(f(x))$$$ representation, and you can find an $$$f(x)$$$ and two cons

tants $$$c_1,c_2$$$ with true run time $$$g(x)$$$ such that $$$\text{lim}_{x→\infty}\text{ }c_1f(x)\le g(x)\le c_2f(x)$$$. So essentially $$$O(-1)=O(1)$$$. The Vjudgian theorem is very difficult and cannot be run on Codeforces testers, so I won't introduce this.

Let me present a method that can be run in Codeforecs and that can be easily coded by tourist and benq. First, go offline for the first time. Offline means that you can know in advance what all operations are and give the results of all queries at the last time. For priority queues, we believe that there are two operations: (inserting a number) and (accessing and popping a minimum).

For these two operations, we will convert them into a sequence, use — 1 for pop-up operations, and use the inserted integer for insert operations. For example, for $$$[11,12,-1,3,-1]$$$, we insert $$$11$$$, insert $$$12$$$, pop up a number, insert $$$3$$$, and pop up a number. Because this is offl

ine, we can handle this in any way we like. First, we will access all non $$$-1$$$ numbers from small to large. Any smart person knows how to do this within $$$O(n)$$$ using cardinality sorting.

Subsequently, for each accessed number, we find the $$$-1$$$ closest to it and on the right, and delete this $$$-1$$$. We can easily do this by using and searching the set.

But this is still not $$$O(n)$$$, but $$$O(nα(n))$$$ As a patient with obsessive compulsive disorder, I can't stand this.

So I took the dsu operation offline again. Create a graph that treats each dsu merge operation as an edge, and the edge weight is the order in which the operation is executed. Then perform a minimum spanning tree on the graph (Klein P N, Tarjan R E. A Randomized Linear Time Algorithm for Finding Minimum Sp

anning Trees [M]. Brown University, 1993).

Then only the edges on the minimum spanning tree is valuable, and then you discover that you can solve it using four Russian algorithms.

OMG $$$O(n)$$$ heap!!!!!!!!1

Full text and comments »

  • Vote: I like it
  • -64
  • Vote: I do not like it

By ShaoNianTongXue5307, 21 month(s) ago, In English

https://www.spoj.com/problems/BALIFE/

Because I'm not smart enough, so I don't know how to use Google.

Give me all the code, just like feeding.

Full text and comments »

  • Vote: I like it
  • -68
  • Vote: I do not like it

By ShaoNianTongXue5307, history, 22 months ago, In English

Why do you need so many red and orange handles to test a div2? Do you guys really think they can give a valid opinion? You need more newbie,pupil,spclst !!!!! I couldn't even make Div2 D for this contest, I just sat there and couldn't do anything, it was really boring !!!!!!!

Full text and comments »

  • Vote: I like it
  • -23
  • Vote: I do not like it

By ShaoNianTongXue5307, history, 22 months ago, In English

https://mirror.codeforces.com/blog/entry/113075

today i read this blog and found a very useful trick i will introduce it to such interval problems consider constructing a cartesian coordinate system for an interval $$$[x,y]$$$ and mapping it to the point $$$(x,y)$$$ for the query operation stated in the blog given $$$(l,r)$$$ translate to coordinate points is to ask how many points there are in a certain rectangle then the problem was transformed into a simple one then lets say mos algo put each $$$[l,r]$$$ on the axis then the problem becomes that you can go up down left right and ask for the minimum number of times to traverse all the points so that you can understand mo more intuitively lets take another example of a topic i encountered while talking with my friend my friend asked there is an array that supports swapping two numbers and querying the number of inverse pairs my friend wants to know if there is anything below $$$O(n\log^2n)$$$ just put $$$(i,a_i)$$$ to the coordinate points then the problem becomes to support modifying the coordinates of a point and querying the number of points inside a rectangle it is impossible to go below $$$O(n\log^2n)$$$ you can see that this trick is very helpful to think about the problem try using this method of thinking when you encounter problems with interval bounded comparisons

I hope you enjoy my blog!!!

Full text and comments »

  • Vote: I like it
  • -14
  • Vote: I do not like it

By ShaoNianTongXue5307, history, 22 months ago, In English

If you think the editorial or your own solution is too complex, you can find the simplest submission record of this question through Solution Size, Many people don't know this.

For example, we can find a code that last div1 C without segment tree

https://mirror.codeforces.com/contest/1785/status?order=BY_PROGRAM_LENGTH_ASC

I hope you like my blog and subscribe to my channel.

Full text and comments »

  • Vote: I like it
  • -30
  • Vote: I do not like it