# | User | Rating |
---|---|---|

1 | tourist | 3735 |

2 | MiFaFaOvO | 3681 |

3 | Um_nik | 3553 |

4 | Benq | 3376 |

5 | ecnerwala | 3295 |

6 | maroonrk | 3229 |

7 | TLE | 3223 |

8 | Radewoosh | 3216 |

9 | scott_wu | 3209 |

10 | Petr | 3205 |

# | User | Contrib. |
---|---|---|

1 | Errichto | 200 |

2 | antontrygubO_o | 191 |

3 | pikmike | 188 |

4 | Monogon | 184 |

5 | Ashishgup | 182 |

6 | vovuh | 181 |

7 | Um_nik | 179 |

8 | Radewoosh | 174 |

9 | SecondThread | 172 |

10 | McDic | 161 |

I observed a weird thing today in the Visual Studio IDE while solving the second question of Hourrank 25. This the the code.

On my local machine, the value of pre[0][0], automatically becomes 1 randomly anywhere inside the while loop. However, the weird thing is, if I initialise the value of fact[0] to 0, then everything becomes normal again. This is weird because the computation of fact has nothing to do with the value of pre[0][0].

I feel silly asking this, but what am I missing? The code which is giving wrong answer on the local machine , gives the correct answer on Ideone, and also fetches full marks after submission.

Can someone please help.

Thanks. Peace.

Let's discuss the hackerearth december circuits here.

The link to the competition is this.

This problem was the 6th problem in the last Educational Round. It requires the use of bitmask dp. I read through the editorial, but I can't understand, how the dp states are being defined. It would be really nice, if someone could help me with that.

Peace.

This was the fourth question in the November Lunchtime. I am not able to understand it, even after reading the editorial. Can someone please explain it in a bit more detail?

Contest link Problem Link Official Editorial Link Unofficial Editorial Link

I can not udnerstand anything in the official editorial.

I can't understand the dp states in the unofficial editorial, and also how to use the treap data structure being discussed in the editorial.

Why am I getting WA in this code?

I am dividing 'x' by all the prime numbers. To find the prime numbers, I am using the sieve. I know, it can be done without using the sieve, but when I am using the sieve, I am getting WA. Can someone please help ?

It would be really kind if someone could point out the bug.

Can someone give hints for the third and the fourth problems for the Codechef October Lunctime.

This is the problem link. This is my submission. It is getting TLE. I read another guy's recursive approach. It got full points. I don't understand, why this code is getting accepted, but mine is not.

Any help would be really appreciated.

Peace.

The problem is this.

After going through the tutorial, and through the discussions, and reading a lot of submitted solutions, I am not exactly able to grasp the concept behind this problem.

I am pretty sure, there's some underlying topic, which I am unaware of.

Can someone please suggest some underlying concepts to better understand this problem? It would be really kind.

Thanks.

This is the problem .

According to the accepted solution of other coders, the following test case gives a "Yes". But, shouldn't it give a "No" ?

6 1 2 1 1 1 1 1 1 6

Any help would be really appreciated.

The question is 459C.

I have understood the logic behind it. But, in order to generate the possible permutations, I am using DFS.

It gives a WA on test 7, saying that my code prints ":". But, I am not printing ":" anywhere in my code.

Any help would be really appreciated.

The problem is this.

The editorial says this:-

We need some observation: There exists an optimal solution such that: in any pile, the box on the higher position will have a smaller strength.

Let k be the minimal number of piles, then there exists an optimal solution such that: The height of all piles is n/k or n/k+1 (if n%k=0, then all of them have the height n/k).

We can prove them by exchange argument: from an optimal solution, swap the boxes in it to make above property holds, and we can ensure it will remain valid while swapping. Then for a given k, we can check whether there exist a solution: the i-th (indexed from 0) smallest strength needs to be at least i/k. So we can do binary search (or just enumerate, since n is only 100) on k.

Doubt:

Why does the ith index need to be atleast i /k ?

I am getting a WA on this problem. Can someone suggest, what is wrong with my logic?

Problem: http://codeforces.com/contest/85/problem/C

My submission: http://codeforces.com/contest/85/submission/30241748

I am getting a WA on test 9 on this DIV 1A.

Is there a problem with my 'poss' function or the very dfs function itself?

This is my submission.

The question is this.

The solution is something like this:

dp[1] = 1, dp[2] =3 ;

for(int i =3; i <= n ; i++) dp[i] = dp[i — 1] + dp[ i- 2] + 2;

How did one come with the formulation dp[i] = dp[ i — 1 ] + dp[i — 2] + 2 ?

Any help would be really appreciated.

Peace!

Is anyone able to see the test cases on the submitted solutions?

Can someone from Codeforces comment on how long will we have to face this problem?

I thought this was a temporary glitch :-(

The question is this-> 757C

I am unable to understand anything in the editorial, as well as the given code. Can someone please help?

I am solving this DIV 2C. This is my submission which got accepted.

My question is this:

Why isn't updating the parent of a node, an O(n) operation ?

I am getting "Accepted" when I am using C++ lower_bound function -> Submission

I am getting wrong answer using the binary search -> Submission

Can somebody please help?

I am getting a WA on testCase 6.

Question — Div 2C

Can someone please tell me what's wrong with the code?

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Aug/03/2020 17:42:37 (h2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|