pikamonstruosa's blog

By pikamonstruosa, history, 2 weeks ago, In English

Last week (02/12 — 07/12) the North Macedonia TST for EJOI, EGOI and IOI took place in the Univerzitet Sv. Kiril i Metódij, where we were hosted by professor Biljana Angelova. The teams were selected based on contestants results on four different contests. There also were several classes on different common competitive programming topics, like FFT, Li Chao Tree, and 3D Convex Hull presented by ReaLNero and forelax. The contest were IOI-like, each lasting around 12 hours, with no breaks, in order to prepare contestants to adverse testing conditions. (Just kidding, they were standard 5 hours contests)

Day 0

On the first day, we didn't have any tests, since everyone was just arriving. However, we had to move to another hotel, since a particular group of people were making too much noise and got us banned from the hotel. (They were watching Sausage Party 2 and laughing too much with it. Highly recommend this awesome movie btw).

Watching the movie:

Getting evicted:

Day 1

This was the first day with contest. Many unexpected things happened this day during the contest. Deide Costa, who got 13th place on the national olympiad, surprisingly managed to snag a 5th place during the first day, and Thomas Turbano, who got first place on the national olympiad, fell down to 6th place. The first four contestants were not unexpected, since me, Sujiro Kimimame, and Paula Tejano went to IOI in 2024, and Ku Shai Shang and Shota Nakama were highly rated in the national test.

First day results:

After the contest, we got together in Deide's room, in the new hotel, and once again we almost got banned. This day, one of the contest setters and one of the teachers went to Deide's room and were shouting at each other very loudly, and the chief organizer of the TST scolded us because other guests at the hotel were complaining about the noise. We didn't get banned this time though.

Day 2

On this contest, Thomas (the one who was first in the national olympiad), thought one of the problems in the contest was harder than it really was, and sadly fell down to 12th place. Ku Shai also managed to get first place by scoring ~12 points more than the others in IOI range. But these two events are far outshined by the three participants who were caught cheating and were penalized with -50 points on one of the problems. They were caught discussing the problems in a toilet stall. Some contestants, including me, thought the punishment was too light, but there was little we could do and the cheating participants were in last place notheless.

After the contest of this day, some of the contestants (mainly those whose scores were in IOI range — Sujiro (me), Ku Shai, Shota, and Paula) went to Skopje City Mall, where we spent ~40 euros in those machines that you can try to grab plushies with a claw, just to get a single plushie:

Day 3

On the third contest day, Thomas finally remembered he is the Macedonian GOAT, and improved a total of 7 positions, getting to 5th place. Even then, Ku Shai just decided to become the chillest guy and simply aced the test in two hours (out of five), while the second place in the day only managed to score 245, and most of the contestants scored ~100 points.

Day 3 scoreboard:

Another thing that happened this day, was that the contest got delayed by three hours, and we the contestants got together around what we called "Setters Zoo", that was a room outside the computing institute (from where we were doing the test) where the setters were organizing the contest. Because the contest was running so late, some people (definitely I was not included in this group) started throwing small rocks in the windows, but we managed to get away before the main setter started running after us. We also started drawing in the contest room whiteboard:

Things are in japanese because some of us are asian

Day 4

Finally, the last contest day arrived. Sadly, no major changes happened in the scoreboard, and sadly, Thomas didn't manage to go to IOI in his last TST. Despite this, he will remain as the Macedonian GOAT in our hearts. In the end, the IOI team was Sujiro (me), Ku Shai, Paula, and Shota.

Final scoreboard:

![ ](https://mirror.codeforces.com/36532f/Screenshot from 2024-12-07 02-09-26.png)

To celebrate the last day, we decided to do a makeshift lan house in my room, and once again, almost got banned.

Lan house:

Because the contest was already over, we also spent the whole night awake, and when morning came we went to the swimming pool. Sadly I don't have the photos of the pool :(

It was a really fun week, with many adventures and mishaps, but that eventually ended in a great way. I would like to thank the problem setters, who worked incredibly hard to make the contests we had, and everyone who participated in the TST for making it so memorable, even if I was only able to participate in it twice and this was my last year.

Another important person that I need to thank is tourist, who is a big inspiration for my competitive programming journey.

Link with the final results: here

*names may be different from the original in order to maintain privacy

Full text and comments »

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

By pikamonstruosa, 3 weeks ago, In English

After many grueling contests without any luck, and being unable to perform to a satisfactory level, I finally managed to get a lucky problem set and managed to reach specialist! I think I used up all of my years worth of luck today. I will soon make a new post about my journey to reach this result. Once again, thank you tourist for being an inspiration for me, as I have already mentioned on this blogpost.

ゲンナディ、本当にありがとう

Full text and comments »

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

By pikamonstruosa, history, 4 weeks ago, In English
  • Vote: I like it
  • +5
  • Vote: I do not like it

By pikamonstruosa, history, 4 weeks ago, In English

Sadly, tourist lost the iconic tourist rank on the Saturday contest. Nonetheless, he is still the goat, and we still love tourist. Thank you tourist.

Full text and comments »

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

By pikamonstruosa, history, 4 months ago, In English

tourist may reach the historic mark of 4000 rating in tomorrow's contest! Good luck tourist!

Edit: He did not participate :(

Full text and comments »

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

By pikamonstruosa, 6 months ago, In English

Thank mike. Polygon and Codenforces orz

Mike

Full text and comments »

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

By pikamonstruosa, history, 13 months ago, In English

It has been one exciting year since I gave my most sincere thanks to the legendary tourist after reading about his story. Remembering what he has done for me and my motivation in this last year, my apreciation for him has grown even further, so I am here to thank him again! To show my love for his existance, here is another drawing in his honor. Now in red and black to represent his awsome rank!

Full text and comments »

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

By pikamonstruosa, history, 16 months ago, In English

What happened with china this year in IOI? Why did they underperform? Why did they perform so badly this year? Is the chinese level falling? No one ik'ed ioi.

Full text and comments »

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

By pikamonstruosa, history, 17 months ago, In English

With the broad availability of quick and efficient sorting algorithms, that can sort arrays in $$$O(N*logN)$$$ complexity, little attention has been given to the vast and interesting world of the bad sorting algorithms. Because of this, I will, in this blog, explore this area. To make this list more interesting, we are only going to consider the algorithms in which play a role in the sorting process. That is, there won't be algorithms that use a wait function or an infinite loop.

Bogosort

-This may be the most famous bad sorting algorithm. Its legendary strategy consists of randomly shuffling and array until it is sorted.

Code

*It is also worth mentioning that there is a variant of this algorithms that eliminates the randomness issue: Create all $$$N!$$$ possible permutations of a given array. Go through each one checking if they are ordered or not.

Complexity

  • In average, $$$(N-1)*N!$$$ swaps are made.

Bozosort

-This is another sorting algorithm that relies on randomness to be bad and the strategy it uses to sort is quite simple: If the array is not ordered, randomly select two elements of an array, swap them. The expected time complexity is a bit more complex, but on average $$$N!$$$ swaps are made.

Code

Slowsort

-This algorithm is a very interesting one. It utilizes the infamous technique of multiply and surrender in order to sort its elements. The recursion it utilizes is very "efficient" and interesting:

function slowsort(begin,end)

   mid = floor((begin + end)/2)
   slowsort(begin,mid)
   slowsort(mid + 1, end)
   if(array[mid] > array[end]) swap(array[mid],array[end]) //we compare the greatest element of each half
   //now, the greatest element of the array is in the end, so we call recursively without including the last element

   slowsort(begin,end - 1)

Code

Complexity

  • The complexity of this method is kinda sketchy, so I will just say it is very very bad (not polynomial, not by far).

To finish this amazing list, I will present a sorting algorithm that becomes faster the more faith one has. I present to you the unmatched, the most amazing:

Miracle Sort

This niche method relies solely on the faith the programmer has on whatever it is that he believes. The method to sort consists of 3 simple steps:

  1. Check if the array is sorted
  2. Have faith
  3. Check if, by some miracle, the array is sorted again
code

With this quite reliable method, one can hope that the array will be sorted in $$$O(Faith^{-1})$$$ time complexity.

Conclusion

I hope you enjoyed this trip through the bad sorting algorithms. This is merely an introduction and I have yet to see everything bad algorithms have to offer. I find them interesting because the way they manage to get such a bad complexity is quite creative.

Full text and comments »

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

By pikamonstruosa, history, 17 months ago, In English

Hello codeforcers, today you I will show how to order pizza through CSES. It is really cool!

Step 1 — Accessing the link

The first step is to access the link. The link is : this

Step 2 — Ordering the pizza

After you log in, you can select the flavor of pizza you want. However, it is in Finnish, so here is a translation of the menu:

Menu

Step 3 — Enjoying the delicious pizza

After you order, all you have to do is to enjoy the delicious pizza from CSES!

Full text and comments »

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

By pikamonstruosa, 17 months ago, In English

Hello guys, today I will do a tutorial on how to clean a vector, structure or something else in c++ really fast.

Naive Approach

-A newbie may see this problem and try to solve it in linear time, for that we could just use the resources the C++ libraries offer us. In this particular case, the function clear() would do it. However, it is an $$$ O(length) $$$ function and considering N can be very big, until $$$ 10^9 $$$, for an example, it cannot solve every problem of this type.

Smart Approach

-A more experienced coder, like Errichto, will see this problem and immediately think about the smart approach. This approch consists of doing the following:

Code
  • Boom!, the complexity fell from ~$$$O(N)$$$ to ~$$$O(1)$$$. On my machine clearing vector of size $$$10⁸$$$ with the dumb approach took $$$0,789s$$$ and with the smart approach it took $$$0,438s$$$. Thus, in the next time you need to clear a lot of vectors, use the smart approach, your code will be much faster.

  • P.S: this idea can easily be expanded for other structures, just substitute the 'vector' in the code for the structure you want and make the necessary changes to it.

Co-authors: tourist, Um_nik, Errichto.

Full text and comments »

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

By pikamonstruosa, history, 17 months ago, In English

Recently I got invested in learning Portuguese, so, to better learn the language, I started coding in Portuguese, so that my memory of words in this beautiful language could get better. However, I was really upset when I could not submit problems in codeforces in Portugol, the coding language in portuguese. Why is there no support for this? I really want to improve my language skills both in programming and irl.

Full text and comments »

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

By pikamonstruosa, history, 23 months ago, In English

As tourist's biggest fan, it was inevitable that I collected a substantial amount of tourist's pictures as the years went by. So now, I think I have enough of them and want to share them with the community.

Very Young Tourist

Young Tourist

Happy Tourist

Very Happy Tourist

Awkward Tourist

Anime Antagonist Tourist

Impostor Tourist(No fucking way that's him)

Teenager Tourist

Anime MC Tourist

Pool Master Tourist

Rich Tourist

Relaxed Tourist

Tourist looking up Tourist

Model Tourist

As you all know, I am very grateful for what tourist has inspired me to do and for what he has done to the community, inspiring not only me, but thousands of coders to go beyond what they previously thought they were capable of. So, lastly, my favorite version of tourist, and my way to show, as a member the Competitive Programming community, how important and grand this man is:

Thank you Tourist

Full text and comments »

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

By pikamonstruosa, history, 2 years ago, In English

I started coding after discovering about tourist's history in cp, so, to honor him, I made a drawing of him. Thank you tourist for inspiring me to begin learning such an incredible subject.

Full text and comments »

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

By pikamonstruosa, history, 2 years ago, In English

On my second day, I finished step 1 from the two pointers section from the ITMO course and then went on to segment tree and, just wow, didn't know such a cool data structure existed! It was great to learn about it. I am impressed at the number of ways you can model it to fit different purposes and problems. Now, with my motivation at a new high, I hope to keep on progressing in CP and discovering more about such a beautiful side of programming. I will keep updating my blog to keep me motivated and eventually inspire more people to learn more about CP. Thanks for everyone who is supporting me and to the contest creators and developers for maintaining such a good website and community!

Full text and comments »

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

By pikamonstruosa, history, 2 years ago, In English

I recently started my journey here on codeforces and today I did my first contest ( of many to come, hopefully ). The idea for the problems I did (A and B) are really cool, so I want to share it with whoever wants to see them.

A - The observation needed for this problem is that, given an optimal subarray, we have two cases. Let's assume you want to expand it to the right ( it's the same case if it's for the left ), if the next number is already on the array, r-l-c(l,r) increases by one, since c(l,r) stays the same and r increases by 1, so overall, the value increases by 1. If the next value is not on the array, c(l,r) increases by one and so does r, so overall, the value stays the same. That is, if you expand an optimal subarray, the value we want to maximize either stays the same or increases by 1. Then, all you need to do for a given test is to print 1 n.

B - I am still not sure how to prove that this idea is correct, but what I thought on this problem is that the optimal answer has all the multiples of the gcd of everyone.

Those are the ideas I had on this contest! The ideas, although simple, were not trivial to be seen, and that is where I think the beauty of CP and math problems are. I would like to thank the developers of the contest, Cocoly1990, waaitg and Imakf for the good time I had trying to solve it!

Full text and comments »

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

By pikamonstruosa, history, 2 years ago, In English

I am doing the ITMO course and the ideas are really cool. Glad I began doing CP!

Full text and comments »

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

By pikamonstruosa, history, 2 years ago, In English

I am starting my journey on this wonderful website and just did my first problem after learning two pointers. I am very happy! I hope I like Cp!

Full text and comments »

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