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

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

Всем привет!

В воскресенье в Москве пройдет XIX Московская командная олимпиада — командное соревнование для школьников, проходящее в Москве как отборочное соревнование на ВКОШП. Над туром работала Московская методическая комиссия, известная вам также по Открытой олимпиаде школьников по программированию, Московской олимпиаде для 6-9 классов и олимпиаде Мегаполисов (раунды 327, 342, 345, 376, 401, 433, 441, 466, 469, 507, 516, 541, 545, 567, 583, 594, 622, 626, 657, 680, 704, 707, 727).

Раунд состоится в 25.10.2021 09:35 (Московское время) и продлится 2 часа. Обратите внимание на нестандартное время начала раунда. В каждом дивизионе будет предложено по 6 задач. Раунд будет проведён по правилам Codeforces, будет рейтинговым для обоих дивизионов.

В связи с этим мы просим всех участников сообщества, участвующих в соревновании, проявить уважение к себе и другим участникам соревнования и не пытаться читерить никоим образом, в частности, выясняя задачи у участников соревнования в Москве. Если вы узнали какие-либо из задач МКОШП (участвуя в ней лично, от кого-то из участников или каким-либо иным образом), пожалуйста, не пишите раунд. Участников олимпиады мы просим воздержаться от публичного обсуждения задач. Любое нарушение правил выше будет являться поводом для дисквалификации.

Задачи соревнования подготовлены LHiC, cdkrot, isaf27, AlesyaIvanova, Tikhon228, voidmax, dyrbulshchyl, KiKoS, Kaurker, PaHbLLle_91_6blJl_6blcTp, vintage_Vlad_Makeev и Дарья Крохина под моим руководством, а также GlebsHP, meshanya, Endagorion, Zlobober и Андреевой Е. В.

Спасибо adedalic и KAN за координацию раунда и вычитку оригинальных задач МКОШП, adedalic и GlebsHP за перевод условий, а так же MikeMirzayanov за системы codeforces и polygon, который использовался при подготовке задач этой олимпиады.

Также спасибо napstablook и Anti-Light за предоставление дополнительных задач, которые помогли составить (я надеюсь) сбалансированный проблемсет для раунда.

Всем удачи!

UPD1: Спасибо Um_nik, PurpleCrayon, LHiC, VladaMG98, JovanB, TadijaSebez, AlanSkarica, Markadiusz, actinium16, jurichhh8 за тестирование.

UPD2: Разбалловка:

Div.1: 500 — 1250 — 2000 — 2250 — 2250 — 3000

Div.2: 500 — 1000 — 1500 — 2250 — 3000 — 3250

UPD3: Разбор

UPD4: Победители!

Div. 1:

  1. OddImage
  2. ksun48
  3. maroonrk
  4. ko_osaga
  5. Radewoosh

Div. 2:

  1. zero4338
  2. C2020jzm
  3. SYDevil
  4. PPL_
  5. just_ice
  • Проголосовать: нравится
  • +267
  • Проголосовать: не нравится

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

Why is it on Monday at 14:35? We're still at school...

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

Did this have only 2 comments before? [It says the blog has been posted 2 weeks ago.]

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

Is it going to be held in the ICPC 10mins penalty format or score distribution will be released?

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

For europe this is a ridiculous time

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

i wish contests timings will go back to normal...

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

In problem E in the last sample, why [7 9][7] is impossible?

Thanks.

EDIT: Nevermind. I was too hungry when I read the statement.

EDIT: Looks like I was so hungry that I commented on the newer contest's announcement. Apologizes for spamming.

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

This should be the most unusual time I've ever seen in Cf

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

Bad time

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

I hope there will be more datastructure problems . I like that more than construction problems.

Hope everyone good luck!

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

waiting for aryanc403's pigeonhole comment

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

As a student, who has already participated in this olympiad, I say that problems are good.

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

Oh 22:35, note the usual time!

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

As a tester, the problems are great! Good luck to everyone! :)

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

As a tester, I can confirm that the tasks are very interesting, and the statements are clear and well written. I hope you enjoy the contest. Good luck!

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

If you test a round but don't shamelessly beg for upvotes in the comments, can you really call yourself a tester?

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

I guess zhoukangyang will become LGM after this contest!

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

Waiting for weak pretests.

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

nice contest but still at expert :'(

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

OMG , this contest will give me one of my best rank if there will be no FST , I m so happy

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

