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

Автор awoo, история, 14 месяцев назад, По-русски

2070A - FizzBuzz Remixed

Идея: BledDest

Разбор
Решение (BledDest)

2070B - Программа робота

Идея: BledDest

Разбор
Решение (Neon)

2070C - Ограниченное перекрашивание

Идея: BledDest

Разбор
Решение (awoo)

2070D - Прыжки по дереву

Идея: BledDest

Разбор
Решение (Neon)

2070E - Игра с двоичной строкой

Идея: BledDest

Разбор
Решение (BledDest)

2070F - Друзья и пицца

Идея: BledDest

Разбор
Решение (BledDest)
  • Проголосовать: нравится
  • +11
  • Проголосовать: не нравится

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

From this round I received an important tip: You don't need to read the statement incorrectly. You need to read the statement correctly.

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

For A: just print 3 * (n / 15) + min(3, n % 15 + 1)

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

Btw in the editorial algorithm complexity is O(n), not O(1)

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

    It's probably because before looping through n, there is n %= 15, which ensures that n is always less than 15. Since increasing n doesn't affect the code's execution time — hence O(1).

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

Why did my submission 308279845 for problem F result in a Denial of Judgement? The testcase information indicates "Generator is not determinate."

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

I don't think question E should be in this position

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

Small mistake in problem A's tutorial: it should be $$$n/15$$$, not $$$n15$$$.

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

A is just — 0 1 2 15 16 17 30 31 32 45 46 47 ....

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

seems like I'm the only one who printed n/15 + (n — 1)/15 + (n — 2)/15 for A lol

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

It seems like problem F has a problem with generator for the 64th test.

Could you check it please?

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

How can we calculate OR Convolution using FFT?

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

there is a tiny mistake in tutorial of F:

"We need to make a convolution for which some bits (represending even-sized pizzas)"

might be "representing".

not very important.

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

Can anyone explain me the problem D

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

    Acknowledge that you can get to a node with depth d from all nodes that are above it with the exception of its parent node. We can calculate the number of ways to get to a specific node (lets call it dp[n] for node n), and for each node, calculate the number of ways to get to any node such that the depth is 1 less than it, then subtract the number of ways to get to the parent node. Rest of the solution is just impl and caching ways to get to all nodes of a certain depth. For a much easier variation on this problem, try a problem like https://leetcode.com/problems/climbing-stairs/ (easier) or https://www.codewars.com/kata/647d08a2c736e3777c9ae1db (a bit harder), same general idea, but with a much simpler implementation

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

In B problem, why are we iterating over the string only "once"?

Isn't it possible that the robot reach zero after two or more executions of the MOVES? Like when x is really far from 0, say -100 and the moves are like "RRL".

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

Any better intuitive approach for E?

I can't seem to see any possibility that I would build a solution as given in the editorial during a timed contest.

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

for E (c0>=3*c1+2 or c0==3*c1-1) is enough for player 1 to win otherwise player 2 wins

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

I don't get the solution for C at all. It seems like it completely ignores the possibility that we might want to color some red blocks to minimize the penalty even though first test example in the problem statement does so... Test:

6 1

BRRRRB

100 1 1 1 1 100

As far as I can tell, the best operation for this test is to paint the entire strip blue so we cover both 100 and the penalty is 4. If I feed this test into solution code above, output is 1. And it still gets accepted. How?

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

Guys how like how tf you guys manage to even understand the 4th test case in problem C?...Yeah I know BS is to be applied since min-max is been asked but again how tf ?