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

Автор Warawreh, 8 лет назад, По-английски

Hi, Everyone!

At Jan/20/2019 15:05 (Moscow time) will start Codeforces Round 533 (Div. 2). Round will be rated for second division (rating below 2100). As usual, participants from the first division can participate in the contest out of competition.

The round will consist of 5 problems in which you will be helping some of my friends and you will be given two hours to help them.

I would like to thank MikeMirzayanov for the Codeforces and Polygon platforms, cdkrot for round coordination and help with preparation. Also thanks to vintage_Vlad_Makeev, Aleks5d,budalnik, Arpa, mohammedehab2002 and ---------- for help with preparation and testing round.

As usual score distribution will be announced shortly before the contest.

Good luck!

UPD1: I'll be on the Discord channel after the contest, so we will be able to discuss the problems.

UPD2: Score distribution : 500-1000-1500-2000-2500

UPD3: The Editorial is ready.

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

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +4 Проголосовать: не нравится

which you will be helping 5 of my friends

What does this mean?

And also... thank you for the contest!

Also... why is the time so early?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I knew it!!! The date of the contest would shift as there can't be 11 days gap b/w 2 Codeforces contests.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +33 Проголосовать: не нравится

best time for the contest... i will not miss my dinner

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -13 Проголосовать: не нравится

its much better than 18:05 thank.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

I believe that it would be a nice round Warawreh ;)

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

During this time my neighbours are very loud :(

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -13 Проголосовать: не нравится

Oh at 2 pm I will still be in church, maybe next time then, goodluck with your contest though hope it will be a success and codeforces like its problems.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +44 Проголосовать: не нравится

I am expecting a really great round ! Warawreh

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I love the original rounds like this one more than any other modified rounds! :D

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

jordanian problem setters ، so excited to this contest

»
8 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится -41 Проголосовать: не нравится

bad timing

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I think,it is your first round in CF Warawreh.Hope no ambiguity in problem description.Good luck.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -41 Проголосовать: не нравится
»
8 лет назад, скрыть # |
 
Проголосовать: нравится +19 Проголосовать: не нравится

Damn, I know that Americans are a minority on codeforces, but many of the recent contests have been at bad times (6 AM) for us in California, and this one is 4 AM as well. :'( Of course it doesn't make sense to base the timing off of americans, but I hope there will be one at a reasonable time for us soon!

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

Thanks god it's sunday otherwise i will be in college till 5:30pm (IST)

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

I think it will be a great round.

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

.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Jordanians problem setter, but it clashes with Jordan vs Vietnam match.

Sorry Jordan, we don't have a jordanian codeforces round set up by my friend every day XD.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +19 Проголосовать: не нравится

Please just order problems correctly by their difficulty, because lately many round setters didn't :D

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

The first time I see Codeforces Round at 7h00 pm in Vietnam. However, Vietnam National Football team is going to have a match at 6h00 pm. "Viet Nam Vo Dich"

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Clashing with Atcoder contest

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +30 Проголосовать: не нравится

Some guys said ustat is dead,

Tell them, the ustat is back.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +33 Проголосовать: не нравится

I think the author made a mistake in the title. It should be "Codeforces Round #533 (Div. 3)".

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -37 Проголосовать: не нравится

Почему Д такой мусор?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -34 Проголосовать: не нравится

Все дизлайкать эту мусорку!!!!

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -34 Проголосовать: не нравится

Ребята я на раунде мне не смешно поддержите лайками!!!!

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -16 Проголосовать: не нравится

Можно было дать сэмпл, в котором у какого — либо игрока > 1 замка? Потратил 47 минут на дебаг, не успел подумать над E. Спасибо, авторы, было очень вкусно.

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

    Я воспользовался опцией задать вопрос, получил ответ и через пару минут общее оповещение по этому вопросу. А раунд хороший: тут всё для див2 решаемо и пишется довольно легко.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

How to solve C ?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

This comment was helpful for problem E :)

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

E:Helping Hiasat

No, I don't want to help him, he is so hypocritical.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

4th test for E?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

Я правильно понял, что E это втупую поиск максимальной клики?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +14 Проголосовать: не нравится

15th test on D?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

Can someone tell me why I am getting TLE on pretest 6 on C? Submission

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