Div.2 D is so hard for me :(

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

FML for never improving my bit manipulation concepts, didn't even get close to solving C.

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

Just for sure, is problem D bfs?

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

Is range addition + range min queries segtree not intended in Div1C or is the TL just really tight?

Had to switch to ints and replace two sets with vector + sort + unique to even go from TL2 to TL13, I half expect replacing the remaining maps in this fashion will fix TLE :/

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

How to solve div2 C?

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

Why is Div1C time limit so so tight.

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

Problem 1D/2F is a problem of a private contest in our school.. I'm so amazed..Here is the photo

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

how to solve Div.2 D?

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

"Dp with data structures" round ...

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

Wondering why BFS solution for DIV2-D got TLE? The complexity would be O(ElogE)!

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

Wondering why BFS solution on div2-D got TLE. The complexity would be O(n.log(n)) which is fine!

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

My idea for D was the following:
Since an alpinist $$$j$$$ can come after alpinist $$$i$$$ only if $$$\max(s_i,a_i) \le s_j$$$ so we can first sort the array by $$$s_i$$$ values and say for each index $$$i$$$ the value of max length subsequence ending at this index is $$$DP_i$$$, recurrence would be,

$$$ DP_i=\max_{x \in [0,s_i]}DP_j+1 $$$

And this could be done with a segment tree where after reaching each index we update the $$$\max(s_i,a_i)$$$ index in the segment tree by $$$DP_i$$$ Is this solution anywhere close to the original solution?
EDIT: Okay, I read the editorial and this approach is incorrect:(

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

I really liked problem C. If you construct $$$n \times 30$$$ binary grid of the number's bits, we are essentially taking maximal (vague but it doesn't matter a lot) all one subgrids (in the subseqeunce sense) with column size $$$k$$$ and flipping them to zeroes. This shows that the value of $$$k$$$ should divide all the column sums in all the $$$30$$$ columns. And it's easy to check that it is possible to do the latter when $$$k$$$ does satisfy these conditions.

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

for C, k is in the answer if and only k divides all sum of 1 in 30 columns bitwise? I couldn't prove the correctness but passed pretests.

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

For problem C, is it true that k is in the answer set if and only k divides all count of 1 in 30 bitwise positions? I couldn't prove correctness but passed pretests

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

    Yes and the proof is not hard either.

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

      what is the proof? the condition of k divides is obviously a necessary condition, but how do you prove is it also a sufficient condition?

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

        Consider any divisor $$$k$$$ and a set of numbers such that the count of numbers with the $$$i$$$-th bit on is a multiple of $$$k$$$.

        In each step, choose any set of $$$k$$$ numbers which share at least one same on bit. Clearly this is do-able as long as all the numbers are not zero and the condition that count of numbers with the $$$i$$$-th bit on is a multiple of $$$k$$$ is maintained.

        Now the $$$\textbf{and}$$$ of these numbers will only include bits which are on in all the numbers. So we will reduce the count of numbers with the $$$i$$$-th bit on by $$$0$$$ or $$$k$$$ for each $$$i$$$.

        So the count of numbers with the $$$i$$$-th bit on will remain divisible by $$$k$$$ and we can repeatedly perform this to solve it.

        If you want a more formal proof, you can write a strong induction proof using this fact. The predicate would be something like $$$p(x)$$$ means for any positive integer $$$k$$$ there exists a way to solve an arbitrary set of non-negative numbers with sum $$$x \times k$$$ given that the count of numbers with the $$$i$$$-th bit on is a multiple of $$$k$$$.

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

    every time we want to subtract, we need to subtract k or 0 counts of bitwise pos, so if we want to subtract all elements to zero, the bitwise count in every pos must be divided by k

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

I accidently do my best ever contest in my alt account but not my main account

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

very super legendary strong pretest in B :( Unbelievable :(

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

In problem B (div 2), what is the maximum value of k after which the there is no change? I thought it would be N, but that failed pretests. Running an infinite loop and breaking when the array becomes constant worked.

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

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

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

About problem D,I submitted a simple code and it passed system test.
Could anybody Hack it or prove that it is right?

int n,d,ans;
struct P{int s,a;}a[N];
bool cmp(P x,P y){return max(x.s,x.a)==max(y.s,y.a)?x.s<y.s:max(x.s,x.a)<max(y.s,y.a);}
signed main()
{
    rd(n);rd(d);for (int i=1;i<=n;i++) rd(a[i].s),rd(a[i].a);
    sort(a+1,a+n+1,cmp);
    for (int i=1;i<=n;i++) if (a[i].s>=d) ans++,d=max(d,a[i].a);
    cout<<ans<<"\n";
}
  • »
    »
    4 года назад, скрыть # ^ |
     
    Проголосовать: нравится +44 Проголосовать: не нравится

    I tried to prove it by swaping adjacent positions.Let's suppose that $$$\max(s1,a1) \lt \max(s2,a2)$$$ and now we swap them.If $$$a2 \gt \max(s1,a1)$$$,the answer will be obviously smaller.If $$$s2 \lt a1$$$,we can find that $$$a2 \gt a1$$$,so the answer may be smaller,too.

    I haven't found a situation that we can make the answer bigger by swaping adjacent positions,so I guess it is right.

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

      But why you explain this to your classmate in English through Codeforces?(I mean that they are classmates and they are both Chinese.It is convenient for them to communicate with each other in private.)

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

I am really surprised to see why div2 winner of this contest having less number of question solved as well as contest also.

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

About E2/C1 problem. Does anyone have the way to construct the final array with A and B elements. Because my only problem is to construct this array.

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

    For each $$$b_{i}$$$,we use $$$c_{j}=1,0,-1$$$ to denote $$$a_{j} \gt b_{i},a_{j}=b_{i},a_{j} \lt b_{i}$$$ respectively,so the cost of inserting $$$b_{i}$$$ is the number of prefix $$$c_{j}=1$$$ and suffix $$$c_{j}=-1$$$,and it's equal to the total number of $$$c_{j}=-1$$$ plus a prefix sum of the sequence $$$c$$$.So we can use the segment tree to solve it.

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

Attention! Your solution 132999485 for the problem 1602C significantly coincides with solutions Scut22/132996768, phantom654/132999485. Such a Enr oxamole do not use ideone.com with the default settings (public access to yOur code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about minutes ago the round with all the details. More information can be found at http://mirror.codeforces.com/blog/entry/8790.Such violation of the rules may be the reason for blocking your may be blocked.

I agree the codes are very similar but the logic of the problem was pretty straightforward. Also using variable names like cnt for counting, g for gcd is a quite standard. So I appeal that it was a mere coincidence. Also Scutt22 seems to be from outside India, and I don't know him in any way. Also please note that I submitted the problem during first 30 minutes of the contest. @MikeMirzayanov