MikeMirzayanov's blog

By MikeMirzayanov, history, 8 years ago, translation, In English

Welcome to 2016-2017 CT S03E04: Codeforces Trainings Season 3 Episode 4. The training duration is 4.30 hours. It is opened for teams as well as for individual participants. After the end you may use the practice mode to complete problem solving. Also it will be available as a virtual contest for whose of you who can't take part today. Please, do not cheat. Only fair play!

Visit Codeforces::Gym to find the contest and register.

We are planning to start on September, 28, 2016 13:10 (UTC).

It is possible that the problems will be too easy for some participants, it is possible that we will add some problems.

Good luck!

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

| Write comment?
»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

How can I participate?

»
8 years ago, # |
  Vote: I like it +31 Vote: I do not like it

Will there be any editorial after the contest ?

»
8 years ago, # |
Rev. 2   Vote: I like it +36 Vote: I do not like it

Will be there any editorial for all of these gyms (ACM preparation)? It is sometimes difficult to find proper solutions for some problems and having some editorials may help DIV2 participants a lot.

»
8 years ago, # |
Rev. 3   Vote: I like it -58 Vote: I do not like it

i disagree with (eat, sleep, code)

we don't come to this world just for this because there is one day which we will leave this world in that day.

  • »
    »
    8 years ago, # ^ |
      Vote: I like it -9 Vote: I do not like it

    The worst comment ever !! congratulations by the way !

    • »
      »
      »
      8 years ago, # ^ |
        Vote: I like it -37 Vote: I do not like it

      salam

      i said truth

      not anything more

      we don't come to this world just for(eat, sleep, code)

      i don't think it is horrible.

      i think that death is beautiful because i believe that there is another world after death

      (i must eat, i must sleep, i must code) and i want to become red but (eat, sleep, code) isn't every thing for me.

  • »
    »
    8 years ago, # ^ |
      Vote: I like it +34 Vote: I do not like it

    You risk to leave this world and do not know what sarcasm means.

    • »
      »
      »
      8 years ago, # ^ |
        Vote: I like it -39 Vote: I do not like it

      mike said his belief and i said my belief

      if i made a mistake then mike made a mistake too.

»
8 years ago, # |
  Vote: I like it -16 Vote: I do not like it

The statements were horrible !!

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

My solution for F is, define nodes Dij ( ith door at j seconds ) and find Maximum bipartite matching between people and D (with Hopcroft-Karp). But I can't get accepted( at another Online Judge. I didn't try in this site ) Why is it wrong?

  • »
    »
    8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I solved it additionally with binary search. thanks

    • »
      »
      »
      8 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I was trying to solve it with a binary search and max flow but the result is TLE in test 2

»
8 years ago, # |
  Vote: I like it +3 Vote: I do not like it

How to solve L and J?

  • »
    »
    8 years ago, # ^ |
      Vote: I like it +25 Vote: I do not like it

    L: Use Dijkstra's algorithm to find shortest distance from start to each vertex. Then use DP[vertex][0 or 1] — number of shortest paths to this vertex or unit longer.

    J: "Meet in the middle". You have about ((n^3)/6)^2 variants to make two or less transpositions. You can get all these variants for initial and sorted array. Then you can find the same arrays in these two sets. You can compare hashs of arrays.

    • »
      »
      »
      8 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Could you please tell how the answer to 2nd test case in J is 3 ?

      I have tried many possibilities and still getting 4

      • »
        »
        »
        »
        8 years ago, # ^ |
          Vote: I like it +5 Vote: I do not like it

        5 4 3 2 1 -> 3 2 5 4 1 -> 3 4 1 2 5 -> 1 2 3 4 5

    • »
      »
      »
      8 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      Could you elaborate a little bit more about dp in L, please? I tried to find every minimal distance from starting vertex and to ending one. Then I build a graph only of edges that lie on paths of minimal weight and minimal + 1. And from this data do dp like this:
      If there are paths of minimal weight through current edge (v, u) then dp[u][0] += dp[v][0], dp[u][1] += dp[v][1]. And if every path through the edge is of weight minimal + 1 then I have no idea how to recalc dp.

      • »
        »
        »
        »
        8 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        It's simply dp[u][1] += dp[v][0] (right?)

        • »
          »
          »
          »
          »
          8 years ago, # ^ |
            Vote: I like it +12 Vote: I do not like it

          If so then what to keep as dp state? I was about to save number of min and min+1 weighted paths from last to current (by doing dfs). If you push only min+1 paths then you lose nearly all of previous paths, don't you?

          I wrote something like this but it's not working at all, obviously.

          Though making dp[u][1] += dp[v][0] and dp[v][1] += dp[u][1] (second only in case it's not (v, u) edge that makes path of weight min+1) helps me pass tests like this.

          7 9
          1 2 1
          2 3 2
          3 4 1
          4 5 2
          5 6 2
          6 7 1
          1 3 2
          3 5 2
          5 7 2
          1 7
          
»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

How to solve G?

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone please help me with the solution to E?