defnotmee's blog

By defnotmee, history, 14 months ago, In English

Hello codeforces!

I was reminiscing about the brazilian TST that just happened and figured it was way too crazy not to share with everyone how it went. So as a follow up to this blog I'll be going through my experiences at the event. Get ready for a ride, because this is gonna be a long one.

Day of Arrival: Coming out of the closet

The people of my school all gathered in a bus to go to the hotel we were staying at. That bus made a beeping noise every time we passed 90 km/h, and considering we were travelling at night, we were hearing that noise way too often! While in the ride, I stole LFFB_'s laptop and started playing Osu on it. Even though I was playing on the touchpad and the bus was bumping around, I was able to clutch out an S on "Pepsi Man", which was quite a challenge despite being on relax mode.

After that, I gladly returned his computer so he could do Advent of Code while still inside the bus.

Arriving at the hotel, they got us something to eat and after LFFB_ showed a bit of his piano skills, we quickly got to know our rooms. We started hanging out in one of them when _rey got the wonderful idea of getting inside the closet, almost breaking it and leading to this awesome moment:

"Get out of the closet Pedro, get out of the closet!" — Everyone

Warmup Day: Brazil vs Korea

Overall, pretty uneventful day. We got breakfast and headed to UNICAMP, the university where the TST would take place on. It was the warmup day, and one of the problems in it had a very glaring issue where it was literally impossible to solve because the setters forgot that 4^7 < 8!. We had to stop warmup early tho, because Brazil was playing in the world cup (and it is pretty stabilished that no one works or goes to school while Brazil is playing in the world cup).

Yeah, we went to a different room so they could project the game for us. It was really cool.

We go back to our rooms, talk for a bit, turn on the air conditioner, and sleep.

TST Day 1: Tragedy arises

I wake up with a stupid ass headache. My bed was right below the air conditioner, and it looked like that AC was there since the 90s, which was probably why have waken up so bad. Since the first day of the TST tends to be really easy, I thought everything was fine and just hoped the headache would be gone before the contest starts.

Contest starts and I still have the headache. It had 2 problems for 2h30 and was also much harder than expected. I end up having a wrong idea for one problem, then went to the other problem and got a correct idea, but my code was really really buggy. They gave everyone an additional 30 minutes because the checker for that problem was also bugged. I ended up debugging the problem in the last 17 minutes of contest, ending up with 121 / 200 points, which would be around 70 if they didnt give 30 minutes to everyone. I was really really angry at myself, but everybody tried to cheer me up. It really helped me, even though I would stay angry for the rest of the day. Funnily enough, what helped me the most was ar_paixaos19 saying "you're all bitchy today but everybody knows you're going to IOI in the end".

After having dinner, we were going to have the "Shopping Day", where everyone at the event would go to a shopping mall and walk around on it. When we got into it, the goal was simple: finding a pharmacy so I could buy headache medication (it only got worse after the contest).

The mall was really big and in the middle of our search we found an interactive art piece, where everyone could swipe their fingers and draw anything into the wall. We didn't take a picture of it, but it looked something like this:

Of course, we drew lots of dicks on it.

We found our way to the pharmacy, got the medication, and started going to random stores to mess around in. In one of them, we found this very promising piece:

The text says "Which Fini is perfect for you?", but the screen just had Microsoft Solitaire Collection running on it. It turns out it had Windows 10 on it, so we did what anyone else would do in that situation: we solved watermelon on it. For some reason we couldnt use the cf text editor, but we opened notepad and did this.

I have a video of it, but since i dont know how to embed it in cf blogs, lets just have _rey posing for a photo with the AC while I was recording it:

"It's a video, Pedro" — Mee

We go back to our rooms, and before sleeping, my friend joaof noted how suspicious my headache medication looked and took this photo to incriminate mee:

He later said to random people that I bought viagra at the mall while showing this photo.

TST Day 2: A new hope

I made sure not to turn on the AC in the night before, so I was headache-less. The scoreboard for day 1 came out during breakfast, and I was tied in 5th with a bunch of people. Honestly it was much better than expected, but still outside of IOI range. Not knowing what to expect, we head out to UNICAMP.

