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

Автор KAN, 6 лет назад, По-русски
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
  • Проголосовать: нравится
  • +182
  • Проголосовать: не нравится

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

Good!

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

For problem Div2 E, 99886275 is just so cool.

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

Thank You.

Nice Problemset — problems were to the point and good.

I really liked it.

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

I used dictionary tree to passed the div2 D, I can guarantee its correctness, but I can't guarantee its time complexity,can anyone hack my solutions? https://codeforces.me/contest/1457/submission/99900717

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

In Div2D, why is n<=60 if the given condition is true?

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

Me when doing normal rounds: So I will try to do problems in order, if I can't do A in 30 minutes then I will consider B...

Me when doing russian rounds:

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

For Problem B, n is <=10^5, test cases are <=10^4 and no. of colours are <=100. How is 10^11 (that's what I can interpret) solution works??

If some one has any explanation and would like to correct where I am wrong, it will be great :)

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

    It is guaranteed that the sum of n over all test cases does not exceed 10^5.

    So when value of n is 10^5 then no. of test cases will definitely be 1. When test cases are 10^4, then value of n in all test cases are such that their sum will be atmost 10^5.

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

    There is a statement, "Sum of $$$n$$$ over all test cases doesn't exeeds $$$10^5$$$". That basically means $$$t*n \lt =10^5$$$. So, overall operations doesn't exeed $$$100*10^5=10^7$$$ which is acceptable in the given time limit.

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

I did not see that B had only 100 colors :/

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

I am still confused in Div 2D.

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

plzz anyone can explain div2 D. why n<=60

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

Thanks for detailed explanation of Div2E!

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

For Div 2 Problem A, this is my code

Code

I have calculated the Manhattan Distance of the cell (r, c) from each of the corner cells, and printed the max distance. My code is giving wrong answer on test 2. Can anyone tell what's wrong in my code?

»
6 лет назад, скрыть # |
← Rev. 4  
Проголосовать: нравится +3 Проголосовать: не нравится

for D, I brute forced subarrays of size <= 31, then brute forced again on the "split point". for example, if i have a subarray i...j and a split point of k, we xor the range from i...k and k+1..j. then, we check if the sequence we made decreases at any point. why does this work? I used the claim that there does not exist a construction where we have to make > 29 moves.

https://codeforces.me/contest/1457/submission/99871104

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

Nobody found the $$$O(N)$$$ for div1D?

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

    how to solve div1D in $$$O(N)$$$ ?

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

      For each situation where you just took the $$$i$$$-th thing, find the set of positions of the clone. For each situation where the clone just took the $$$i$$$-th thing, find the set of your positions. In the first case, it's a contiguous range, which means it has to be up to 2 contiguous ranges in the second case. There's a lot of possible transitions from $$$i$$$ to $$$i+1$$$ but it's a constant number and each takes constant time.

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

Can anybody explain the prefix suffix method used in division 2 in D-problem?

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

Is it only me or Div1 E editorial is cryptic.

"Let call low bits that we don't need to care free bits." — can you maybe give an example.

What is A there?

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

in div2C,why the answer of 2 2 1 10 11 1 is 11,if i make the 0 to 1,it just take 1 second

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

    This is your test case:

    n = 2, p = 2, k = 1; s = "10"; x = 11, y = 1.

    x is the cost of adding a platform, y is the cost of removing the first cell. In your case, there is only 1 option: that is to add a platform at position 2, giving 11 as your answer.

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

KAN For div2 D, the editorial states the following:

Indeed, there are no two integers with the same highest bit set. It is much easier to solve the problem in such constraints.

I think it should be stated as: there are at most two integers with the same highest bit set. Right? Because for input [1, 6, 7], the highest set bit of all numbers are different but 6 and 7 have the same highest set bit.

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

How is the space complexity for div2B O(N) ?

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

It is good tutorial.

Kindly do mention the code also. Sometime explanation is not sufficient

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

Could someone please explain the dp approach to div2 C?

  • »
    »
    6 лет назад, скрыть # ^ |
    ← Rev. 3  
    Проголосовать: нравится +1 Проголосовать: не нравится

    https://codeforces.me/blog/entry/85081#comment-727466

    Spoiler
»
6 лет назад, скрыть # |
 
Проголосовать: нравится +18 Проголосовать: не нравится

It seems that the standard program to the Div.1 D has something wrong
https://codeforces.ml/contest/1456/hacks

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

What would be the difficulty level of XOR gun?

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

Nice trick in problem Div2D =)

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

Sorry for my stupid, it's a little hard for me to understand Div1E solution, can someone explain it easily? thanks!

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

1415B - Repainting Street

Can somebody explain why test case 3 in test 2 (below) says right answer is 2 days? If we choose any color (e.g. 1), there are only 6 houses, which are not this color. So, with capacity k=6 one day should be enough to paint. Looks I am missing something, but don't get what.

9 6
1 2 3 1 2 3 1 2 3
»
6 лет назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

Hey guys, here is my video proof for "Genius Greedy" in Problem E using induction hypothesis. Anyone who is interested can take a look