dreamoon_love_AA's blog

By dreamoon_love_AA, history, 7 years ago, In English

Dear CodeForces,

I added one interesting team contest for preparing ICPC World Final into gym!

Every year National Taiwan University will host selection contest in order to determine which team will go to World Final. This year, I host this contest. Ideas of most problems are came from me. Hope these problems can let everyone feel interesting!

I set the start time of this contest as 13:30 UTC. If you have no time in this time slot, don't be sad. You still can choose any time after that to enjoy the contest.

UPD: Reminder : The contest will start in around 6 hours from now.

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

| Write comment?
»
7 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Auto comment: topic has been updated by dreamoon_love_AA (previous revision, new revision, compare).

»
7 years ago, # |
  Vote: I like it +15 Vote: I do not like it

Contest starts in ~2 hours.

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

how to solve E and I?

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

    Roughly speaking, E can be solve by divide and conquer + segment tree with time complexity O(n(logn)2) and there are many similar problem such as ARC064 pF. This problem can also be solved with time complexity O(nlogn). But the detail of implementation is quite hard and I guess the constant in time complexity is large. If you have interesting in such method, you can read this paper.

    I can be solved by connecting leaves from bottom to up greedily.

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

      I have invented a brute_force idea and AC problem E..

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

        In fact, when we were testing problem, peter50216 also give a not clear time complexity algorithm and pass all tests. But I think it will take much time to do that, so I determine to ignore this reality situation >_<

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

          I have generate a test that my code will TLE out of 10s

          n=99998;
          td=bd=0;
          for(i=0;i<n;i++)
          {
              if(i<=n/4)
                 per[i]=n/2-2*i;
              else if(i<=n/4+n/4+n/4)
              {
                 if(i%2==0)
                 {
                    per[i]=n-td;
                    td++;
                 }
                 else
                 {
                   bd++;
                   per[i]=bd*2;
                 }
              }
              else
              {
                 per[i]=n-td;
                 td++;
              }
          }
          
          • »
            »
            »
            »
            »
            »
            7 years ago, # ^ |
              Vote: I like it +19 Vote: I do not like it

            and I think I must implement link cut tree to get a

            reasonable time complexity ,but it is too complex

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

      I think the method given in that paper is not correct. It uses a divide and conquer method and claims that the contribution of the "left" to the "right" can be computed in linear time. Let {a1, a2, ..., ak} be the points whose DP values are used to compute point b's DP value (in the naive DP solution of problem E). Let ai + 1 be the "father" of ai for any b and i. The paper claims the "father" relationship induces a forest. But this relationship is not well-defined. Although one point a can have at most one "father" considering all different b's, whether it has a "father" or not differs.

      (This gives a simpler algorithm based on that one in the paper that works in time?)

      UPD: I implemented this algorithm and it works fast. (http://codeforces.com/gym/101234/submission/24290713) My algo is similar to the one in the paper except for the part for which I used dsu costs only constant time in that paper. Could you guys implement the paper's algo proving my being wrong?

»
7 years ago, # |
  Vote: I like it +10 Vote: I do not like it

I thought that E and I were haredest problems. and A and F were interesting. I solved E with sqrt decomposition and I with Tree DP. O(N (log N)^2) solution of E looks interesting. I think it was a great contest. Thanks for exciting problems!

  • »
    »
    7 years ago, # ^ |
    Rev. 2   Vote: I like it +5 Vote: I do not like it

    E can be solved by link cut tree O(n*log(n)^2) if you use divide and conquer and record virtual edge it will be O(n*lg(n)) and will be easier than link cut tree. I hope admin can add some tests and challenge my solution..

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

Is there a reason why the contest is not accessible anymore?

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

wonderful mromlems

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

Could someone tell me how to solve G? I want to solve it with binary search but get TLE on test 3. Thanks a lot!