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

Автор triple__a, история, 7 лет назад, По-английски

Hello Codeforces!

I am glad to invite you to my first official round Codeforces Round 630 (Div. 2), which will take place on Mar/31/2020 16:35 (Moscow time) (please note for the unusual starting time) and will be rated for all Division 2 participants.

You will be given 7 tasks and 150 minutes to solve them.

All tasks in this round were prepared by me. Hope that you will enjoy those tasks!

I would like to thank:

To avoid queueforces, we will provide small amount but strong (hope so) pretests for first few tasks. Hope it works!

Score distribution will be announced later.

Good luck and have fun!

UPD1: Score distribution: 500-1000-1250-1250-1750-2250-3000

UPD2: Contest is over, and here is the editorial.

UPD3:

I am sorry that pretests were not as strong as I excepted.

Congratulations to the winners:

div1+div2:

  1. vepifanov

  2. int128.

  3. PinkRabbitAFO

  4. 300iq

  5. nuip

div 2:

  1. int128.

  2. sorry_to_tourist

  3. camilla

  4. jerome_wei

  5. [user: _dawn]

people who were first to solve each task:

A: wangjunrui

B: gotexans

C: okwedook

D: wangjunrui

E: GsjzTle

F: yooooooooo

G: GoGooLi

Lastly, thanks to Handsome2004 for the brilliant hack of E.

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

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

Auto comment: topic has been updated by triple__a (previous revision, new revision, compare).

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

Welcome everyone to join in $$$⩾w⩽$$$

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

hoping to get expert

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

I really hope that this H̶o̶p̶e̶ ̶s̶o̶ works!

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

Small but strong pretests yey no more queue thank you

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

Long time no Chinese Round

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

Waited for Div.2 Round long time. :)

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

I hope I can get a good score!

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

Hope to see my username in blue after this contest. ^_^

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

The time is nice for Chinese :P

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

I like queueforces. My code feels like schrodingers cat.

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

Thanks to all contest writers to make us busy during this lockdown situations. You are doing a great job. STAY SAFE STAY HOME

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

I hope that this contest will increase my rating.

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

Why 150 minutes? Is it hard?

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

how to get started in this contest , can anyone help i am new here

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

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

Just curious about the "useful" discussion Nanako and Nezzar took part in.

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

    Test different kinds of strange solutions, help to structure test datas, give some advice about problems to make difficulty gaps reasonable and so on.

    My work range is not much more than a tester, but my workload is more. I keep communicating with triple__a about these since 2 months ago, and help for much more than 7 problems meanwhile (you know, some problems will be denied when preparing a round), instead of temporarily taking a virtual participation.

    Actually I also tried to give a Problem B when needed, but it was denied. :thinking:

    Don't want to tell much before the contest lol. wish you get a good result in this round.

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

    Generally testing & discussion of problems. Hope you enjoy the problems triple__a prepared!

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

Due to Quarantine registration will exceed 20K for sure. Thanks codeforces for arranging contests, the only partner in this quarantine :)) #GOCORONA #STAYSAFE #HAPPYCODING.

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

how rating of expert contestents change in last div 3 round? sorry, I didn't notice.they fixed this.

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

I am glad to be the contributor to this round.But due to my weak ability I can't test hard problems :-(

Wish you guys like this round of Div2!

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

150 minutes...oh yeah!!...I got no work to do in this quarantine anyway.

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

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

Nice rating graph triple__a

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

I receive the message from admin and surprised

The allowed programming languages are C/C++, Pascal, Perl, Java, C#, Python (2 and 3), Ruby, PHP, Haskell, Scala, OCaml, D, Go, JavaScript and Kotlin.

Is Rust banned? I can't see the name on the list.

Below is the one from the last educational and surely see Rust before Kotlin.

The allowed programming languages are C/C++, Pascal, Java, C#, Python, Ruby, Perl, PHP, Haskell, Scala, OCaml, Go, D, JavaScript, Rust and Kotlin.

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

I need triple(+7) to become Candidate .. I hope i will earn them !

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

****I'm really honored to take part in this test**** ****Good luck everyone!****

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

Thanks all of the members of this contest to prepare another good contest hopefully

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

First time participating in a live contest. Y'all got any pointers ?

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

Alas! I can't solve solve problem B/C. I just can solve problem A.

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

Corona has definitely increased the participation in the recent contests. Thank you MikeMirzayanov for providing a great platform and, Thanks to problem setters too, for providing set of some amazing problems.

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

