

Educational Codeforces Round 146 Editorial
source link: https://codeforces.com/blog/entry/114854
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

38 hours ago, # | I know it isn't an "issue", but in problem B the variable names are a,b while here they are n,m |
34 hours ago, # | In problem B, My thought was ternary search since the values tend to decrease at first and then increase but the problem I faced is that around the middle of the curve, the values don't necessarily keep changing in the same way (X-axis for max K length and Y-axis for cost) ![]() As you notice some irregularities, can this be handled using only ternary search or by iterating over a much smaller range of K's? |
-
I tried a weaker 1-D case (go from 0 to n)
there seems to be the best leg size. (floor or ceil I don't remember)
(somewhat related to the fact that minimizes at and
similar is the case with )
But ofc the problem is going up a notch to the 2-D case.
(new to code-forces and I don't know how to write in laTex etc, pardon me for that).
29 hours ago, # | problem EF video solution for Chinese: |
26 hours ago, # | Can anyone please elaborate on the solution of Problem D, please? |
25 hours ago, # | First question can be directly solved using concept of LDE Let g = gcd(2,k) If(n%g == 0) cout<<yes<<endl; Else cout<<no<<endl; Am i wrong ??? |
-
Perhaps, but I am not sure. According to this: https://cp-algorithms.com/algebra/linear-diophantine-equation.html#finding-the-number-of-solutions-and-the-solutions-in-a-given-interval
If you have a solution (for which your check should be okay) you have infinitely many. However, I think we would also have to check if there is such a solution pair where both x and y are non-negative.
23 hours ago, # | A can be solved by just checking parity of n and k
|
-
Can you please give an explanation of this? Also, what is meant by parity check?
23 hours ago, # |
can anyone please explain me why this code will not work for problem B? |
19 hours ago, # | Can anyone tell me why we need to fix the value of K in B. |
18 hours ago, # | E Has a nice observation, we would never take 3 consecutive edges. Any elegant solution using this observation. (Take , NotTake, Take) is better than (Take, Take, Take) and both achieve our goal. f(i) = min(2*e(i,i+1) + f(i+2) , 2*[e(i,i+1)+e(i+1,i+2)] + f(i+3)) |
16 hours ago, # | Solution to problem B seems pretty complicated. Can someone please explain a simpler approach? |
-
It's not difficult. You should just know the answer is when you add your feet to k long. Then if you remove the ceil, you can get , it's just an inequality when the equality is achieved. Therefore, for this function, it's , .i.e . So , you can get the smallest value. However, you remove the ceil, so there maybe 2 off the correct answer. You should check around. Anyway, 1e5 is enough.
</div
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK