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

Автор okwedook, 5 лет назад, перевод, По-русски

Привет, Codeforces!

Наконец-то я могу что-то вернуть этому прекрасному сообществу, поэтому я рад пригласить вас принять участие в Codeforces Round #703 (Div. 2), который состоится в 18.02.2021 17:35 (Московское время). Раунд будет рейтинговым для участников с рейтингом менее 2100. Участники из первого дивизиона могут принять участие в раунде вне конкурса.

Вам будет предложено 6 задач и 2 часа 15 минут чтобы их решить. Все задачи раунда придуманы и подготовлены мной. Одна из задач будет интерактивной, пожалуйста ознакомьтесь с гайдом для интерактивных задач перед контестом.

Я также хочу поблагодарить:

Разбалловка: $$$500-1000-(750+750)-1750-2250-3000$$$.

Не забудьте прочитать ВСЕ задачи. Желаю вам удачи и высокого рейтинга!

Я старался сделать хорошие задачи и понятные условия, так что надеюсь вам понравится раунд:)

История

UPD: Разбор

UPD: Winners and First to solve

Div1 + Div2

Место Участник
1 renascencepjw0510
2 dlalswp25
3 Bohun
4 kmjp
5 theodor.moroianu

Div2

Место Участник
1 renascencepjw0510
2 Quirrel
3 YuuKoito
4 _Nyusha_
5 JackF

Первое полное решение

Задача Участник
A king_of_tt
B IgorI
C1 dlalswp25
C2 dlalswp25
D Omer223
E lulzz
F JackF
  • Проголосовать: нравится
  • +908
  • Проголосовать: не нравится

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

As a tester, I must say problems are really interesting !! Good luck to all :)

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

My plan succeeded! Now I will always be the lexicographically first tester!

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

Did he really thank Anton w/o any jokes? :upside_down_face:

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

As a tester, good luck. You would need it.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +253 Проголосовать: не нравится
Whenever authors recommend reading ALL problems...
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +12 Проголосовать: не нравится

Looking forward to go gray in this round. This green is off-putting.

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

Chance for master xD

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

As a fellow victim of antontrygub I wish you a speedy recovery after the round

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

29 отклоненных задач это сильно, конечно

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

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

I request authors to disclose problems rejected by Anton.

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

okwedook Is it blue tears in ur pfp after rejection of 29 problems by Anton?

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

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

The KING of Ad-hoc is back again as a coordinator!

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

OMG 29 problems were rejected !! Can you share some of them after contest?

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

Scoring shows 7 questions but you said there will be 6 questions.

What is correct?

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

"My first message from message from MikeMirzayanov was more than a year ago!"

Shouldn't that be "My first message from MikeMirzayanov was more than a year ago!"?

Or is it a message from a message...:)

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

If Anton would have been rejecting 29 problems in 135 minutes of the contest time that would make "a speed of rejection" almost about a problem every single 5 minutes

(4.6551724137931... to be exact)
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +32 Проголосовать: не нравится

Problem D: Anton and Rejection

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

please tell how to solve "C" after contest:) Update::first tell how to solve "B"

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

Please notice the unusual Score distribution. i.e. it seems that C1 will be easier than B.

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

C is interactive. Change my mind.

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

I have some questions:

1- Can the rejected problem be modified and proposed again?

2- If not, can we have rejected problems in Gym added by setters?

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

Hope I get my green shade back this time

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

Score for problem C is 750 so it means it will be easier than the problem B (having score 1000)?

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

note: unusual duration XD

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

...

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

I hope you didn't set all math problems

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

Why I am not improving !!!?

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

Getting you have submitted the same code, but I haven't made any submission!!

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

I'm not sure what' happening. I can't seem to send a solution for A. It always says I have sent this solution before, but when I look in my submissions I don't see it. I don't see anything. I have tried putting random stuff in it, I have tried from another browser. Nothing.

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

IF I ask more than 40 queries in problem C1, what error will I get? I am getting TLE. I want to know if its due to asking > 40 queries.

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

I really appreciate the efforts behind setting these problems. Everybody knows it was interesting. However all the problems starting from A were of a slightly higher level than usual. I understand the need to set interesting problems. But div2 is literally the most frequent round that is held, which means it needs to be catering to most ratings atleast for the first 3 problems. In that aspect, I am forced to think this round was a failure. I might be just another noob but I have only solved the first problem. But I know for a fact that the rest weren't the same level as other div2 rounds.

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

Its time to leave earth (after seeing problems). Bye guys! Anyway problems were interesting :)

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

I wonder why antontrygubO_o didn't reject all of your problems :(

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

Problem D looks similar to this

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

A& B look like :

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