Auto comment: topic has been updated by triple__a (previous revision, new revision, compare).

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

Auto comment: topic has been updated by triple__a (previous revision, new revision, compare).

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

B worth 1000 and D worth 1250 points? Quite weird, I think you could have saved one problem (C or D) for a future contest.

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

Best of luck guys !!!

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

My request to admin to conduct more contests while this lockdown period. Thanks

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

After seeing the score for question c and d. Excited to see which one will be easy one.

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

Guess, Which one will get more accepted, C or D?

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

We need more such contests in this quarantine period. Another Reason to stay at home.

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

.

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

HackForces?

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

Small number of pretests is somehow already making me feel uncomfortable, I just hope it works well.

BTW, I am curious how hard it is for Codeforces to scale to the increasing number of users, I think registrations are about thrice the amount I used to see in last year, so can't just CF add some more processors(so that now they get 3x processors) or get something like thread ripper to judge systems so that queues are gone. I expect the number of submissions to be linear to the number of participants.

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

More than 20k people! this will be fun!! :D

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

Quick Check:- This is first contest designed by triple__a

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

WOOOOO I am very expect to join the contest,hope for a good game experience and everybody will get good rating improving o-o

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

Huge participation indicates more people performing home quarantine.

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

CF gonna fall down

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

problems are so fricking complicated I dont mean it is hard it is complicated fricking contest

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

I guess it's just my taste but A was quite disgusting

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

stop setting problems.

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

let's make a round which is neither queueforces nor readforces next time!

»
7 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится -27 Проголосовать: не нравится
Комментарий удален по причине нарушения правил Codeforces
»
7 лет назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

Quality with Difficulty

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

Really all problem are look like more tougher than usual contest

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

I feel like 2:30H is too much for a cf contest.

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

Chinese Round is too hard for me.

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

I am glad that at today's round there were no queues and exits from the profile, thank you very much!

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

Praying God for not failing in system test.

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

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

For everyone that had WA#3 on E: Every board is valid for odd N and odd M... Took me more than an hour to notice it :D

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

How to solve G?

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

I don't know how it was for you guys, but for me it was a hard round. :\

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

Hardest ever A .

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

When you realize B solution only need first 11 primes

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

had a bad experience

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

E is one of the most elegant problems I've seen so far :o

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

    Can you tell your thought process for it?

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

      First, note that you can replace all numbers with their values mod 2. Indeed, take m = max(a_ij), and then add 2 to each cell until they become either m or m + 1. The parity will not change. Then the first operation in the statement is useless, and the second one is simply inversion mod 2 (0 -> 1, 1 -> 0). In fact you can swap numbers in adjacent cells. This means you can move 1's arbitrary around the board. Also, if you have two 1's in adjacent cells, you can turn them into 0's by adding 1 to each.

      So the problem reduces to the following: you have nxm board with 0's everywhere apart from the corner cell, where it stands 1 or 0 (depending on the parity of the initial sum in all cells). Then 2 cases:

      1) n*m is odd
      2) n*m is even

      So the answer is the following: if n*m is odd, it is always possible with any a_ij. If n*m is even, it is possible if the sum of all a_ij is even. Now, let's solve the problem :)

      1) n*m is odd
      2) n*m is even

      All what is left is to calculate n*m powers — this you can do by fast power calculation, and fact that $$$x^{nm} = ({x^n})^m$$$.

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

Can someone please help, how to calculate the number of correct boards in E when n * m is even.

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

    if (r-l) is odd $$$\frac{(r-l+1)^{nm}}{2}$$$

    else $$$\frac{(r-l+1)^{nm}}{2}+1$$$

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

      How did you get that formula?

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

      It should be $$$\frac{(r-l+1)^{nm}+1}{2}$$$ instead of $$$\frac{(r-l+1)^{nm}}{2}+1$$$

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

        Can you tell how you get the formula in brief ?

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

          If $$$nm$$$ is odd, all grids are valid. One way to prove it is coloring the grid with a checkerboard pattern (let's assume that the cell in the upper left corner is black) and noticing that you can fill the grid with $$$\frac{nm+1}{2}$$$ dominoes of size $$$2 \times 1$$$ in such a way that each cell is covered and a white cell is covered twice. Using the operation 1, you can increase the value of any white cell by 2 and the value of the other cells by 1 (let's call it operation 3). So, a possible strategy to win is to make the height of all black cells the same, and then use the operation 3 to fix the height of the white cells.

          On the other hand, if $$$nm$$$ is even you can win if and only if the parity of the sums of the heights in the white and in the black cells is the same.
          First, let's calculate in how many ways you can fill k cells with numbers in the range $$$[l, r]$$$ and even/odd sum ($$$dp_{even}[k], dp_{odd}[k]$$$). You can get these values by the following relations:
          $$$dp_{even}[k] = dp_{even}[k - 1] * dp_{even}[1] + dp_{odd}[k - 1] * dp_{odd}[1]$$$
          $$$dp_{odd}[k] = dp_{even}[k - 1] * dp_{odd}[1] + dp_{odd}[k - 1] * dp_{even}[1]$$$
          The relations can be obtained by fixing the parity of the sum of the first $$$k - 1$$$ cells.
          If $$$r - l$$$ is even, there are $$$\frac{r - l}{2}$$$ even numbers and $$$\frac{r - l}{2}$$$ odd numbers in the range, so $$$dp_{even}[1] = dp_{odd}[1]$$$ and $$$dp_{even}[k] = dp_{odd}[k] = \frac{(r - l + 1)^k}{2}$$$.
          Then let's fill all the grid ($$$\frac{nm}{2}$$$ white cells and $$$\frac{nm}{2}$$$ black cells). The result is $$$dp_{even}[\frac{nm}{2}] * dp_{even}[\frac{nm}{2}] + dp_{odd}[\frac{nm}{2}] * dp_{odd}[\frac{nm}{2}] = \frac{(r - l + 1)^{nm}}{2}$$$.

          If $$$r - l$$$ is odd, you can prove by induction that $$$dp_{even}[k] - dp_{odd}[k] = \pm 1$$$. Using some algebra, you can get the result $$$\frac{(r - l + 1)^{nm} + 1}{2}$$$.

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

this is my first time to take part in a real contest. But... I couldn't solve a single task lol

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

Loved D ques.

It was really trivial if you know the basics of BitWise Operations.

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

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

for E, the idea I had in mind was the total count of odd numbers in the grid must be even, then with finite no of moves we can get all numbers with same parity. can someone say where this is going wrong?

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

Please share soln of B !!!!

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

Shortest solution to a D problem ever. Loved the simplicity ;)

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

I'm failed at D at the last minute because number larger rr than >300000 if only i had read the checker logs :(

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

-what if we use 100% of the brain?

=write a hard contest so many participants will hardly solve A and dont solve any other questions and leave the contest so the traffic on the server wont be huge like the last contests

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

D sample test itself is a gigantic hint.

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

For G i did this following observations:
1. It's obvious that answer is 3 or 4
2. Let's suppose we have answer with 4 elements and the indexes are i1,i2,i3,i4. if there exists a solution, that means that there is a solution where i1 and i2 are adjacent indexes + i3 and i4 are adjacent indexes too.
3. So from point 2 , we conclude that we need to find i1 & i3 indexes, such that a[i1]>a[i1+1], a[i3]>a[i3+1] , a[i3]>a[i1] and a[i3+1]>a[i1+1] (or vice versa for a[i1]<a[i1+1] and a[i3]<a[i3+1])
Is the solution based on developing this idea or I am going the wrong direction?

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

This Div2 was having more puzzle problems, I guess!

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

A,B,C Indexfiddlingforces.

However given that lengthy statements it was still fun to participate. For me B was much harder than C. Felt like being testet on how much index-one-off-errors can one avoid.

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

Me RN

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

First of all kudos and thanks to codeforces for handling high participation so nicely.

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

Thanks for the contest. Wish problem-setters have good days <3

