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

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

We invite you to participate in CodeChef’s May Lunchtime, this Monday, 31st May, from 8 PM — 11 PM IST. Note the change in date and time.

There will be 7 problems in Division 3/2 and 6 problems in Division 1.

The May Lunchtime will have Junglee Games as the official contest recruiter! They are looking for SDE II & III Backend, SDE II & III Data, and SDE II Frontend roles for their fast-paced environment.

Joining us on the problem setting panel are:

Problem Submission: If you have original problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Prizes: Top 10 Indian and top 10 Global school students from ranklist will receive certificates and CodeChef laddus, with which they can claim cool CodeChef goodies. Know more here.

The video editorials of the problems will be available on our YouTube Channel as soon as the contest ends. Subscribe to get notifications about our new editorials.

Admin Note: Special thanks to Um_nik for his help in selection/improving the problems. This Lunchtime has a replay of some of the problems used in IOITC Day 1/2 (Final Selection round of Indian IOI Team). Thanks to all the testers who tested the IOITC as well!

Good luck and have fun!

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

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

As an official participant of the IOITC, the problems are very interesting and you will enjoy solving them.

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

Reminder 1 — Contest starts in an hour.

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

Top mysteries of the world - 1. Bermuda Triangle 2. What Interactive MST statement meant.

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

Since the tutorial are not available yet...

I would be happy to read something about SIMARRAY How to solve the simplest case, N=2?

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

    For N=2, what I did was I fixed my R1 and then tried to calculate R2 using it.

    I looped my R1 from 0 to 1000,adding 1e-5 after each loop,now since R2<=R1, I calculated the value for which (A2-R2*B2) gives 0 which is A2/B2.

    Now if R1>=(A2/B2) , we can always set R2 to be (A2/B2) which will always give the term (A2 — R2*B2) to be 0. And if R1<(A2/B2), it is optimal to take R2=R1 because that is the nearest value from (A2/B2).

    Now I find the minimum from all the different R1's.

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

    For N=2 there are just 2 cases -
    R1=A1/B1 and R2=A2/B2 in this case if R1>=R2 answer is zero.
    Otherwise R1=R2=r.
    We can write error as (A1-r*B1)^2+(A2-r*B2)^2.
    In this case, it's a quadratic equation in r. You can check on the internet how to find the minimum.

    A hint for subtasks 3 and 4
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

in the last 10 min I fell down 500 ranks -_- I solved A, B, C completely in div 2

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

is there any way to make codechef all contest reminder in my google calender, i just missed luchtime feeling sad :(

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

How to solve interactive mst ?

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

    If there is $$$ \gt 1$$$ bridge, answer is $$$-1$$$ else its possible. Query all cyclic shifts of $$${1, 2, 3, \dots, m-1, m}$$$. If $$$e$$$ is not a bridge edge, then it'll appear in the cyclic shift starting at $$$e$$$, but not in the cyclic shift starting at $$$e+1$$$.

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

    If the weights of all edges of the graph are distinct, then MST is unique.
    So I queried for the weights as 1, 2, 3...m, then m, 1, 2, ..., then m, m — 1, 1, 2...
    Now just forget the first edge (in permutation), then we can see the MST for the rest of the edges is unique. Now there are two possible cases:

    Case 1: The left out edge for two consecutive queries is the same, in this case, we can conclude that it's a bridge because when we assigned it the smallest weight of 1, and when we assigned the largest weight of m, in both cases it's present in MST, but we don't know which one so we just increase the counter of bridges.

    Case 2: If the left out edge is different in two consecutive queries, then we know the edge in the previous query should be the element in a permutation (for the previous iteration).

    Now we can also prove that there can be at most 1 bridge. Because if there are two bridges they will always be included in any query and they can appear in any order so we can never decide. But if there is 1 bridge we can assign the left out edge from 0 to m — 1 and if there are no bridges then the above algorithm will find all permutations.
    My submission — https://www.codechef.com/viewsolution/47278598

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

Can K-Subarrays be solved with DP Convex Hull Optimization?

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

CHESUB is the same as this PROBLEM, but with exactly $$$k$$$ transactions and incorporation of $$$i$$$ factor in summation.

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

Am I the only one who still can't understand what the problem 'Interactive MST' mean.

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

Where can I find the editorial for TRTOKENS?

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

CodeChef_admin Where is the editorial for PARTODD? I can't find it here.