Before the contest, we had a class where they went through all the solutions for the previous day, on top of some extra stuff. My friend group all had caps that the organization gave us when we got to the hotel, and in the middle of the class we decided to merge all of them into one:

You guys can't see it, but there is an extra cap facing backwards that doesn't appear in the photo.

There was also pizza for lunch. They would bring us pizza through a door and people would get the slices from the plates they were carrying. Normally, everyone at the entrance would instantly get all the pizza, so the waiters would extend their hands really up in the air to not allow them to get it before everyone. It is said that the "Pizza Day" is also part of the Selection for IOI, because only the strong would be able to get themselves fed before the contest.

We then finally head to the contest and get our setups ready. I was really anxious before it all started. So, as a lucky charm, joaof hands me a fucking shampoo bottle.

The results speak for themselves though. This is the scoreboard in the first day (without the shampoo bottle):

This was day 2 (with the shampoo bottle):

Note that my name is "Leonardo Valente Nascimento".

Even though I was back into IOI range, it was not an ideal contest for mee. It had 3 problems, but it was a 3h30 contest, and I spent around 2h30 of them on a wrong idea for the problem "Verba". Luckily, "3Swap" looked a lot like this problem, which AnandOza helped me with a really long time ago, so I could code it for 91 points in half an hour. Thanks Anand!

Back at the hotel, I watch episode 9 of Chainsaw Man at my room. My roomate vladimir050 noted that I was screaming out of nowhere while watching it, and he thought I was talking with him. It was pretty good.

TST Day 3: Shopping Day 2

Cheered up once again, we head to another contest day. This time, it was a 5 hour contest, completely IOI-style, so I knew it was my time to shine.

I forgot to take a screenshot of the day 3 scoreboard, but I did 286/300 points, getting passed only by LoboLobo, which AKed the contest. I later came to know that the guy who created the problem I did 86 points on was morete, one of the teachers of an IOI training camp for mee, Deepesson and LoboLobo. He also stole my ID in one occasion. The character from the statement was supposed to be Leonardo, but one of the setters decided to change it to not pressure any of the contestants.

After the contest, we also had a second "Shopping Day", on an even bigger shopping mall.

We first headed to a houseware store where we obviously bought nothing, then for a book store that had lots of manga. On that particular store, there was a wall with a bunch of talented drawings, which i think would be cool for you guys to see:

As someone that is watching Chainsaw Man religiously, I was trying to find a Chainsaw Man volume. It was really hard finding one that didn't have a naked woman on the cover, but in the end I settled with this:

In response, perchuts had one thing to say: "She has a big heart".

We then had a new goal to achieve: ar_paixaos19 had neck pain and we needed to find a pharmacy to buy medication for him. The problem is that the mall was so big that it was particularly important that an instructor was keeping an eye on us. We proceeded to completely ignore that fact and started wandering out into the nothingness.

After doing a very exhaustive DFS through the mall, we finally found a drug store. ar_paixaos19 buys his medication while i try taking on and off random stuff from mee so that the weight machine in the store could say that I had exactly 69kg. Both of us were successful.

From left to right, we have mee, _rey, ar_paixaos19, LFFB_ and vladimir050. Note that Vladimir has an IOI cap. We exchanged caps because I lost the cap OBI (Brazilian Olympiad in Informatics) gave us and the IOI cap couldn't fit my head. He liked it a lot, as we can see in the picture.

We continue walking aimlessly until we meet a group that actually had an instructor! As that instructor scolds us, _rey notes a very scary thing: he couldn't find his phone anymore. As noted in my first blog, he has lost his phone in every single OI event he has been in, and this time he "felt like someone was getting it out of his pocket". Since time was running out, we just regroup with everyone so we could leave.

In the bus back to the hotel, we find out that someone found his phone at the mall, so apparently no one actually stole it (despite what he said earlier).

When we get back, the organization told us that not only we got back late because of the shopping day, but we would have to get up early because Brazil was playing at the world cup again tomorrow. We ended up getting a sub optimal ammount of sleep because all of my friends decided that it was a good idea to mess around in my room, on top of the already dire conditions.

TST Day 4: Dawn of the last day

It is a known fact that the last day of TST in Brazil is completely crazy. This year, it did not disappoint.