By the way, how to solve E guys ? :(

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

Can anyone help me , what i am missing in my logic for question C (k- string)??

Logic : I deduced condition that all of given condition will be satisfied if we try to make an string of length K which is a palidrome. and replace it in all n position (i%k th place).

So first , i stored max count of the variable occuring at a position i(1<=i<=k) ; i stored and made a char array for so(max var);

then afterwards in order to make those k char a palidrome ,i checked from both side to find the optimal character for each pos,

at last i ran loop on string and counted the number of pos (pos%k) ,i need to change ,in order to make it combination of k legth optimal string.

Code

Also , my logic gave incorrect ans on 4th tc (i got 17 but ans was 16)

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

    One way to solve it to group positions which must have same characters to satisfy the rules. Then, foreach such group contribute $$$ans+=countPositions-maxFreqInGroup$$$ of that group.

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

      But how this formula is going to ensure that resulting string will be a Palidrome??

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

        You need to choose the groups of positions right.

        That is, every segment of k chars must be a palindrome, too. So within each segment of k chars is is that $$$s[i]==s[k-1-i]$$$ and all segments are equal. So there are $$$(k+1)/2$$$ groups of positions.

        We need to find the min count of operations to make all chars of one group same, for all groups. If they are same, the whole string is a palindrome.

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

    I also had this problem in my code. But I corrected it after realizing that we have to consider both positions period and palindromic as they all should have same characters.

    As you are considering all characters frequency which are at at pos = i % k and you are selecting max from that for pos = i % k.

    But you also have to consider k - pos - 1 characters for pos = i % k.

    Reason is we have to consider frequency of all characters which can come at pos = i % k and they can be due to period positions and due to palindromic positions.

    My Submission 75017302

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

Am I the only one who did problem C. using a simple DFS with connected components? Felt like an overkill...

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

Solution for E: Let total odd numbers in the range be odd, and total even numbers in the range be even. Let tot=n*m

If tot is odd, then answer is power(even+odd,tot). else the answer is (power(even-odd,tot)+power(even+odd,tot))/2

IS THIS APPROACH CORRECT?

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

Auto comment: topic has been updated by triple__a (previous revision, new revision, compare).

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

B has taken much time because I cannot understand the meaning of the range of $$$m$$$ at first.

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

Why Bob is incorrect in question D, i think his algo is correct for maximum??

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

MikeMirzayanov

My Code is giving right answer for the given test cases of problem -c while running in IDE geeksforgeeks and ide codechef Then I submit it on codeforces..bt it gives wa for the 3rd case of given pretest..It's really frustrating!! Please check once my code..tell why this is happening

include<bits/stdc++.h>

using namespace std;

define ll long long

define ld long double

define pb push_back

define pi pair<int,int>

define pl pair<ll,ll>

int main() { ll t; cin>>t; while(t--) { ll n,k,i,mx,tot=0,j,f; cin>>n>>k; ll fr[27]={0}; string s; cin>>s; for(i=0;i<k/2;i++) { for(j=0;j<26;j++) fr[j]=0; f=0; for(j=i;j<n;j=j+k) { fr[s[j+k-1]-'a']++;

fr[s[j]-'a']++;
        }



        mx=*max_element(fr,fr+26);
        for(j=0;j<26;j++)
        {
           // cout<<fr[j]<<endl;
            tot+=fr[j];
        }
       // cout<<tot<<" "<<mx<<endl;
        tot=tot-mx;
        //cout<<tot<<endl;
    }
    if(k%2==0)
    {
        cout<<tot<<endl;
    }
    else
    {
    for(i=0;i<26;i++)
    fr[i]=0;

        for(i=k/2+1;i<n;i=i+k)
        {
            fr[s[i]-'a']++;
        }
        mx=*max_element(fr,fr+26);
        for(i=0;i<26;i++)
        {
            tot+=fr[i];
        }
        tot=tot-mx;


    cout<<tot<<endl;
    }
}
return 0;

}

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

For problem B

Input:

23

437 519 865 808 909 391 194 291 237 395 323 365 511 497 781 737 871 559 731 697 779 841 961

My output is

10

1 2 2 3 3 1 3 2 2 4 1 4 5 5 6 6 7 7 8 8 1 9 10

And I got this message: wrong answer violates gcd constraint.

Can anyone help explain? I don't really understand the conditions of this problem

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

it was very good contest

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

Can someone tell me why I get TLE: https://codeforces.me/contest/1332/submission/74951923 I genuinely don't know.

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

My quick review:

A — classic shitty A with many cases

B — too long statement for such an easy task

C — good task but too simple for C

D — awful constructive

E — classic «try and guess» combinatorics

F — pretty standard dp (counting again)

G — good task

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

In E, I sincerely thought that answer height had to be between L and R also and was losing my mind for an hour.

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

I just downvoted your contest.

FAQ What does this mean? The amount of contribution (points) on your comment and codeforces account has decreased by one.

Why did you do this? There are several reasons I may deem a comment to be unworthy of positive contribution. These include, but are not limited to:

Rudeness towards me,

Making bad contest,

Sarcasm not correctly flagged with italic font.

Am I banned from the Codeforces? No — not yet. But you should refrain from making contests like this in the future. Otherwise I will be forced to issue an additional downvote, which may put your commenting and posting privileges in jeopardy.

I don't believe my comment deserved a downvote. Can you un-downvote it? Sure, mistakes happen. But only in exceedingly rare circumstances will I undo a downvote. If you would like to issue an appeal, shoot me a private message explaining what I got wrong. I tend to respond to Codeforces PMs within several minutes. Do note, however, that over 99.9% of downvote appeals are rejected, and yours is likely no exception.

How can I prevent this from happening in the future? Accept the downvote and move on. But learn from this mistake: your behavior will not be tolerated on CodeForces.com. I will continue to issue downvotes until you improve your conduct. Remember: Codeforces is privilege, not a right.

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

I really liked the problems :)

