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

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

Всем привет!

В это воскресенье, 21-го марта 2021 года в 13:00 по московскому времени начнется Финал Технокубка 2021!

Для тех, кто хочет посоревноваться на тех же задачах, будет проведено два обычных раунда Codeforces: один для первого, другой для второго дивизиона. Раунды начнутся 21.03.2021 16:20 (Московское время), не пропустите!

Конечно, если вы участвуете в финальном раунде Технокубка, то вы не можете участвовать в раунде вечером. Мы просим участников официального финала воздержаться от обсуждения задач в открытых сообществах до конца раунда вечером.

Задачи для вас готовили: Александр Golovanov399 Голованов, Евгений amethyst0 Белых, Андрей AndreySergunin Сергунин, Алексей Aleks5d Упирвицкий, Diego Diegogrc Garcia и я.

Также спасибо Bench0310, kokokostya, Um_nik, dorijanlendvaj, brunomont, Stepavly, antontrygubO_o, JinhaiChen, budalnik, wucstdio, golikovnik, kuviman, dantrag, BledDest, Supermagzzz, ruanxiaoyu, geranazavr555, divanik, psevdoinsaf, Roms за тестирование задач и ценные замечания, а также antontrygubO_o за помощь в проведении зеркальных раундов.

Удачи!

Поздравляем победителей в раундах на Codeforces!

Div. 1:

  1. ecnerwala
  2. Radewoosh
  3. Benq
  4. mango_lassi
  5. AliShahali1382

Div. 2:

  1. qwqc
  2. gezlik
  3. yanyutao
  4. fengqiyuka
  5. ykl

Всем спасибо за участие! Разбор в обычном формате, презентация с разбором.

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

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

You missed " Notice the unusual timing "

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

Друзья, а что такое "технокубок"? Как я понимаю, это олимпиада. Ещё есть возможность регистрации?

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

Hoping for strong sample tests this time ;)

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

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

Is the official Technocup round (not the Div 1/2) rated? (not a bait question, genuinely curious)

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

3 contests a day. Gonna be rough. - Kickstart - CF - Cookff

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

AtCoder Regular Contest 115 — 5 PM (UTC + 6)
CF DIV 1/2 — 7.10 PM (UTC + 6)
MARCH COOK-OFF 2021 — 10 PM(UTC + 6)

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

Last year, the contest was ethical and beautiful. Hope it will be the same this year!

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

Today full of contests will coming...

JOISC 2021 Day2 1p.m. — 6p.m.
AtCoder Regular Contest 115 7.p.m. — 9p.m.
CF Round #709 Div. 2 9.10p.m. — 11.10p.m. (Isn't it used to be 9.05 p.m.? Wondering for it)

I've never participated in so many rounds in one day. It's busy without doubt, and I hope it'll also be a fulfilling and unforgettable day for me...

P.S. UTC+8

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

This round is rated or not...as it's not mentioned anywhere in the announcement ??

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

The Final Round of Technocup 2019 starts this Sunday, on the March 21, 2021 at 13:00 MSK (10:00 UTC)!

Shouldn't it be Technocup 2021?

P.S. If I misunderstand this, can someone please explain it to me?

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

Узнают ли финалисты разбалловку до начала раунда?

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

жаль что некоторые финалисты будут сдавать с фейков:(

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

Atcder round will end exactly 10 minutes before the start of this round. Such a productive day

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

Why unusual time though, so as to host it with the actual finals?

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

What is the score distribution for the tasks?

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

How many problems will there be?

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

How Many Problems will be there and problem ratings ???

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

delayed 10 minutes

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

Delayed by 10 minutes

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

Forget to release score distribution and make a 10 mins delay?

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

Come on everyone and good luck!
It's my first time to have a contest!

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

there is a delay!

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

SO now what should i do for next 10 mins of my life?

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

Delay it some more times and the unusual timing will become usual again.

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

what's the scoring distribution of the problems?

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

I guess score distribution is left for surprise.

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

So, the revealing of score distribution is gonna be the latest in codeforces history, lol!!

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

Please don't delay this round more than this, we have to give cc march cookoff as well :( T_T

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

Why score distribution for this round is not given

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

Literally guys , again 10 minutes what to do for 10 minutes i controlled washroom for the contest Now fucked up !!

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

Every minute seems like an hour now :)

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

