Блог пользователя code.degub

Автор code.degub, история, 5 лет назад, По-английски

Guys please share your approaches for the problems you solved. How many did you guys solve?

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

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

Can anyone share the problems?

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

How to approach the problem with the rocket jumping in powers of two? I tried simulating it with bruteforce but always WA

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

    In that you could easily compute xj array and let dp[i] be the answer for musk rocket to come at i hence the problem reduced to for each i given k disjoint intervals [l_i,r_i] and value of k would be atmost 20(actually less than that too) and if we are at i then just update all the intervals that could be done by segment tree or fenwick tree but could also be done by some ranged update in a query (like updating for [l_i,r_i] by adding dp[i] to it ->dp[l_i]+=dp[i] and dp[r_i+1]-=dp[i] then if we are at i then we no the answer available at i by just summing over values before that or just adding the initials.

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

To solve DP integers: I just applied dp with recursion:

f(a, b) = min{

if (a == 0 and b == 0) return 0;

if (a != b) return f(sqrt(a*b), sqrt(a*b) + 2;

if (a > 0) return f(a/2, b) + 1;

if (b > 0) return f(a, b/2) + 1;

}

To solve Two summations: Used greedy: sorting.

Observation: a_i + b_j dominates b_i + a_j when a_i + b_j > b_i + a_j

Rearrange the equation and apply sort function.

a_i — b_i > a_j — b_j

After sorting, calculate the contribution of each number, since i < j and j will dominate i.

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

Where I can see scoreboard or standings ?

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

I solved 3. A lot of people whom I know solved 4 or more.

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

Can anyone share the approach for the last problem?

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

My friend has received an email stating the test cases of DP integers have changed,before for 0 0,output was given as 2 and I think everyone wrote the solution accordingly,but then after the contest I came to know that it was changed,is there anyone with the same scenario ?

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

This contest was a crap. Wasted 4 hours

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

I had solved first, second and fourth partial. For the first I had just checked if string length is greater than 3 and if s(I) == S(I+1) or S(I) ==S(I+2).

For. The second I had separately handled four corner cases and for rest cases just found out operation required to turn minimum of two number to zero and add 2 to it

For fourth partial brute force

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

Can anyone suggest approach for two summation and swap it harder?

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

    This is the solution for Two Summation

    First, in these types of problems, you should try to simplify as much as possible. Let's go through the solution.

    Part- I
    Part- II
    Part- III
    Optimization
    Example
    A Little More Observation
    Final Answer
»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -8 Проголосовать: не нравится

x

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

crappiest contest wasted 4 hours solved first three only to learn test cases for problem 2 changed and for problem 3 test cases were super weak and wrong . no learning

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

Can anyone help with the logic of the shipment packaging question?

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

Does anyone know when will they release standings?

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

I have received one mail (some days back) regarding another contest of Codeagon on 17th October. But since then, I haven't received any further notifications. Has anyone else got it? image

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

When we can expect results of codeagon 2021 ?