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

Автор ToniB, история, 15 месяцев назад, По-английски

Hi everyone!

The fourth round of COCI will be held tomorrow, January 25th at 14:00 UTC. You can access the judging system here. If you are not familiar with the COCI contest format, we encourage you to read the announcement.

The round was prepared by fbabic, vito1036, cel.in, psruk, and me.

Feel free to discuss the problems in the comment section after the contest ends.

Hope to see you tomorrow!

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

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

Hi. The contest doesn't show up on evaluator.hsin.hr . Is this normal?

Thanks

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

how to do p5 T-T

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

    The edges without cats on them form a tree with a cycle (there are n edges and any node can be reached from any other node). The edges with cats form a directed graph. You need to add some edges from the tree to the directed graph & orient them such that there is an eulerian cycle in it. The condition for a directed graph to have an eulerian cycle is for the indegree of each node to equal its' outdegree and for the graph to be connected when ignoring orientation (except for some isolated nodes).

    First, remove one of the edges from the cycle so that the tree is actually a tree and solve separately for the 3 cases (omitting it, orienting u -> v, orienting v -> u). Then just process the tree in post DFS order (so, starting with the leaves) and decide what to do with the edge from this node to its' parent (if indegree == outdegree do nothing, if outdegree == indegree-1 add the edge u -> parent, etc). At the end check if the graph is connected and all the degrees match. Answer the minimum of the 3 cases.

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

I noticed that for P4, the difference between a set and ordered set is the difference between 105 points and 120 points. So very weirdly an ordered set would be faster than a regular set in this case. Does someone know the reason for this.

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

Can anyone help me with P4? I just think that we should move the shoes into the hallway whenever you want, but when the hallway is full, I don't know what shoes should I remove. Thanks!

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

    Unfortunately, the official solution for problem Cipele is wrong. Three people from the organization committee came up with the solution based on the same incorrect observation, and somehow it managed to go through. The incorrect observation we all had was: If the hallway is not full, we will put shoes in it. If the hallway is full we return the shoes that will be used latest.

    This is the example that fails:

    5 1 7

    1 5 4 1 3 2 5

    Here it is optimal to keep shoes with label 5 in the hallway instead of shoes with label 1. We have not found any other "greedy-like" observation that fixes this problem. If anybody thinks that the problem is solvable and has a solution for it, I would be glad to hear it.

    I want to apologize in my name and the name of the whole organization committee for the inconvenience.

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

How to do p4? Is it:

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

Does anyone know how to solve subtask 1 (n <= 20, m <= 20) of problem 5?

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

    Hi, the model solution is relatively simple for this subtask. Try all subsets of N roads and add them to the directed graph which already has M edges. Afterwards, check if there exists an eulerian cycle in the newly formed graph. At the end print the minimal size of the subset which formed an eulerian cycle.