Score distribution?

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

no notice for unusual timing no score distribution whats going on?

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

[deleted]

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

How can someone solve A,B,C within 2 minutes unless they know the problems and the solutions beforehand! Ridiculous!!!

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

wtf?  In two minutes this guy read 3 problems as well as solved them and then coded them.

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

Total solve for each problem not visible on the dashboard(Div2)

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

504 Gateway Time-out

Unrated again?

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

I am submitting using m3 and not able to see if my solution is submitted or not.

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

It is being unethical and ugly. Again.

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

Hey guys I can't see the statements of the problems now. What's wrong?

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

Toughest Prob B ever!!

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

MikeMirzayanov There were a few people who read , coded and submitted about 2-3 problmes within a first few minuites, I feel thy already knew the problems. Please do us a favour and disqualify them.

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

Pathetic Contest for me IMO.. No offense to anyone

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

This is the actual power of your speed
Rank 1591 with A solved

Also Rank 9160 with A solved
:D

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

in problem b when i 1st time submited it gives me RE..i tried to find error but couldnt find it..so i tried to submit the same code added some comment line(because you cant submit same code)..and i got WA for same code..What happening :")?

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

by mistake i locked my wrong solution instead of write due to technical glitch during start of contest will i get points of problem A as there is correct one but locked one is wrong please respond whosoever knows????

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

hardforces!! ( atleast for me don't know about others )

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

Really interesting problems, have no idea how to solve them though lol

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

Really nice problems, no idea how to solve them though lol

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

I want to clarify 1 one thing,i made submission of problem A at 7 min from m1.codeforces ,and after submitting B from codeforces.com,i saw A has not been marked green ,while its pretests are passed,again i submitted from codeforces.com,then WTF,my score was reduced from 486 to 218,seriously dude,is this fair??

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

I submitted A at 14 minutes 50 second and italso passed pretests, but it doesn't show green colour and option to lock in Dashboard. Though, it is there for other 3 problems.

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

Problem D: fix a source vertex $$$u$$$ and let $$$M = \max_v l$$$ over all triples $$$(u, v, l)$$$. Add an $$$(n+1)$$$-th dummy vertex to the graph, and for each triple $$$(u, v, l)$$$ add an edge from $$$v$$$ to the dummy vertex with weight $$$M - l$$$. Now an edge is useful if it is in a path of length at most $$$M$$$ from $$$u$$$ to the dummy vertex. Now the problem reduces to doing two Dijkstra's (one from $$$u$$$, one from the dummy vertex) and checking each edge. Since the graph is complete in the worst case, it was best to implement the $$$O(n^2)$$$ version of Dijkstra (heap-based version gave TLE for me). Final runtime $$$O(n^3)$$$.

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

KAN What the hell is pretest 16 in D?

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

How to do div2D?

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

Is it rated ?

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

I literally wrote some random shit in C and it passed pretests. Waiting for fst :(

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

How to solve div2 B and C?

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

    Problem B

    If there is a solution, then, for all i > 1:

    If ai-1 <= ai then ai - ai - 1 = c

    If ai-1 > ai then ai - ai - 1 = c - m.

    Let c1 = ai - ai - 1

    If the values of c or c1 are inconsistent for different values of i then there is no solution.

    If either is unknown (i.e. the array is monotonically increasing or decreasing) then any value of m works.

    Otherwise the only possible value of m is c - c1. If this is greater than the biggest value in the array it is the solution; if it isn't then there is no solution.

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

Any hints for Div2 D ?

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

Duh, I got down to 107 queries in E >_> (worst result after simulating tens of thousands of random tests locally). Is 105 provably optimal (in which case I will admit I was not close) or did I lacked just a few small tweaks :|?

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

    I sincerely hope it wasn't, because otherwise I spent 1.5 hours for nothing :(((((( My approach was to find largest $$$t$$$ s.t. worst case asking $$$(l+r) \cdot t$$$ and always getting lower answer fits in current number of remaining questions. What was yours?

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

      That's what I did as well. I passed pretests (who knows about systests...) by using this approach, running it on an interactor I wrote, and tweaking it in order to maximize the minimum number of queries left on $$$2^{46} - 1$$$, $$$2^{45},$$$ or $$$2^{46}.$$$

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

      On the beginning I tried doubling my budget till I hit first bust ("Fraudster" response). At that point my search space is of form $$$[L, R]$$$, where $$$2L \ge R$$$ (which means that after failed query I can regain a big part of my budget by asking L). Then I try to do skewed binary search. If I ask about midpoint of my interval then no matter what the answer is, I am left with interval of the same length, however in one of these cases I lost a lot of money, so this is probably not the optimal dividing point. I ask about $$$\frac{L \cdot \phi + R}{1 + \phi}$$$ (where $$$\phi = 1.618...$$$). I either end up with a longer interval after gaining money or shorter interval after losing money. Don't ask me why $$$\phi$$$, I just somehow felt it would be good and my experiments confirmed it was a sensible choice.

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

        I was thinking that something like that might pass, but I was assuming that my apporach is a generalization of your's, therefore I would just write mine. I guess it turns out that my approach suffers greatly because of precision, therefore it didn't work

        upd: turns out $$$(l+r) \cdot t$$$ isn't equivalent to $$$\frac{(l \cdot t + r)}{1 + t}$$$.................

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

        It seems that after raising number of testcases to a few millions my code got up to even 110 queries. However I added an opt suggested to me by kabuszki that if I have a lot of money I can ask closer to half, if I have not a lot, I ask closer to L (I threw in some random constants to quantify this) and after that it doesn't exceed 104 queries on a few millions of cases.

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

How to solve Div 2 E?

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

    We can do this with DP. Let $$$dp_i$$$ denote the maximum beauty you can get by taking photos of only the first $$$i$$$ buildings and $$$bef_i$$$ indicate the greatest index $$$j \lt i$$$ such that $$$h_j$$$ < $$$h_i$$$ or $$$-1$$$ if no such $$$j$$$ exists. Now the transitions are quite simple.

    $$$dp_i$$$ = $$$max(\displaystyle\max_{bef_i \leq j \lt i}dp_j + b_i, dp_{bef_i})$$$

    The first part is when building $$$i$$$ is in a different photo than building $$${bef_i}$$$, and since all buildings in the photo which the building $$$i$$$ is present are taller than it, we will only consider the beauty of this building. The second part corresponds to the case when building $$$i$$$ is in the same photo as $$$bef_i$$$. In this scenario, as all the building after $$$bef_i$$$ are taller than it, none of the buildings there will contribute to the beauty of the photo. You can implement this using segment tree. Also, make sure to handle the case where $$$bef_i = -1$$$

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

      Can you explain what you will be using the segment tree for here?

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

      I think it should be max( max ... )

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

      Thanks for your solution.

      I implemented it without segment tree: maintain a monotonic stack. After each operation, the last item in stack stores $$$(i, \displaystyle\max_{bef[i] \leq j \lt i}dp_j)$$$, the second to last item stores $$$(bef[i], \displaystyle\max_{bef[bef[i]] \leq j \lt bef[i]}dp_j )$$$, and so on. It can reduce complexity to $$$O(n)$$$.

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

Today at starting site was again too slow and when i submitted A it does't reflect in submission so I opened lightweight version of CF and submitted there but later i came to know previous was also submitted ans 50 points got reducted for resubmission :/

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

Can anybody give me some hints for B.

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

The lightweight websites m1, m2, m3 were a bit too lightweight this time...

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

Such hard problems.

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

This contest was brutal(Donno about others but for me it was).. T_T :(

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

in div 2 e :

for 4th sample why answer is 96?

if we make photo in this way:

1)1,2,3,4,5

2)6

3)7

4)8,9

5)10

beauty is 100

am i wrong?

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

Why Div. 2 A was so easy?

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

Does submitting two solutions incur a penalty? I don't know how maybe due to server issues my solution got submitted twice to problem A within 9 seconds and got a 50 point penalty. Any idea why?

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

My solution for D:

Let $$$w_{uv}$$$ be the weight of the edge between vertex $$$u$$$ and $$$v$$$ (or $$$\infty$$$ if it does not exist), $$$d_{uv}$$$ be the shortest distance of $$$u$$$ and $$$v$$$ (or $$$\infty$$$ similarly), and $$$l_{uv}$$$ be the third element of one of given triplets that forms $$$(u, v, *)$$$ or $$$(v, u, *)$$$ (or $$$0$$$ if such triple does not exist).

For each $$$(u, v)$$$ such that $$$u \lt v$$$ and $$$w_{uv} \lt \infty$$$, we want to check if there exists a pair of vertices $$$(a, b)$$$ such that $$$d_{au} + w_{uv} + d_{vb} \leq l_{ab}$$$. This is equivalent to $$${}^\exists a,\; d_{au} + w_{uv} \leq \max_b ( l_{ab} - d_{vb} )$$$. We can precalculate $$$f_{av} := \displaystyle \max_b ( l_{ab} - d_{vb} )$$$ in $$$O(n^3)$$$ time, then check $$${}^\exists a,\; d_{au} + w_{uv} \leq f_{av}$$$ in $$$O(n)$$$ time for each $$$(u, v)$$$. Therefore the problem has been solved in a total of $$$O(n^3)$$$ time.

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