DifficultForces :(

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

After seeing the problems I am sure why @antontrygubO_o rejected all your questions last time (that was really a nice story). Ok but as you told the questions were really interesting. "! But you should be in between the difficulty level of div2 !" Very first time I am seeing that the contest blog page upvotes are decreasing after and during the contest.

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

what is pretest 5 for c1?

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

Pretest 4 for E?

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

damn, what's test 7 on D?

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

ONCE AGAIN EASY D (1750)

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

as a youtuber, here is the video solution to problem C2: https://youtu.be/TvosdMg9GXE
submission link: https://mirror.codeforces.com/contest/1486/submission/107881420

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

![ ](Screenshot-from-2021-02-18-22-19-46)

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

I bet all of my life on E, farewell everyone here!

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

Well, I learned that an array of 1 elements is in increasing order the hard way

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

Please help why i am getting compilation error in C1,C2 ? i think my code is fine , help needed ?

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

Will binary search on BIT work in problem D ? Gave wrong answer on test 4

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

How to solve B?

I thought iterating $$$x$$$ in $$$[median(X_i) - 100, median(X_i) + 100]$$$ and $$$y$$$ in $$$[median(Y_i) - 100, median(Y_i) + 100]$$$ would suffice the solution.

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

Reading the problem D: Aha! A similar problem, just use the sliding window medium

Few moments later: Why I always failed at pretest 7?

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

Damn I was just able to solve E theoretically with like 2 minutes left :((

Can someone tell me if this is the solution? You build a graph with V_even and V_odd. You run Dijkstra, but instead of updating the the distance of V_odd, you simply add all the options of parents to it, together with the weight of the edge and the weight of the last edge. Then when it's Vodd's turn, you go over all it's neighbors and choose the best combo of path + (edge1 + edge2)^2. The problem — it runs in m^2. The solution — w_i <= 50 so you don't have to save all the options, just the best option for every 1<=w<=50! then you iterate over all the neighbors at most 50 times

Is this the correct solution?

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

holly shit I got WA on pretest 2 on A don't know why then I jumped to B and didn't know how it could be solved then jumped to C and got TLE on pretest 4
I wish my meme is true cause I will lose 170 rating ugh that hurts

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

For problem D, this was helpful https://mirror.codeforces.com/blog/entry/21103

If you are need a test case that break your solution, these may help

7 4
5 5 4 4 4 5 5
11 6
5 5 5 4 4 4 4 4 5 5 5

And I foresee problem D will become yet another coding interview question.

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

Why am I getting idelness limit exceeded? 107863650

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

People like me, who had seen Cf Edu Binary Search step 4, can easily get the intuition for D. Loved the problemset. D was savior.

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

B killed me

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

Problem D is exactly the same as this one

For problem F, you can copy this code (statement: calculate how many pairs of paths intersect with each other) and 1336F - Journey then subtract the answer from the previous one.

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

Implemented some simple brute force in E which passed in ~800ms, now assume systest will make it fail. How to correctly solve E?

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

How to solve B?

I know it's lame to ask... but please, any short solution would work.

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

C was a really nice use of binary search. Hope pretests were strong enough.

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

Someone please tell me why my solution is wrong and the other solution is correct. http://mirror.codeforces.com/contest/1486/submission/107798098 http://mirror.codeforces.com/contest/1486/submission/107782432

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

For B question .. why does the count from avg-1,avg,avg+1 fails ?

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

    Average is not a correct answer to get minimum distance. For example, if we look only on X-axis and points at 0, at 4 and at 4 again, the average of them will be 8/3~2.66, but the best point to get minimum distance will be 4

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

      sorry but i forget to mention .. for cases with distinct nos like x[]=1,2,5,10,100; any intuitive/ mathematical proof ( generalized )

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

        In any case we need to use median instead of average. Lets imagine, that we have array of N different points and N = K*2 + 1 (just to make the explanation easier).

        Lets then pick median of this array as point P and calculate total distance to all points, it will be some number D. We may notice, that K points are to the left of P and K points are to the right of P. Denote distance to points to the left of P as D_left and distance to points to the right of P as D_right. So D = D_left + D_right

        Then look at neighbour point P - 1 and calculate total distance:

        New distance = D_left - K * 1 (because we reduced distance to K points by 1) + 
        1 (we increased distance to initial point P by 1) + 
        D_right + K * 1 (we reduced distance to K points by 1) 
        =
        D_left + D_right + 1 
        

        So by picking any other point then P we will increase total distance.

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

      i handled the repeating cases separately

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

    Take this array as example [2, 2, 11]. The avg is 5 which results in a total distance of 12. But if you use median instead of the avg, you definitely would get a better result. In this case when you choose 2 (which is the array's median) instead of 5 the total distance will be 9, which is better than 12.

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

This is the first-ever time I got an idea on how to solve Problem D, to know the median in constant time we can use two heap approach, I made the window as two heap's and each time I move the window I insert an element into heap O(log K) time, but I don't know how to remove a random element from the heap in the logarithmic time since while sliding the window we need to pop the 1st element of the window each time. so I went by removing elements in O(K) time, but went with TLE in Test case 7. can someone help me on how to remove random elements from the heap with less complexity or any other better approach to solve the D problem?

Attaching my Python Solution. MY solution in Python Using Two Heap

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

Memory limit exceeded for using map in problem B. Anyone, any trick to modify this code to avoid MLE. I used map for storing the visited points in a recursive function.

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

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

Le me after this round -

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

Poor me created 5 cpp files for the contest and I only solved A (-_-)

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

What is the failing case for this submission? https://mirror.codeforces.com/contest/1486/submission/107861220

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

Before realising the intended solution to E, I was thinking about using Convex Hull Trick to optimize dijkstra in the following way. If I am at some vertex $$$u$$$, for every edge $$$(u, v)$$$ I insert into the convex hull data structure (initially empty) the line $$$mx + c$$$ where $$$m = 2 * w(u, v), c = dist[v] + w(u, v) * w(u, v)$$$. After inserting all of them, then for each vertex v I do $$$dist[v] = min(dist[v], w(u, v) * w(u, v) + query(w(u, v)))$$$, where query is the usual query for the convex hull trick data structure (returns the minimum function value) and $$$dist$$$ is an array containing the answer for all the vertices. I think implementing this directly in dijkstra won't work for a variety of reasons. I wanted to ask if there is any way in which we can use this trick to solve this problem for arbitrarily large edge weights (say $$$1 \le w \le 10^9$$$).

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

.

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

In problem B "sum of distance" instead of "summary distance" would have saved time of both setters and participants .

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

Wow!

What a wonderful contest! It made my day :D

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

Can D be solved using ordered multiset and considering the subarrays of size k only? like this,

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

Impressive, Qzy___ solves B on 0:11 (107793144) and D on 0:12 (107794288). How do you guys do it with such difference in the code style? Do you keep two different templates for some reason?

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

107793970

Where does my solution fail in A. Can anyone help

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

why the brute-force is passing problem E????

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

Can someone tell me whats wrong with this solution for problem A: https://mirror.codeforces.com/contest/1486/submission/107836476

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

The pretests for A were that good, that there was no test where submissions without long long would not pass. Good job!

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

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

Please release the editorial.

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

Which was the point of E? It was just an easy and classic Dijkstra.

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

The official can tell me why my code was skipped for C1 question, I didn’t give anyone my code.

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

Today I learned a lesson — don't participate in a contest while sick with (probably) COVID-19. :)

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

For the first time, in my room no solution failed system tests!! Thanks for strong pretests!!

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

Deleted

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

c1 should have larger amount of queries, my code was right but i did not bother to do a simple optimization on queries as there was already a c2 with less queries.

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

How can a $$$O(n \times m)$$$ solution pass the system testing (or even the pretests) on problem E?

This is the submission. Clearly two for loops.

107866037

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

I think Problem C1 and C2 are just like one problem? I can't feel the gap between them.

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

OK. As it seems someone really tried to make weak pretests. There was so obvious error in my code. And I got pretests passed. What's the point of giving feedback, if obviously wrong solutions pass pretests? just look what have I written: "if(ans==ind)r=mid,l=mid;" and it passed pretests. I will worry about my rating, but it's funny

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

E should be retested.

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

Can anyone tell me what does the Error in this solution means https://mirror.codeforces.com/contest/1486/submission/107864397

, And can someone give me one TC on which this solution fails. Helping in even one would be highly appreciated . Thanks in Advance

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

I made a stupid mistake and used k+1 instead of k in D, passed pretests, but failed in system testing:(

And I went all the way from Rank 3 to Rank 23:(

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

E should be retested. There are codes that solves E by making a M^2 edges Graph

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

To not keep you waiting, the ratings updated preliminarily. In a few hours, I will remove cheaters and update the ratings again!

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

The problems were really interesting!

Kudos to the authors, and the coordinators involved! :)

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

okwedook MikeMirzayanov I would like to request a rejudge of E because the judge behaviour is inconsistent: 107850881 is TLE and 107877393 is AC but both are the same code (you can check with Compare)

UPD: of course, the algorithm itself is not randomized in any way

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

wrong answer Integer parameter [name=query_r] equals to 27671, violates the range [27672, 99999]

Could anyone please tell me what this means? I got this for C1

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

Great question C2 really liked it

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

what a great set of problems. thank you and thanks to the coordinator for rejecting the other problems.

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

very weak test cases in C2, E....

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

I am getting runtime error on testcase 6 for the E problem , here is the link of my submission , can some one please check it!!, What I have done is kept n*51 states and edge of weight 0 between (u,0) & (v,w) , edge of weight (a+w)^2 between (u,a) & (v,w) , for the edge u,v with weight w given in question, I applied dijkstras on transformed graph..

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

image

Strange

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

i whink DE is a bit too easy for its position, D ia a sinple binary search and E's dijkstra solution is O(m log 50m)

maybe better if put them in CD and get a harder problem for E

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

For problem E, O(NM) passed system tests. The hack cases can be generated easily with a simple source. It's amazing that the system tests didn't had any hack cases for the O(NM) solutions...

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

Can someone help me to find what's wrong with my solution for Problem A ? 107831213

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

the approach discussed in Question B can be extend to 3D plane also ?

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

Can someone elaborate how you all are creating graph before applying Dijkstra?

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

I am observing about a 2x difference between the runtimes of two solutions, by just changing the way I am indexing the array. I understand that this is because of different localities of reference between the solutions.

Yet, I am not able to figure out why one of these has a higher locality of reference. If someone can help me figure out the same, it will be greatly appreciated.

These are the two submissions: 108047029 108047388