Nice problemset!

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Is E something like building a graph of friends that can't both be picked (i.e. there's an edge between two friends if they both cant be satisfied) and then doing meet in the middle on that to try and find the best valid subset of friends?

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

Do anyone passing the pretest for problem E using randomized algorithm for Maximum Independent Set (MIS)?

**Update: System test Accepted ;)

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

48635541 I actually got stuck during the contest, why did my submission of problem C get time limit exceeded ?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -7 Проголосовать: не нравится

Was D just an implementation problem or there was some observation to do for speed-up? I implemented (naive) multi-source BFS but still getting TLE

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

The contest reminds me of how much do I hate hacking in div2 contests -- A problem is either trivial and submitted by a lot of people, making it boring to go through all of them, or there are very few people who submitted it...

Yes, I am salty about losing 5 hacks to another roommate who only started hacking 30 minutes before I started. ;_;

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Shouldn't this solution give Runtime error? on 1 1 a https://codeforces.me/contest/1105/submission/48622609

»
8 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится -15 Проголосовать: не нравится

Probably the worst round in Codeforces history, imbalanced and not interesting problems, didn't expect it from such a noname.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

Is E just finding size of maximal independent set with meet-in-the-middle? If so why do you do things like this?(((

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -17 Проголосовать: не нравится

Warawreh's hit contest

»
8 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

Someone please help me, For problem A
I tried a hack on the solution.
This solution initializes s[n+1] but uses s[t] somewhere between the code.
For a test case like:

2  
88 100 

s[] should overflow because, t can take values from 88 to 100, but s[] is initialized only for 0 to 1.
But my hack failed. Why is his solution still printing the right answer?
UPD: He failed main tests :/ . Still it was my first ever hack and learnt about how overflow actually works :)

  • »
    »
    8 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    I suppose that only s[3] and s[4] is corrupted due to overflow, you need a testcase to trick the code into reading these two slots.

    • »
      »
      »
      8 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      Oh so is that how overflow works?
      I thought any number greater than the limit would have created overflow...
      Can u explain me in detail?

      • »
        »
        »
        »
        8 лет назад, скрыть # ^ |
        Rev. 2  
        Проголосовать: нравится +11 Проголосовать: не нравится

        This is what my Operation System course taught me:

        So, when the C++ code writes "s[n+1]", the OS allocates some memory to the code, and the same thing happened when it asked for memory for p and j. The OS make use of the stack and use the 2 records right after s[n+1], which, pointer arithemetic tells you that it is equivalent to s[3] and s[4] (Or around s[3], I am not entirely sure about this tbh. Perhaps since s[3] is allocated to the array to store '\0' so it is actually s[4] and s[5]).

        Then, when s[88] is called, it look into *(s+88), which is not occupied by anyone. Luckily, this is also not out of the memory bounds that the OS allocated to the process, so calling s[88] will neither access corrupted memory nor trigger segmentation fault.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Any clue to get past pretest 5 on D?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +37 Проголосовать: не нравится

People like thinking during a contest, do not take away this opportunity from them

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Problem C is so cool for me. Thanks for this contest, its very nice! :D

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -10 Проголосовать: не нравится

I have to say that problem D is really really really inappropriate to be D. May be C and D could have been swapped.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Hmm... this is weird...
but anyone have any ideas of pretest 15 of D?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -11 Проголосовать: не нравится

Also, this maybe a bit too much, but I'd be glad if the part one or more castles in statement of problem D is written in bold or italic to emphasize it.

I wasted 3 failed submissions and half an hour by misreading this part, thinking each player will only start with one castle. It's not that I want to blame, but such crucial information should be emphasized.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Why are there so many Failed System Test in problem A?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

I suggest that the key words should be BOLD in the statement.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I got accepted on problem B with DP solution

Seems too overkill

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +48 Проголосовать: не нравится

Div. 2.5

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -10 Проголосовать: не нравится

Congrats Warawreh.

Impresive Debut as a problem setter in CF.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

What is the combinatorial solution for C? Anyone explain please.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

How come c++17 is much faster than c++14?

Here 2 codes for D First Submission Second One

A whole half second seems rather cruel despite using scanf

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Pretest 5 of D:

4 4 2

1 1000000000

....

....

..2.

...1

Can someone explain why the final state of the board is:

2222

2222

2221

2211

rather than

2222

2221

2221

2111

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

    And why would it be the second one? first player will only expand 1 cell up and 1 cell left in the first move (as his expansion speed is 1), and then the second player will fill out the board with his huge expansion speed.

    • »
      »
      »
      8 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      Oh, I misunderstood this problem. I didn't realize that player i could take any square that was si distance away, I thought the problem meant that it could taken any squares si distance in the direction left, up, down, or right (i.e. could only expand in straight lines).

      I suppose I was confused because the problem said "castle", and I immediately imagined rooks from chess. Definitely much more my fault than the problem setter's, but still very annoying because I spent an hour of the contest looking for a bug in my code.

  • »
    »
    8 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    The first player only has 1 speed expansion, that means the state of board after the first player play is:
    ....
    ....
    ..21
    ..11

    Then, the second player plays filling the rest of the board.
    2222
    2222
    2221
    2211

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -9 Проголосовать: не нравится

Why t can't be 0 in problem A ?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится -12 Проголосовать: не нравится

It was a good contest with clear explanation of the problem.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can someone help me find bug in this code for Div2D : 48619139

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

Could anyone solve C using combinatorics (without DP)?

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

What a nice planning. I have to wait just 2 days for comeback :D

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

why this code for problem D get WA on test 38? https://codeforces.me/contest/1105/submission/48642621

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

For problem C:

I kept on trying it with stars and bars method, DP didn't occur to me.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I think worst case complexity of D will be O(n*m) (In each chance if we acquire a cell) Player x will not play again in subsequent rounds if he wasn't able to play in previous round.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Is it just me, or this div2 round was a lot more accessible than most of other div2 rounds (even considering only the div2 only rounds)? I am curious about other people's opinions!

»
8 лет назад, скрыть # |
Rev. 7  
Проголосовать: нравится 0 Проголосовать: не нравится

Deleted

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

time limit for D was too strict, no python solution passed the TLE during the contest.

you can check out my python2 implementation of intended solutions gets TLE at test case 13

also all these other solutions from other users in python3 got TLE even if most of them are correct as in the editorial TLE test case 13

TLE test case 13

TLE test case 13

EDIT: I implemented a solution using collections.deque but still gets TLE, is anyone able to get AC on problem D using Python? up to now no one did.

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

Such a strangle thing. After contest I submit libra8z's submission.48632510.And I got TLE.But the code accepted with 1600ms.How can this happen? Oh,C++17 is much faster than C++11.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

What is testcase 45 of problem D?

  • »
    »
    8 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +8 Проголосовать: не нравится
    Generator's source code
»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Can test inputs and outputs be found somewhere on Codeforces after a contest ends? As you know, for large input or output, all of it may not be displayed on submission pages. Actually it's not related only to this contest.

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Couldn't understand why I got TLE in problem D. I have attached both my contest time code (in which I got TLE in main test) and AC code written after contest.

The only difference is I added this line " if(v[cur].empty()) return ret; " at the beginning inside bfs() function. But if I don't do this it should return the same "ret" since both v[cur] and q should be empty and no while loop should run. But adding this line is giving me AC in 0.5 sec while skipping this giving TLE with 2 sec+. What's the reason behind this significant difference in time?

TLE Code: 48636948 AC Code: 48646138

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

    It may got optimized. C++ is very hard to understand completely.

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

    in case 45, bfs is called around nmp times, now each time you call bfs you create a new queue, I don't know the details, but creating a queue in c++ is not very fast which is why you get tle, changing that queue to global should greatly decrease the running time.

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

      The default container for a queue is deque, and for some reason it is more heavy than other data structures. The size of an empty queue (with deque container) is 80 bytes, while if we change the container to list, it will be 24 bytes.

      The same solution gets accepted after changing the container to list: queue <PLL,list<PLL>> q48669305.

      So I think it is mainly memory allocation / deallocation that makes it too slow. The solution is declaring around 80 * 9 * 106  =  ~686 MB while using list container would declare 0.3 of that.

    • »
      »
      »
      8 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      I use C++11 and then I got failed on system test.(i.e.TLE in test 45).And when I changed to use C++17.I got Accepted with 1600ms.How can C++11 and C++17 have so big differences. Maybe C++17 std::queue is optimized

»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

please help me to find out what's wrong in my code problem https://codeforces.me/contest/1105/problem/D

solution https://codeforces.me/contest/1105/submission/79372365