how sad it is when codeforces does not work:(

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

Rounds for children are so bizarre, each time I participate in them it's such a disaster.

The mice cried, pricked, but continued gnawing the cactus...

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

Is this round rated?

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

The problem E is a very great problem, especially limited the number of inquiries <= 10^{14} and let my multiplication get TLE(because of invalid queries) Thank you very much!

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

B > C. Just another day at CF.

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

Can't wait for editorial to see the intended solution for Div2 D. I couldn't do it in less than O(n^2)

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

    I have ~ O(n) solution using vector of deques

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

      would you mind sharing the idea behind it?

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

        Let's consider sequence p[1], p[2], ..., p[k], where GCD(p[i — 1], p[i]) != 1 for each neighbor pairs. We can store this sequence as a deque. Let's simulate the process and parse the given array into these deques.

        Then we have obvious property: if you delete p[1], you start from p[2] and go until p[k], and for each neighbor pairs GCD is also > 1. We don't need to check it twice, let's just remove the first element from the deque.

        After that let's consider two neighbor deques q and p. If GCD(q.back(), p.front()) != 1, we can merge them(you can use small-to-large to do it more efficiently).

        You can do it while it is possible to remove at least one element. After few operations we'll get one deque, let's consider it as given array and do the same.

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

geranazavr555 when will codeforces be fully open ?

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

Why is viewing user profiles blocked?

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

Can anyone give any hints for Div2 C?

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

In Div2 C why it was not given that "nobody is chosen strictly more than " Ceil of m/2...I got wrong thrice on it due to assuming it to be rounded down :(

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

My soln of D -
Let d[u][v] be the shortest distance between u and v.

O(n^4) soln - Let x,y,w be an edge. u,v,l is a triplet.
x,y is good if d[x][u]+w+d[v][y]<=l <=> 0+w+d[v][y]<=l-d[x][u].
Its equivalent to adding (x,v,l-d[x][u]) as new triplet.

You can always remove duplicate triples by keeping the one with has l maximum.
So you can use initial given triplets to generate O(n^2) new triplets.
At last, for each edges just check triplets which have an endpoint common with the edge.

Overall it takes O(n^3).

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

Did someone else use flows on Div2C??

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

A was so easy, everyone signed up for the contest, but the surprise was B. oh shit, contest is not beautiful

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

This really makes me hate myself.

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

div2 C problem: if he has only one friend, how can make other friends offended?

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

Any hints for div2C?

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

    one more

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

    Greedy works.

    1. Initially, for each day, select any friend available that day.
    2. Let's call the most common friend X. If friend X is chosen more than half the days, iterate over all days where friend X is selected and select any other friend. It can be shown this will not increase the count of any other friend above half. Stop if friend X's count is no longer more than half the days.
    3. If friend X still appears too many times (because there were too many days with no other friend available), it's impossible.
  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    HINT 1:-

    if all friends appear in less than ceil(m/2) ... ans is pretty simple

    HINT 2:-

    if any friend(let's call him x) appear more than ceil(m/2) times then invite this friend for ceil(m/2) times on days and for rest days invite anyone(except the one you invited ceil(m/2) times already). This will automatically obey the condition.

    Now on which days should invite x.

    Invite x on those days in which only he is allowed(let call this num y) and rest on any day in which x is allowed.

    if(y>ceil(m/2) then ans = "NO" ..... It is obvious.

    I hope this helps

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

    I will try to explain what I did... Firstly I choose those friends whose count in all games (i.e-in all m days) is less than max allowed, Max allowed is ceil(m/2).We can use these friends on all days wherever they are possible because they can all be used at once and it will always be optimal and it will not violate the maximum usage condition. Now you can now take all the friends whose count is greater than max allowed.

    Now the question arises which friend to use and on which days to use. So, for each friend you can choose the days where there are less possibilities and that particular friend is possible on that day.I hope you understand.

    Sorry for my poor grammar.

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

110670278 Can anybody tell me what is wrong in this code. Thank You

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

I pass pretests in C, but why it doesn't turn green nor turn red?

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

bring back the good old codeforces!!!

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

Why haven't system tests started yet?

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

But why does Div2 D/ Div 1 B have to be literal dog shit? It's almost like the people who proposed to let this kind of garbage appear in a Codeforces round don't want anyone to have fun participating it.

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

any hints for ques div2-B ?

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

I have some serious doubts about performance of alan4ik. I don't believe that any purple user is capable of solving B and C significantly faster than all reds (he solved B at 0:03, A at 0:07 and C at 0:16) and this competition being a mirror of Technocup explains pretty well how it was possible

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

I Encountered some problem while trying to submit problem A, which led to a delay in submit time and a down my ranking in the standing list, and the resulting from it confusion prevented me from focusing on the rest of the issues. Which of you happened to him like this?

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

Please add (n = 1) case to pretest in next contest. TY.

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

Me after FSTing on B : Hey cyan, here I come !

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

Weak pretests are so common now in codeforces.

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

in second test case of div2-B i am getting this result- ''wrong answer Jury has answer to test 34, but participant has not (test case 34)'' what does this mean ?

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

So painful to solve D just three minutes after the end
Yet so lovely that so many people got FST in B

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

I see that the blog is being downvoted. What was wrong with the problems? I've heard that in the statement of D it was unclear whether the pairs are ordered or unordered, but I don't know what else was the fault of authors.

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

    this is at least disrespectful to the author

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

    D2B FSTs is the main reason I guess

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

    My suspicion is that this is largely motivated by the first two Div 2 tasks--A is significantly simpler than past Div 2 A's, and there were a number of ways to attempt B that led to lots of nasty edge cases. That said, I thought the Div 1 set was pretty nicely balanced. It's perhaps a little unfortunate that the range of problems that matters most for the majority of contestants (B/C/D) leaned towards the DS side of things, with the ad hocs placed at A and E, but that doesn't seem like the end of the world to me, and neither B nor C required absurdly nasty implementation.

    Another plausible explanation is that there were a large number of FSTs. I see this as perhaps a more legitimate reason to downvote; FSTing is extremely frustrating and unfair, given that it represents a significant disadvantage over failing pretests in spite of the fact that the root cause of failing pretests and of FSTing is essentially the same (i.e., submitting a buggy solution), and consequentially, I think authors have an obligation to minimize the number of FSTs that occur.

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

    As far as I check all the problems either in div1/div2 had some people FSTed so I think that's the reason.

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

      Huh? That's actually great. For a long time cf pretests are going in the wrong way. People stopped even caring about their solutions after seeing that the pretests are passed, while they should carefully check their time, memory and time relative to other participants. Pretests are here to help you catch bugs, but you should always be aware of on WA/TLE/RE on systests and be ready to resubmit if your running time on pretests isn't good enough.

      Last times I've seen that after systests my running time sometimes decreases which means that most times all the strongest tests are included in the pretests, which is bad.

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

        Isn't the point to construct as strong pretests as possible? I think pretests are here just to reduce the load on the judging servers, not to force participants to reread / test their solution after passing pretests.

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

          Actually I've never thought about pretests from this points of view, but probably this is the actual reason.

          Anyway, for me it always was another interesting feature of cf contests in comparison to other platforms, so I would've liked more tasks with weak pretests to make competition more interesting.

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

Is the contest still rated? please, let me know.

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

how n=1 is not in the pretest?

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

is CF-predictor working ??

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

мое решение получило ТЛ 20 на систестах, а переотправленное уже прошло. Посылка которая получила ТЛ 110676013, и посылка которая прошла 110673324 KAN MikeMirzayanov

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

What should be output for this TC in Div2B 3 4 2 0

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

For div1A/div2C:

I used Dinic to solve it, modeling a graph with Source that gives (M+1)/2 to "left-side" nodes(that represents "friends"), adding an edge (of weight 1) to "right-side" nodes (that represents days) when that friend could be used on that day. Then i joined the "days" with SNK (weight 1) and run maxflow.

Anyone knows if it can work with Edmond-Karp or some Matching algorithm?

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

I have a doubt. What is the correct size for declaring segment tree ? For problem C (skyline), I declared N as 3e5+5 and seg tree size as 3N. But it gave memory error on test 6. Then When I changed to 4N, it worked. Since the seg tree divides every node by 2, so the max size should not go beyond 2N right ? (N + N/2 +N/4 +... = 2N) ?

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

Для участников технокубка раунд рейтинговый?

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

I passed div2 A at 0:08 but why did my submission is skipped? I submitted div2 A again after i passed the B,but my A‘s score is not calculateed with the submission i submitted at 0:08。my score is lost!

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

How to see the probable rating change before the end of the round?

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

To not keep you waiting, the ratings updated preliminarily. We will remove cheaters and update the ratings again soon!

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

Finally.... reached expert today :)

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

in Proplem B Div 2

When can I say that the condition takes a value of 0?

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

when will ratings be updated ?

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

anyone getting notifications that someone wrote something ?

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

div 1.5 i guess

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

How to solve Div2D / Div1B?

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

    My solution is following. Notice that we will remove at most N numbers. So, if we can "fast" search next and remove it, then time complexity is O(n * (single_search+single_remove)). How can we remove element? You can do it with double-linked list or using set. How to find next pair? Let's maintain set of all indices of consecutive gcd = 1. Then, we need to find among all indices next from current position. In c++ you can do it with set and lower_bound. Or you could write segment tree. Probably there some other ways. When you delete number make sure you also remove all corresponding gcd = 1, and add new ones.

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

In DIV2 A and B, what arguments or justification you used while reaching to the solution ? Like what was your lane of thought .

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

    In Div2A we can think of a cell as a vertex in a graph and a broken wall as an edge. Let's also assume that there's a vertex that represents "outside of the prison". Then, the task is to find the minimum number of edges that a connected graph can have. In other words, the graph we're looking for is a tree which has n-1 edges. Including our "imaginary" vertex (because there must exist a connection with the "outside"), n = a * b + 1 so the number of edges is a * b.

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

    A: You can think of (a*b) cells + 1 outside as components of a disjoint set. Opening any wall means joining two componenets. As we need to merge a*b + 1 components to 1 we need at least a*b wall breaks. Then you can easily create a solution which satisfies this for eg. breaking the bottom wall of each cell.

    B: If the array satisifies a generator there can be only two cases for each pair of adjacent elements: a[i] >= a[i-1] and a[i] = a[i-1] + c, and a[i] < a[i-1] and a[i] = (a[i-1] + c — m).
    After checking that each case has only one difference in it, you need both these cases occuring to fix one (m,c) pair else m can be arbitrarily large.

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

Getting error 'You are not allowed to view the contest' when trying to open Div2 contest (ID 1484). Please fix, I'd like to look at the problem statements again.

MikeMirzayanov KAN

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

I found out that the link to the div 2 round is not working. It said that I am not allowed to view such contest! Please fix it. @MikeMirzayanov

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

When can we view others' code?

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

It seems the prompt for Div2 Problem B was misleading. It said that c is nonnegative and that a[i] = a[i-1] + c. That led me to conclude that arrays that are monotonically decreasing have no solution, but that doesn't seem to be the case based on some of the comments (Codeforces is not currently allowing access to the div2 problems so I can't check the testcases I missed).

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

Codeforces Round #709 (Div.1 only)

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

Is there a reason why problems A,B in Div.2 cannot be viewed?

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

Can anyone please explain how to solve DIV2 C (DIV1 A) using flow?

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

MikeMirzayanov почему мы не можем смотреть коды других участников из DIV1?

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

These rating changes don't seem appropriate, is there some extra +ve rating given in the first few contests? , I would like to know more about this...

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

Would you please describe the details of the complexity analysis about Div2. D in editorial?

This problem is still puzzling me.

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

I just realized I got only 438 points for problem A, but I did solve it in under 5 minutes. There are many who took more time and still got more points, is it because I submitted my problem twice? because the first time the server went down while it was in queue.

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

where is div2? I cant open it.

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

when to publish the tutorial?

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

can anyone please explain the approach to problem D? i have no clue how to do it..

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

MikeMirzayanov Please update problem rates.

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

Sorry if it's too late, but i think C div.1 can solve using divide and conquer and greedy with a bit more data structures.

See my code : 110746829

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

    Let $$$solve(l, r)$$$ be the answer for segment $$$[l, r]$$$ then you choose the building $$$m$$$ with minimum $$$h_m$$$. You easy calculate it in O(1) if you have the answer for segment $$$[l, m - 1]$$$ and $$$[m + 1, r]$$$. Let's call these answer are $$$left$$$ and $$$right$$$.

    There're two case here:

    1. $$$b_m$$$ contain in the answer then $$$ans = right + left + b_m$$$
    2. $$$b_m$$$ does not contain in the answer, that mean it must be in same picture with $$$l - 1$$$ or $$$r + 1$$$ or both.
    • If $$$l \gt 1$$$ and it is in same with $$$l - 1$$$ then $$$ans = right$$$.
    • If $$$r \lt n$$$ and it is in same with $$$r + 1$$$ then $$$ans = left$$$
    • If $$$l \gt 1, r \lt n$$$ and it is in same picture with both then $$$ans = 0$$$.

    Take max all of these, and you got the final answer.

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

Any plans to add english editorial authors ?

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

KAN any updates on the english editorial?

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

Thanks to everyone who downvoted my survey is accomplished. Also, thanks to Dragnoid99 to make it possible faster. ORZ community

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

At this point I think I will just try google translating the Russian slides instead of waiting for the editorial.

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

god! Am I the only rookie praying for tutorial?

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

Instead waiting for English tutorials to be posted, i am going to learn russian to speed up the process.

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

Here is the English Editorial version (using Google Translate) of "Slides in Russian" which is attached to the Announcement — Google Translate Version Of Technocup 2021 Final(CF — 709) Editorial .

Hope it helps before the official editorial gets published.
Thank You !

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

In case anyone is curious about the solutions to the problems, I wrote up an unofficial editorial for all the problems except Div. 1 F at https://mirror.codeforces.com/blog/entry/88944.

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

please post editorial asap !!

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

I'm not sure why editorial is not out yet, but I was the writer of Div2E/Div1C, so ill post the editorial I had written for the solution I had in mind, hope it helps out.

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

Thomas had never seen such long delay for editorials

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

Please, upload the editorial. It's been 3 days.

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

It's frustrating to wait so long for the editorial

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

Can the editorial link be posted on the announcement also? KAN

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

How to solve div2F/div1D?