ikrpprppp's blog

By ikrpprppp, 5 hours ago, In English

1995A - Diagonals

Hint
Answer to Hint
Solution

1995B1 - Bouquet (Easy Version)

Hint
Solution

1995B2 - Bouquet (Hard Version)

Hint
Solution

1995C - Squaring

Hint
Answer to Hint
Solution Integer
Solution Float
Code Integer
Code Float

1995D - Cases

Hint 1
Hint 2
Answer to Hint 2
Hint 3
Hint 4
Hint 5
Solution

1995E1 - Let Me Teach You a Lesson (Easy Version)

Hint 1
Answer to Hint 1
Hint 2
Hint 3
Answer to Hint 3
Hint 4
Solution

1995E2 - Let Me Teach You a Lesson (Hard Version)

Hint 0
Hint 1
Answer to Hint 1
Hint 2
Solution
  • Vote: I like it
  • +8
  • Vote: I do not like it

»
5 hours ago, # |
  Vote: I like it -9 Vote: I do not like it

Auto comment: topic has been updated by ikrpprppp (previous revision, new revision, compare).

  • »
    »
    77 minutes ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Access denied 2024-7-24 09:10:13

»
4 hours ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

was the 3 ^ C complexity for D intended here ? the constraints are way too low that it passes

272198648

»
4 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Sorry for still having questions about D. I understand till masking. All masked numbers are bad. For example like ABCDACDBBCDADA when k=4, consider D as the last digit, masked numbers are 1111, 1011, 0111, 1001, 1000. After that, we need to find a number a=xxxx, where a & all masked numbers>0. How do you figure out this step? I can not fully understand. Thank you for answering.

  • »
    »
    4 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    All the bad masks are the submasks of the inverted masks of k consecutive characters (in your case, inverted masks are 0000, 0100, 1000, 0110, 0111).

»
4 hours ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

for B2 can someone help me find a counter testcase for this submission

my appraoch : for each 2 consective X and Y , Y = X+ 1

we take as much X and Y as possible

if we can reduce one Y and Add 2*x ( when the money left + Y >= 2 * X ) we make this operation

https://mirror.codeforces.com/contest/1995/submission/272222265

  • »
    »
    4 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    for exp :

    m = 13

    4 5 4 2

    we take 2 * 5 first

    our curr ans= 10 & money left = 3

    moneyleft + 5 >= 4*2

    so we take 4*2 and reduce 5

    final ans = 4 + 4 + 5

»
4 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Man, I probably could have done better if I didn't try throwing FFT at C as soon as I saw it lol

»
3 hours ago, # |
  Vote: I like it +15 Vote: I do not like it

in B2 what is the intuition behind greedily taking flowers with X petals and then greedily taking flowers with X + 1 petals?

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

    Let the number of flowers with X petals in an optimal solution be A and the number of flowers with X+1 petals be B. Let the maximum number of possible flowers with X petals be C. It is clear that C >= A+B. I claim that in an optimal solution A+B = C. Why? Suppose C > A + B and the solution is optimal. The maximum number of petals you can have is (C-1)(X+1) petals. That is CX-1 petals which is smaller than CX so it isn't optimal. So C = A+B. By greedily replacing as many 'A's with 'B's as we can, we add 1 to the maximum number of petals.

    Not very intuitive, but in my opinion it somewhat explains why this greedy algorithm is true. Can someone also confirm if my logic is correct.

»
3 hours ago, # |
  Vote: I like it -11 Vote: I do not like it

lovely problems, especially E

»
2 hours ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Is $$$O(n\cdot2^c)$$$ intended to pass on D? 272115564

Either this should be hackable or provably lower complexity through optimization.

»
117 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it

Fast Editorial!

»
21 minute(s) ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Can someone explain the solution to C, why are we squaring the previous element value if its already less the current element value