k790alex's blog

By k790alex, 9 years ago, In English

Hi,

Tomorrow is the Latin America Regional Contest, there is an online mirror prepared in UVA, you can see your local time here.

Good luck to all participants.

Update: Here are the live-scoreboard:

Latin America

Carribean

UPDATE 2:

Final results:

Mexico and Central America

Caribbean

Secret IO: http://maratona.ime.usp.br/resultados15/

UPDATE 3 Brief editorial in Spanish: http://caloventorendos.blogspot.com.ar/2015/11/regional-latinoamerica-2015-solucionario.html

UPDATE 4 Detailed editorial in Spanish: https://chococontest.wordpress.com/2015/11/23/solucionario-regional-south-america-2015/

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

| Write comment?
»
9 years ago, # |
Rev. 4   Vote: I like it +9 Vote: I do not like it

For those of you interested, you can now try the problemset at UVA (problems are numbered from 13003 to 13014). Also, since I haven't found any editorial yet, it would be awesome if we could all share ideas about our solutions (pretty much what happened last year at http://codeforces.me/blog/entry/14650).

  • »
    »
    9 years ago, # ^ |
    Rev. 3   Vote: I like it +51 Vote: I do not like it

    Don't have the time to write a full editorial, but some hints for each problem:

    • A: either greedy or digit DP works
    • B: bipartite matching from parents to possible genes
    • C: circular line sweep
    • D: implementation
    • E: any connected component of the graph has only two possible states. Then use knapsack DP to find best possibility.
    • F: point in polygon test by ray drawing. Do a line sweep and use a data structure to keep how many edges you will cross if you trace a ray at height Y.
    • G: function is convex so ternary search works
    • H: ad-hoc, look at the possible faces on each side of a cube
    • I: ...yeah
    • J: hardest problem of the set (again). Both teams in Brazil printed the values using brute force and found the pattern, but finding it legitimately is quite difficult. Try to find a bijection between every possible just a bit sorted sequence of length n and every possible permutation of the integers from 1 to n.
    • K: find a DP relation, then optimize the time to do the transition by using a logarithmic data structure to find minimum in an interval (segtree, bit, etc)
    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it +35 Vote: I do not like it

      Codeforces really needs a mobile compatible website... u.u

      I'll edit the formatting when I get to a PC.

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

      As helpful as always ffao, thanks! By the way, secret test data has been released and can be found here.

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

      Nice solution to J in the editorial! Since it didn't explain the DP solution I was referring to (it also needs some bijection magic, sorry), here it is:

      Take any just a bit sorted sequence with n elements and using exactly k different integers, for example "2 1 3 2" and list the positions in which 1 appears, let this list be L1 = {2}, then similarly get L2 = {1, 4} and L3 = {3}.

      Now concatenate these lists in reverse order (that is, L3 then L2 then L1) to get the new sequence (3, 1, 4, 2).

      This new sequence is a permutation of the integers from 1 to n, in which pi > pi + 1 for exactly k - 1 values of i. Doing the reverse procedure, you can see every just a bit sorted sequence is equivalent to one permutation like this.

      But the number of permutations with n elements such that pi > pi + 1 for k values of i is easy to count using DP. To construct the recurrence relation, note that adding n to a permutation of length n - 1 always creates a new spot in which pi > pi + 1, except if you place it in a position where that condition was already true or at the end of the sequence. This gives us:

      A(n, k) = (n - k) * A(n - 1, k - 1) + (k + 1) * A(n - 1, k)

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

      On problem K my relation is to check all the possibilities of shop on the current level, is that correct?

      I guess this is the relation but if i use memo on this relation i'll get Runtime Error on a big case and WA on an avarage case.

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

      Hi ffao,

      I thought of using ternary search to solve problem C and found that it is also mentioned in the editorial. Can you elaborate more on how to use Circular Line Sweep to solve the problem?

      Thanks

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

    This editorial has just been published. It's in spanish tho.

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

I do like when people log errors to the browser, lol!!!

Server Error