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

Автор lukasP, история, 11 лет назад, По-английски

NCPC (Nordic Collegiate Programming Contest) will be held on Saturday and you will be able to participate in an online contest with the same problem set. The online contest will start at 11:00 and end 16:00 CEST on Saturday, October 10.

The contest will be held at open.kattis.com and you can participate in the warm-up contest in the mean time.

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

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

is it possible that problem set be moved to gym codefoces?

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

My previous years experiences are telling me that I can recommend this competiton :).

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

So is the online contest an individual contest or team contest?

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

This is a reminder that the contest starts in about 2 hours.

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

Any idea where I can ask for clarifications? It is unclear to me in the problem Floppy Music whether the motor can sit still for one second or not.

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

Problem B. In the picture, there is a transition from 1 2 4 3 6 5 back to 1 2 3 4 5 6. Do we have to be able to go to the initial position like this? The statement doesn't have any information about that.

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

what is the right approach to solve E . end time sorting didn't pass :(

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

    A possible approach would actually use end time sorting, though you would have to be careful with how you handled the fact that there can be k recordings at the same time (which translates to k intervals at the same time).

    So one way to do so would be to use a set (or rather, a multiset) to hold the last k end times of the last recorded show in each slot (in the beginning initialize it by inserting k dummy values, like -1). Now whenever we are processing a new show/interval we need to select the slot which has the latest last recording, but that ended before the beginning of the current show/interval. This can be done using binary search (using the lower_bound method). Finally, if we find a suitable slot, we replace its last recording and update our counter of recorded shows, otherwise we discard this show/interval and move on to the next show/interval.

    This is simply an adaptation of the "classic" greedy method for interval scheduling with a twist.

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

I liked B, the problem sounds like there could be a multitude of solutions, how did you guys solve it? This was my solution: We store the solution as a sequence of permutations, each defined by a vector of disjunct transpositions. Hardcode the solution for n ≤ 3; if n ≥ 4, apply the following algorithm: enumerate all permutations on n - 1 items, and if at some point we have an item at position n - 1 that has not been the last element yet, and the next permutation won't move this element, then we combine this next permutation with the transposition (n - 1n), and then make a full cycle through the permutations on n - 1 items, swapping n - 1 and n again during the last permutation. So if the current permutation is Pi, we apply .

It's pretty fast, 0.03s on Kattis, here is the code: github.

EDIT: For this technique it's important that you store exactly n! collections of transpositions, i.e. if you apply them all, you end up with the identity permutation.

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

Can someone explain the solution of A? I've looked at the solution slide, but I didn't understand it (except the first insight; I've already found it).

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

Everything relevant is published at http://ncpc.idi.ntnu.no/ncpc2015/, even the wrong solutions, input generators and problem statement sources in TeX. Some inputs even have ".desc" files describing the input as well as PNG images illustrating the optimal solution. The PNG images are especially helpful for solving iCar.

The contest has been uploaded to the gym by Temirulan.