Everyone at the top 4 just had to get a small ammount of points to guarantee IOI, so we were all relaxed. In my case, for example, I had to get 135 points. Because of that, on top of the fact that little to no one actually got a good night of sleep, we had more people sleeping during the class than usual. Take this funny photo of _rey as an example.

He actually slept in all classes for at least a little bit, but this photo is particularly funny.

Then we go to the same room as before to watch the game of Brazil vs Croatia. We were only able to watch the first 2 halves though, as the extra time would clash with the time reserved for the contest. The setters assured us that they would keep us in touch with the game through the announcements, so there was no protests about it.

It was another IOI style contest, with 5 hours for 3 problems. As any dignified last day of TST, it was much harder than the other ones. I ended up getting the 135 points I needed around the middle of the contest, and then noticed I was way too sleepy and tired from the other days to stay focused and think on the problems. Therefore, I followed this algorithm from that point on:

  • Code all subtasks I know
  • Leave the contest room
  • Find a random place to sleep
  • Sleep
  • Have an idea for a random problem
  • Go back to the contest room
  • Repeat

This was particularly effective, as it got mee 210/301 points by the end of the contest, the highest score on it. In fact, if we just consider the last 2 days, I'm exactly 1 point above LoboLobo :sunglasses:. Before anyone asks, the contest was in fact worth 301 points, as the last problem, "Anido Primes", was worth exactly 101 points. I asked about it in the clarifications, but the only answer I got was "101 is prime". All the subtasks on this problem were also worth a prime ammounts of points. The problem also had nothing to do with primes or Anido (the coordinator of the brazilian olympiad), which is kind of funny.

After the contest ends, we head to a ceremony where they hand the medals from the national olympiad to everyone that came to the event, and also announced who would be going to IOI, CIIC and EGOI. Our parents were also invited to come and the ceremony can be watched here. It had some pretty funny moments, like a pikachu showing up to receive a medal and Anido saying that EGOI 2023 will be in Switzerland instead of Sweden. It was also there that I got the news that Brazil lost the World Cup, as the setters just notified us when Neymar made a goal, but not when Croatia did one and eventually won the game, so that we wouldn't do the contest saddened. I also handed my cap to my little sister, which ended up liking it even more than I did. The IOI team also took that photo that appeared in my first blog during the event.

We then head back to the hotel to have our last dinner there. Contrary to what you might be thinking, this is where the real event starts. It turns out that the last day of TST in Brazil has only a single rule: nobody sleeps.

I send a message to our whatsapp group asking what the plans for the night are. While waiting for the answer, mee, ar_paixaos19, _rey, vladimir050, LFFB_ and Deepesson go to a room to play a brazilian card game called Truco. My team won the last game and I was popping off when we received a message from LoboLobo: "Get down to the pool".

We go to the pool, where we probably weren't allowed to be that late at night. Not everyone went in though, only mee, ar_paixaos19, _rey, vladimir050 and LoboLobo. The ones who did, however, did so in stylish manner, specially doing front flips. We would keep getting outside of the pool, running back in and front flipping into the pool again, which was very dangerous considering how slippery the floor was. We then found 3 metal bars, which were supposed to be used to put parasols on, and started playing with them like they were swords.

"IOI is too small for the both of us" — LoboLobo and _rey, probably

The third metal bar is with mee, even though I don't appear at the picture.

We also used the bars in an inventive manner. We would fill the inside of it with water and use them to wet the people that didn't want to get into the pool, specially Deepesson. _rey was the only one who ended up using that strategy effectively though. In the end a person from the hotel staff came and respectfully took the metal bars from us, figuring it was too dangerous. They forgot to take mine though, even though I explicitly reminded them that there was another bar they didn't take.

The last thing we did inside the pool was playing chicken. We would constantly change our pairs around and it was super super fun.

Here is mee and vladimir050 against ar_paixaos19 and _rey, while LoboLobo watches. He also fought at some point.

I was feeling dizzy from all the fighting to the death, so we all got out of the pool.

We played yet another card game called "Burro" with a whole lot of people I do not know the cf handles of. I was really bad at it but luckily _rey was worse so I didn't instantly lose every time. This continued until the sun started rising.

Everyone was tired, there were setters sleeping at the pool area, and we have the idea of going to a random person's room in the highest floor at the hotel so we could watch the dawn of the final day.

It was beaultiful.

We split up, everyone is sleepy as fuck, some people have to get their things ready so they can go back home. However, 3 people know they got something left to do.

On our bus rides to UNICAMP, we noticed that there was a store called "Marcelo Caminhões", or "Marcelo Trucks". One of the IMO gold medallists from Brazil is also called Marcelo. We probably wouldn't have done it we werent almost 24h without sleep, but mee, ar_paixaos19 and LoboLobo may have left the hotel while no one was looking, even though vladimir050 and _rey told us not to do it, wandered onto the street for about 10 minutes, took a selfie with that store in the back, and then returned to the hotel just to get scolded by one of our most laid back teachers, arthur.nascimento.

I was sure to send the photo to Marcelo tho.

"Fucking hell, LMAOOOO. Yall sick in the head." — Marcelo "pastel" Machado Lage, IMO 2022 golder

Closing Remarks

This was a week I will never forget to the rest of my life. A week with lots of ups and downs meeting incredible people and having lots of fun. For the past 9-ish hours I've put my heart and soul into this blog, reminding myself of every little memory I amassed during this event. I have only thanks to give to everyone responsible for making the TST such a wonderful experience, despite all the difficulties, technical problems, financial problems, scheduling problems and etc.

As a send-off for this blog, here is a photo of mee finally sleeping while waiting for breakfast to open, after sending the photo to Marcelo. Enjoy!

Full text and comments »

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

By defnotmee, history, 14 months ago, In English

Hello codeforces!

Because of weird scheduling issues, the brazilian TST is normally made at december of the year before IOI, different from the rest of the countries. So, today was the last day of TST and after 4 days of contests we have our team settled:

From left to right, we have:

In case youre curious, here is a screenshot of the scoreboard so you can see how everyone went.

We were quite comfortably above 5th place in the end, but i had a headache on the first day so i wasn't even top 4 on it. The problems were also really good, as they typically are (even though i can't say the same about the test cases :P).

This team is particularly strong (for Brazil at least) and I'm pretty happy about it.

Leonardo (definitelynotmee)

All I can say about myself is that I was in IOI 2022 and got 57th (silver medal). I took a bit of a break from cp since i came back from Indonesia, but now with school ending I'll have basically infinite time to practice cp.

Rafael (Deepesson)

Heuristics monster. Notably, in a training camp, he passed a problem no one else did with simulated annealing (or as he calls it, "the forge"). He also went to IOI with me, and we got the best placings out of the brazilians on it.

Arthur (LoboLobo)

He's a second year high schooler that is coming on strong, surprising everyone by AKing 2 out of the 4 days of the TST. Honestly the one i know the least out of the 4, so I don't know their full potential. Despite that, he's definitely someone to look out for. Also note that he can also go to IOI 2024.

Pedro (pedroslrey)

Perhaps the most interesting out of the 4. He is in 9th grade, so in addition to IOI 2023, he can go to IOI 2024, 2025 and 2026. He's from the same school as me, so I've known him for a while. Last TST he got 11th place, getting just outside of the range to go to CIIC (the iberoamerican competition), but he did a lot of training since that and got into the IOI team.

He also lost his phone in every TST he has been in, definitely a feat to beat.

Closing thoughts

Brazil is starting to get some really solid teams with some really talented people, and with so much time to train, I think we can do well in hungary.

EDIT: forgot to add earlier, but here is a follow-up blog

Full text and comments »

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

By defnotmee, history, 2 years ago, In English

Hello codeforces! I've come to ask help in a time of great mystery.

I was helping to debug a problem where the code would pass the 2s TL when on a 64-bit compiler but would get confortably under 1s on a 32-bit one when some really bizarre things started to happen.

First, pinning down where the problematic parts were, it turns out this was the thing consuming practically the whole time limit:

set<ll> s;
for (int i(0); i < k; ++i) {
    int pp;
    cin >> pp;

Im not joking. Also k <= 3e5 btw.

It really shouldnt be a big deal, and normally that part should take less than 140ms, but both on C++20 (64) and C++17 (64) make it take from 1900ms to 2000ms.

I made a submission that outputs the time taken to do the input, the inserting, and the ammount of elements in the set; and with that even more weird stuff appears. Look at the result:



In this test case until the 90000-ish iteration there are distinct elements and after that the input time starts to raise aggressively, while the insert time grows at a basically unaltered pace. Maybe they start repeating a relatively big number, but even then, it goes from 30ms to read 50000 guys to 500ms. It's insane.

If you want, take a look at the version of the output when using 32-bit for comparison (the numbers will actually be a bit inflated because you need to get the timings with std::chrono):



Ending thoughts

  • The problematic test case is case 6, however case 5 has the same input size and the set ends up with more items (see 142732612). Why is the problem only with test 6???

  • If instead of reading a variable and instantly inserting it into the set, you first input an array and then insert it into the set, no tragedy happens (142732784).

  • How can the input go so wrong? A 20x slowdown out of nowhere should not be happening.

  • Is there a way to get the raw test data from the authors or something similar to see what actually was on test 6 so we can try to replicate it?

  • Thanks qwexd for doing nothing.

Full text and comments »

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

By defnotmee, 2 years ago, In English

So, on the last round i wasnt at home, and therefore had to use another person's computer to do the contest. Waking up to close to the start time made me not be able to set up the IDE properly, so I thought "why not just use ideone"?

But what is Ideone anyway?

Well it says its an online compiler, so it must be a great alternative to a text editor to test things locally. However, little did I know that it was, in fact, a trap meticulously crafted by the devil, as I received those kind messages from codeforces:

There are 5 more of these.

Well, let me explain. This is what appears when you go into ideone:

Notice something wrong? Right at the corner of the screen there is a grayed out page called "recent codes", where you can see the recent submissions from people (for absolutely no reason). In fact, any code you post there is available for everyone to see! Such a distinguished feature! The only way to circumvent this is by noticing that that miniscule globe image right below the text box means that the whole world is seeing your solution.

Let's compare it with another site, pastebin. This is what appears when you access it:

Not only is it not a compiler to trick people doing coding competitions, but also its written public instead of an image you have to guess means public, and the public pastes appear on the same page as the one youre typing on, and they dont actually put stuff from people who arent logged on there. Considering logging on there is basically impossible (at least for me), most people are completely safe and happy.

So ok, ideone is bad and made you look like a fool, but why is it evil?

Well, let's find who is behind ideone (aside from the devil of course).

According to , it's Sphere Research Labs. Sphere... can you guess what it relates to? Yes, Sphere Online Judge, or SPOJ. We don't even have to go as far to confirm its the same company who takes care of both of them, look at the second result on google.

SPOJ itself said it!

And what does spoj have to do with it? See, SPOJ is an online judge, but it has another distinguished feature, it doesnt let you see other people's codes no mather what, which severely hampers the ability to learn coding tricks by looking at good corder's solutions. If the implications are not obvious, I'll let the words of the great brunovsky my own:

That settles it. The Sphere Research Labs are in fact a company design to destroy the lives of coders little by little. Not only do they do the shittiest judge imaginable (SPOJ, that has no one using it but still takes 3 hours to process your code that takes half a second to run, in addition to not having c++17), but at the same time create a trap website (ideone) in such a way that codeforces has to not punish cheaters so harshly, because they can just be someone who used it.

Extra Spice:

Looking at some of the submissions that were plagchecked with mine, we can see some interesting stuff, like this code for A, which was submitted a single minute after mine, and is in fact, completely identical. Not only that, but this freshly created account copied my codes for A, B and C, each of them shortly after i submit into codeforces. It is of my firm belief that this man, along with many others, is actually a bot (which can or cannot be setup by Sphere Research Labs) targetting naive people who trust ideone with their codeforces solutions, making them lose the rating they rightfully earned.

That being said, thanks for coming to my TED talk.


Guys, good has won this battle. Sphere Research Labs has commented on this post and as of now, private is now the default version of ideone.

As means of reconciliation for the mean comments I've made about them, ideone will be now my go to online compiler, as well as the place i will be pasting code when i need to send someone.

I would like to thank everybody that helped on this cause and gave me contribution, we wouldnt have done this without your help. Im genuinely super happy. Have a great night everyone, history has been made today!

Full text and comments »

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