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

Автор vovuh, история, 7 лет назад, перевод, По-русски

1176A - Дели!

Идея: vovuh

Разбор
Решение

1176B - Объединяй!

Идея: MikeMirzayanov

Разбор
Решение

1176C - Теряй!

Идея: vovuh

Разбор
Решение

1176D - Восстанавливай!

Идея: MikeMirzayanov

Разбор
Решение

1176E - Покрывай!

Идея: MikeMirzayanov

Разбор
Решение

1176F - Уничтожай!

Идея: BledDest

Разбор
Решение
Разбор задач Codeforces Round 565 (Div. 3)
  • Проголосовать: нравится
  • +46
  • Проголосовать: не нравится

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

Problem E was little tricky, learned a lot. Thanks a lot for great contest!!

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

Anyone having solution of E using DSU? or give some idea?

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

"you can just simulate the process, performing actions from third to first."__

why in that order ?

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

    Every time you perform operations 2 and 3, you multiply the number with 2 or 4. Therefore, each application of 2 and 3 will make the number divisible by 2, thus forcing you to perform operation 1. If you perform 3 and 2 first until you cannot anymore, then the only possible operation you need to perform is 1.

    Of course, you can perform the operations in any order you want (eg. 1, 3, 2, 1, 2, etc) as long as you can still perform one.

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

anyone, please explain the problem D in Graph (dfs and similar) approach. Thanks

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

Won't the solution to the problem D have a worst time complexity of O(n^2) ?

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

Can someone please explain problem F I am not able to understand the editorial solution. Thanks in advance.

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

Hello. I'm interested. Do someone implement some algorithms and data structures from scratch during competition or they have been implemented? I mean sieve, for example, in task D.

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

why 3*cnt5 not 4*cnt5 in problem A? please answer.

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

    you see. Here's three steps to execute: 1.perform the third operation: n = n * 4 / 5 2.perform the first operation: n = n / 2 3.perform the first operation: n = n / 2 after theses three steps the result you got is the n you type divided by 5. so it's 3 * cnt5.

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

Can anybody explain me problem F, the problem say that "you choose the cards and the exact order they are played", I think that if we have 3 cards 1, 2 ,3, we have to choose card 1, 2 and 3, not 3, 2 ,1 or 1, 3, 2, ... But I read that the solution has sorted the array and chosen maximum if we can, I think in some case, it will wrong, because we have neglected that we have to choose the cards in order they are played. Sorry about bad english

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

Hey! can someone please tell me what is wrong with my code? http://mirror.codeforces.com/contest/1176/submission/55369953

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

@MikeMirzayanov Can you please tell me why this approach for problem E fails?

Basically I am greedily selecting vertices if none of their neighbours have been selected. At the end ,if the selected set has more than ceil(n/2) vertices then i print the complementary set

I feel this should work because one of the sets ie the original or the complementary set should have size less than or equal to ceil(n/2) and no two vertices in the original set have edges between them , so they are connected to some vertex in the complementary set (since the graph is connected) . So the complementary set is also a possible answer.

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

For E,I tried "Graph coloring" with G and R such that neighbouring nodes have different colors,through BFS,now count the number of Green and Red,which ever is less than n/2,print that.

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

(Maybe my English is poor)

My idea is similar to the tutorial. This codedoes not exceed O(n), isn't it? But it really timed out. Why is this?

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

what is wrong in this solution of problem D( Recover it!)?

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

For Problem E, apparently just finding a bipartite coloring of the graph will suffice. That is what I did and got AC. My submission (in java) is here: https://mirror.codeforces.com/contest/1176/submission/58155189

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

Can someone explain problem C? I can't understand the editorial.

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

i found my mistake

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

1176E — Cover it

Could anybody explain why I am getting TLE my solution https://mirror.codeforces.com/contest/1176/submission/92457008

Then there is this solution by a friend of mine and he is getting TLE on case 15. Why? https://mirror.codeforces.com/contest/1176/submission/56036460