Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

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

Автор MikeMirzayanov, 10 лет назад, По-русски

Добро пожаловать на 2014-2015 CT S02E11: Codeforces Trainings Season 2 Episode 11 (2011-2012 ACM-ICPC Latin American Regional Contest + Extended). Продолжительность тренировки — 5 часов. Тренировка открыта как для команд, так и для индивидуальных участников. После ее окончания вы можете дорешивать задачи тренировки или поучаствовать в ней виртуально, если не смогли принять участие одновременно со всеми. Пожалуйста, участвуйте в тренировке честно.

Так как это тренировка, то возможно набор задач будет расширен, если для значительного количества участников он окажется простым.

Условия задач будут на английском языке, ведь мы же готовимся к ACM-ICPC!

Удачи!

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

»
10 лет назад, # |
  Проголосовать: нравится +2 Проголосовать: не нравится

Will you or someone else answer the questions about the problems? Last gym I have a question but no one answer in the end...

»
10 лет назад, # |
  Проголосовать: нравится +14 Проголосовать: не нравится

thanks MikeMirzayanov for all contest in Gym :)

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

not able to download the problem statement

»
10 лет назад, # |
  Проголосовать: нравится -18 Проголосовать: не нравится

not able to download problems statement

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

How to solve D?

  • »
    »
    10 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    You have to create a trie for the portuguese words and a trie for the reversed spanish words, then, the number of words will be: (states of port trie-1) * (states of span trie-1)-(repeated words).

    You can find the repeated words by travessing both tries.

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

      I had a similar solution where I traversed the Portuguese trie, and if a node didn't have an edge for a letter C, then I added the number of Spanish suffixes starting with letter C to the answer (which can be easily computed by going through Spanish trie once). The logic is that all resulting words will be identified by their longest Portuguese prefix. The only exception are words that are actual prefixes of Portuguese words, but those are easy to deal with by making sure there is a Spanish word ending in its last letter.

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

How is problem J solved?

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

How to solve the problems B and H?

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

    To solve problem H you have to realize that for the condition to be held, the path must consist of bridges only. After you generate the graph of the bridges, the queries can be replaced by the question: Do S and T belong to the same component?

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

    For B, rotate the pyramid so that the top is in (0,0) and rows become diagonals. Now if you took the ball at (i,j), you also need to take all balls in the rectangle from (0,0) to (i,j). Now the problem can be solved with simple DP that answers the question for rows starting from i, and columns up to j.

    • »
      »
      »
      10 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Sorry but I'm a bit sucked. Can you provide the dp state representation and transition? thanks

»
10 лет назад, # |
Rev. 4   Проголосовать: нравится -13 Проголосовать: не нравится

F in all tests in problem C doesn't exceed 100, what is very strange due to statement 105 border =)

UPD: Sorry, but that was lie. Code with assert(f < 100 * 1000) gave me RE2. The mistake was in bad-showed test.

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

Why I got TLE on test 2 on problem A? I used O(n) solution.

http://codeforces.com/gym/100540/submission/8871278