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

Автор stdfloat, 7 недель назад, По-английски

I was trying to solve IZHO19_sortbooks on oj.uz. In problem $$$n, m <= 10^6$$$ and Time Limit is 3s.

I have 2 questions: Why I got full score? And why if I change code a bit or submit exactly the same code doesn't get the same result?

Time complexity of my solution is $$$O(n \cdot log_2(n) + m \cdot \log_2(n)^2)$$$ and memory usage is exactly $$$256$$$ MB($$$262 144$$$ KB). It should be $$$TLE$$$ because $$$10^6 \cdot \log_2(10^6)^2 = 397 267 425.6 > 3 \cdot 10^8$$$ and it's almost $$$MLE$$$ (if it used just $$$1$$$ KB more). What's more weird is if I change my code a bit it won't get full score because of $$$MLE$$$. Even if I submit a code again, it might not get the same result.

Following 2 codes are same but $$$1^{st}$$$ submission got $$$100$$$, $$$2^{nd}$$$ is $$$MLE$$$:
$$$1^{st}$$$ submission:1096192 got $$$100$$$ pts, $$$2^{nd}$$$ submission:1096203 got $$$77$$$ pts and it's $$$MLE$$$.

You can look my other submission too: link. Explanation of my approach is on comments.

Полный текст и комментарии »

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

Автор stdfloat, 4 месяца назад, По-английски

Can someone explain for 1970C3 - Game on Tree (Hard) why my submission 260659612 didn't gave TLE?

Solution

Maybe number of going parents are limited, but I couldn't find the limit.

And I think these submissions are strange too: 259726359, 259723352.

Полный текст и комментарии »

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

Автор stdfloat, 9 месяцев назад, По-английски

UPD: I suppose no. Thanks lrvideckis for explaining my mistake in this comment.

I think PQ takes too much memory because of what happened in CF Round 923.

In this contest, because of I couldn't solve E, I read F, after some time I found solution. In the end of my solution, I have to find any path from $$$mn.ss.ss$$$ to $$$mn.ss.ff$$$ which doesn't contain a node more than one time, in this code I used dijikstra for it(I don't know why I didn't use bfs). And it used more than 256 megabytes.

Today, I used bfs instead of dijikstra in this code, and I suprised, it took only 43 megabytes. In time 2, in memory 6 times smaller than previous code. I'm sad about I didn't use bfs in contest, but I'm happy about I learned a lesson.

Did you have any experience like these?

Полный текст и комментарии »

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

Автор stdfloat, 10 месяцев назад, По-английски

I have a request for everyone reading this blog: please post a comment sharing what you do/did for IOI training (or perhaps for other OIs). I'm primarily interested in hearing what you actually do/did, not what you would recommend to someone else who's training for IOI (though if you want to give advice, please feel free to do so).

Another request: please answer these questions if you can

Полный текст и комментарии »

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

Автор stdfloat, 14 месяцев назад, По-английски

I was trying to solve IZHO14_bank on oj.uz. In problem $$$n, m <= 20$$$ and Time Limit is 1s.

Time complexity of my solution is $$$O(2^m \cdot m \cdot n)$$$. It's $$$TLE$$$ because $$$2^{20} \cdot 20 \cdot 20 = 419 430 400 > 10^8$$$.

My both code have same time complexity but my $$$1^{st}$$$ code is $$$TLE$$$, $$$2^{nd}$$$ got $$$100$$$ score.

Can someone explain why my $$$2^{nd}$$$ code isn't $$$TLE$$$ $$$?$$$
$$$1^{st}$$$ submission https://oj.uz/submission/854216 gives $$$TLE$$$,
$$$2^{nd}$$$ submission https://oj.uz/submission/854864 got $$$100$$$ score.

Полный текст и комментарии »

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

Автор stdfloat, 14 месяцев назад, По-английски

2 months ago, I posted a blog hoping to find OI groups on CF since most sites are blocked in my country. Unfortunately, I couldn't find.

In CF blogs, for practicing to OIs, suggested is solving easier OIs. But I have only CF with 2017-2023 IZHO, 2002-2023 IOI, and some from gym. I can get some points on IZHO, but I can't solve full and IOI is hard for me.

It'd be good if you answer those questions

Полный текст и комментарии »

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

Автор stdfloat, 16 месяцев назад, По-английски

I don't know why but in my country many sites are blocked.

Luckily Codeforces isn't blocked in my country, and I'm looking for OI groups on CF.

If you know such groups please comment it. It will be very helpful.

Update: I can access blocked sites with Tor browser, still it'd be good if I find OI groups on CF because it's a bit slow.

Полный текст и комментарии »

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