I thought they were balanced; considering the score distribution of course.

I think the reason some found them to be unbalanced is that they were kind of unusual. Especially B D which were not like most B Ds. If you ask me though, that's a very good thing.(some saw A to be too tricky and long though, which is kinda true)

The round was smooth enough to be a success considering how many registered.

Good job, you should be proud!

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

Sample test 2 for D gave it away

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

A really Good Contest. Handled 23k Participants with almost negligible waiting queue and still fairly enough strong pretests.

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

Super Fast editorial

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

I figured out why many people(including me) got wa on test 57 in E)
it was because of %(mod-1)

x^y≡x^(y%(p-1))mod p
but there is a condition that x needs to be coprime to p
the following test case was a corner case- 998244352 2 1 998244353

the sad thing is that %(mod-1) wasn't even needed. I wish this test case was in pre-tests

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

Why my first submission to problem B get AC ? The array "to" is out of bounds 75000215

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

Hi, can someone help me figure out what was wrong with my submission for problem B?

https://codeforces.me/contest/1332/submission/74968519

I am a beginner and I am really confused as I implemented a very similar solution to the problem as is given in the editorial.

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

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

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

Am I the only one who started solving D with XOR instead of AND (and only realized the mistake after getting WA2)?..

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

Was A tougher than normal today or was it just me?

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

weak testcases and the queue wasn't full like last div3

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

Math forces :/

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

Nice contest.

A was somewhat harder than usual Div2 contests (BTW, thanks for including the third testcase in the sample — I completely missed that possibility), but I have seen far worse.

B and C were good problems — moderate implementation. I felt D was a bit more difficult to think of, so D should have been worth more points than C. D should probably be worth 1500 points, and E at least 2000 points.

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

Was it really necessary to make the bounds up to 2 * 10 ^ 5 instead of 10 ^ 5, I felt this was unnecessary. I am a bit biased because this was the cause of my FST on problem C.

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

What does "violates gcd constrain" means?

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

Minus A
I really enjoyed the problems from this round

And the definitions of left, right, down and up in A were really weird

  • exactly a steps L: from (u, v) to (u − 1, v);
  • exactly b steps R: from (u, v) to (u + 1, v);
  • exactly c steps D: from (u, v) to (u, v − 1);
  • exactly d steps U: from (u, v) to (u, v + 1);

This doesn't feel right at all!
I feel left and down should be swapped same for right and up

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

triple__a, respect.

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

You should post the top scorers as well as the 1st solves for each problem. That would be cool

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

Thank you for the contest triple__a, I really enjoyed it :) Particularly problem D, which I managed to get in the last 2 minutes (luckily), which was really fun to do!

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

Why do we need to consider both cnt[i%k][j] and cnt[k-i%k-1][j] in question C?

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

OK!

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

does memset work slow?

problem c gives TLE using memset [submission:https://codeforces.me/contest/1332/submission/74982492]

with vector got AC [submission:https://codeforces.me/contest/1332/submission/74983633]

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

    Memset is wildly fast. The issue with your submission is that you memset the entire array (of size 5.2 million) for each of up to 100000 test cases. This is $$$5.2 \cdot 10^{11}$$$ operations, which is way too many. Manually filling the array with zeroes up to $$$n$$$ or $$$k$$$, or using vectors in your case, makes your runtime on the order of $$$\sum n$$$ instead of $$$T \cdot 5.2 \cdot 10^6$$$.

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

Auto comment: topic has been updated by triple__a (previous revision, new revision, compare).

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

Hey! I am very beginner to competitive coding. may anyone suggest any lead from where i should start?

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

Hey guys, I made a video tutorial for problem F which, btw I really enjoyed solving! https://www.youtube.com/watch?v=oEPtZLUG4iQ