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

Автор thanhchauns2, 4 года назад, По-английски

Hi Codeforces!

GlowCheese, DeMen100ns, SPyofgame and I are delighted to invite you to participate in Codeforces Round #812 (Div. 2).

  • Start time: Aug/06/2022 17:35 (Moscow time)
  • Duration: 120 minutes.
  • Number of tasks: 6, including at least one interactive problem. Make sure to read this blog and familiarize yourself with these types of problem before the round!
This contest is brought to you by:

Special thanks to:

The score distribution is 500-1000-1750-2000-2500-3000

Hope to see you in final standings!

UPD: We have a small gift for a Vietnamese participant who have the highest score, so if it is you, please DM me after contest. Good luck everybody!

UPD2: Editorial

UPD3: Congratulations to the winners!

Div.2:

  1. RGB_ICPC7

  2. Xylenox

  3. 5cd

  4. Jason2022

  5. Imot

Div.1 + 2:

  1. peti1234

  2. A_G

  3. kotatsugame

  4. jiangly

  5. Rubikun

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

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

As an author, love you SPyofgame

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

As a fan of idol thanhchauns2, I'm really looking forward to participating and solving his own contest. Hope everyone have a great time!

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

problems are great!

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

ᓚᘏᗢ

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

As a tester, I wish u guys could gain the rating :3

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

Finally your contest after 1 year,

Excited to see and all the everyone!!

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

As a tester, hope you guys to enjoy this round.

As a weeb, I recommend you guys Youzitsu (Light Novel) and Gabriel Dropout (Anime/Manga)

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

As a tester, I hate love DeMen100ns

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

As the biggest fan of DeMen100ns and SPyofgame, hydroshiba orz

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

Intentionally skipped testing this round, hope this one will be as good as previous one

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

The white text is painfully obvious on mobile

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

My best effort in this project is breathing instead of making instant-rejected problems (")>

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

Finally your round, obviously I will take part in it

»
4 года назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится
  • "Last but not least, you for your participation and being WA, then dropping at least one color :P" It's the best easter egg I've ever seen :P
»
4 года назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

amogus

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

orz

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

why this announcement is published 6 weeks ago?

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

nice :>

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

As a tester, i worked with authors who are talented high school, college students, they had to make a lot of efforts to prepare problemset during months, some problems were rejected or removed to have the best problemset for contestants. So no matter what you feel about this round, plz upvote this contest to encourage young Vietnamese CP-ers to contribute global CP community. Finally, let's enjoy our problems and hope all you guy get good ranking.

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

By the way, the kitty on the promotional picture is really cute (>w<)

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

Picture looks really good,hope it will be a nice round :)

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

I hope that C, D will not be as difficult as in the previous contest

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

Hope I can reach Master after this round! Good luck to everyone!

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

Seems like nobody notice that our coauthor, DeMen100ns has two colors in the announcement.

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

Hope everyone have fun!

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

Most colourful blog I've seen in a while :3

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

image-2022-07-06-T09-36-54-205-Z

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

Watch as people upvote me just because I am a GM

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

04bf86d84b4883c8e7e6e94ed23606ff

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

Wish I can solve at least one problem!

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

Good luck! love you SPyofgame

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

Again a contest with a huge gap between B and C :(

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

i would personally prefer two minutes later, but ok

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

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

Is this rated for me? Up to 2100 or up to 1900

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

C 1750 looks scary :(

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

I will try to become Expert in this contest!

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

According to the points distribution, I guess C is going to be a good question. So what do u think ?

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

I will become specialist this contest!!!

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

Good luck for everyone ❤(✿◕‿◕✿)❤

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

As a participant, I wish myself good luck in advance

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

One of the authors is in a really bad health situation right now. To all participants, please shows your respect to him by solving as many problems as you can, we all want him to overcome as soon as possible.

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

| Last but not least, you for your participation and being WA, then dropping at least one color :P

B-but we can't drop any more colors

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

I guess the interactive problem is problem C because it has 1750 points :) Is my thinking correct or not ?

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

All the Best @EveryOne !!

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

Hope I become pupil in this contest

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

leetcode overlapping contest :( Anyways will solve at least 1st on leetcode, just to get coins for a leetcode shirt :)

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

Stuck on problem A :holyfuck:.

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

b and c are very good problems!

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

How does a blue coder solve f in 5 minutes? Jiangly didn't do it for 40 minutes.

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

How to solve E?

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

Video Solution for Problem C.

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

Hi,

I solved problem C at 1:14:31. But later i saw the code and felt that it might fail system testing as i used int instead of long at one place so i submitted again at 1:47:33 and as of now both are showing pretest passed. But i am getting points according to the 2nd attempt. If after system testing my 1st accepted solution does not fail so will i get score according to my 1st submission or 2nd submission?

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

    During system testing, your first submission will be skipped and your second submission will be considered. Also you'll lose extra 50 points for resubmission.

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

      ok thanks,

      Due to unnecessary resubmission i lost around 280 points today.

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

        I wouldn't consider it unnecessary if you personally had doubts about your solution. If you couldn't assure yourself that it would pass, then it would have been risky not to resubmit, since you would have lost a lot more points if it failed. Better to resubmit early than to wait until it gets hacked, or worse, until it fails system testing.

        I think the real lesson is that you should really examine your code carefully before the first submission, and that if you have some doubts later on, you should think carefully about whether such concerns could actually prevent acceptance. If you are unable to clear such concerns, then I think you should resubmit without regrets, even if you realize after the contest that it was okay. Hindsight is 20/20, after all.

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

    According to Codeforces Contest Rules

    If a contestant submits several times a problem's solution that passes all pretests, then the last solution is considered as the contestant's verified solution for this problem. All other solutions will be considered as unsuccessful attempts.

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

    The rules are that a resubmission will incur the -50 penalty, regardless of whether the former would have passed system test or not. It's unfortunate, but that's how it is.

    While there is no way to know for sure whether your first submission would have passed the system test now, I think int should be perfectly fine, because the largest square that needs to be considered is at most $$$2 (n - 1)$$$, which is well within int limits (unless you did something really crazy in your solution).

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

Amazing contest!

I am very happy because I solved 3 problems (A, B and C), unfortunately I solved them too late with 2 WA on pretest 2 verdicts. Does anybody know some real tips on how to solve problems faster and with less wrong submissions?

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

Great problems. (Specially D) How to solve D? Did anyone get AC using randomized algorithms, it would be great if someone could share some insights.

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

what is the observation for b? time is very tight for c can an o(n*k) solution pass main tests? where k is number of perfect numbers less than 2 * 1e5?

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

For problem D the time limit was so tight using java it passed with C++ but cost me 20 minutes to debug in C++ since I don't use it much, couldn't you make a larger time limit for java? other than that the problems were really good.

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

As a Candidate master, I even can not solve C, and I got the worst standing since I sign in Codeforces... sad

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

    C is worst problem in long time... we have to see simple but completly random stupid observation. Like christmas riddle for pre schoolers.

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

      The fact that there always exists a square between $$$[n, 2n]$$$ is not something I would consider to be stupid at all... In fact, this is not only easily observed from thinking of small examples, but it's also easy to prove.

      Similarly, the observation that $$$(a + b) = (a + i + b - i)$$$ is extremely trivial.

      Neither of these are stupid. It does require some mathematical maturity to realize that these two observations would lead to an exact solution, but there is no randomness or stupidity involved here.

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

      It's not a stupid observation. You can do strong induction and claim that if you can build array using numbers (0,i), for each 0<=i<=n, it's also possible to do so with numbers (0,n+1). This is due to the fact that there's at least one perfect square between i and 2*i. Now you have construction using the given prime for finding (n+1)-th element, and thus can fill the suffix (i,n+1) in increasing fashion, and due to induction hypothesis we can build the remaining part.

      It's a cute problem imo.

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

      I think both C&D are tricky, agree with that the observation of C is quite random. Again, sadly I didn't pass any of them... This time I may lose more than 150 rating ... :(

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

    As a Specialist, I even can not solve B, and i got the worst standing since i sign in Codeforces... sad

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

First time I solved pD on div.2!

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

Has anyone Accepted the problem-D using Java? I have tried reusing array[1 << 15] but the TL seems too tight.

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

B is very similar to a USACO problem

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

Sad for Python users — D was very difficult to complete within the time limit.

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

what's wrong with this approach for D?
get winner of 1-2 pair, now we covered participants up to covered=2, then go iterating over next participants from covered+1 to covered*2. if someone won more matches then it's a winner for range from 1 to covered*2. now change covered=covered*2 and repeat until end.
somehow I get WA

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

Is the idea for $$$E$$$ correct? I got WA2.

Create graph with $$$n$$$ vertices. Iterate over all $$$i \lt j$$$ and if $$$a[i][j] \lt a[j][i]$$$ add edge with $$$xor = 1$$$, meaning, we have to swap either $$$i$$$ or $$$j$$$ cross, if $$$a[i][j] \gt a[j][i]$$$ add edge with $$$xor = 0$$$, meaning, we have to either swap both $$$i$$$ and $$$j$$$ cross, or not, if $$$a[i][j] = a[j][i]$$$, don't add edge.

All edges have time of appearing. We have to satisfy the greatest prefix of such edges. Let's do binary search. We fixed subgraph with times $$$ \lt x$$$. We have to set to all vertices value 0 or 1, to satisfy all edges' xor. First set all vertices undefined. Iterate over vertices, if we see undefined, set to it any value and do dfs. Dfs only walks on available edges, if it sees undefined neighbour vertice, it sets correct value to it and goes to it. If it sees neighbour vertices, such that is doesn't satisfy edge's xor, then we can't satisfy this prefix of edges.

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

167298607 why this got TLE ????

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

I have probably used all of my luck for the next few months: Screenshot-2022-08-06-093710

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

I loved this contest!

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

D was reallllly difficult to complete within the time limit for Python user!!!!!!!!!!!!!!! It's unfair!!!, please rejudge it!!!

»
4 года назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится
  • For D Problem, I applied the same logic as mentioned in the editorial, but i am getting Wrong Answer.
  • I have tried my best but I am not able to figure out the mistake.
  • Can someone please help me to figure out the mistake? 167302006
»
4 года назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

167304705 why is this got TLE???

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

what is wrong in my approach for problem B https://codeforces.me/contest/1713/submission/167293528 Approach inserted all the elements of the array into the set if the size of set is equal to the size of array this means that the all the permutations have cost greater or equal to array therefore YES

if not then i m checking the position of duplicate elements if all duplicate elements are adjacent this means the permutations of it has greater cost so the answer is yes otherwise the answer is no.

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

    The NO-instances are not characterized by duplicate elements. But rather, they are characterized by the transition from decreasing to increasing. For example, the array [2, 1, 3] should output "NO" (it requires 4 operations, whereas [1, 2, 3] only requires 3 operations), even though there are no duplicates.

    The issue with decreasing->increasing is that the two sides cannot be decremented at the same time once the center becomes 0, whereas a sorted/reverse-sorted/increasing->decreasing array can ensure that every operation hits all non-zero elements at once.

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

Thanks for the great contest :) !!!! Really loved all the problems and especially problem D And a great rating increment :)

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

A great contest ! Kudos to the problem setters and testers ^_^

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

Great problems. To be fair, I raged pretty hard about the time limit being way too tight on D (or there being way too many queries for an interactive problem), but other than that, great set :)

Screencast and solutions to A-D will be available on my youtube channel as soon as youtube finishes process it.

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

the pretest of B is shit!

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

In problem B there should have been a pretest where you needed to use long long int!

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

Balanced contest! Edit: I got expert back!

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

In problem D, if n=6, can we make 43 queries?

As, (2 ^ 7)/3 is around 42.67

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

can someone tell me what is wrong with my B solution: https://codeforces.me/contest/1713/submission/167256508 . i've been trying to figure it out for the past 3 hours :)

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

The best contest of 2022! Orz thanhchauns2

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

Interesting E. I come up with it just after the contest finished:(

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

Any particular reason for C being of 1750 points?, I think it was not that hard and could have been of 1250 or 1500 points.

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

Really good questions. Thanks for the contest

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

Use greedy strategy, problem D could be solved within 2^(n-1) queries?

this submission https://codeforces.me/contest/1713/submission/167314546 assert queries * 2 less or equal 2^n

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

In problem D, In the test case given, can't 2 win the contest?

1 2 3 4 5 6 7 8

2 4 5 7

2 7

2

The final win array becomes = [0, 3, 0, 1, 1, 0, 2, 0] Can someone explain this.... any point I'm missing?

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

    Yes, it can. But it gives the right answer 7, so it is accepted, even though its logic may be nonsense at all, i.e. the tester only cares about the final answer, rather than the logic behind.

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

wish there were stronger pretests :c

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

Expected Brood War themed problems.

thanhchauns2 didn't deliver.

As a consequence, I had a terrible performance. Lowest rating in almost 2 years :(

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

Ваше решение 167238238 по задаче 1713B значительным образом совпадает с решениями других участников и находится в группе одинаковых решений altgifted/167238238, vasily312/167281265. Такое совпадение является явным нарушением правил. Отметим, что непреднамеренное утечка тоже является нарушением. Например, не следует пользоваться ideone.com с настройками по умолчанию (публичным доступом к вашему коду). Если вы имеете неоспоримые доказательства, что совпадение произошло по причине использования общего источника, опубликованного до соревнования, то напишите комментарий к посту о раунде со всеми деталями. Подробнее можно прочитать по ссылке http://codeforces.me/blog/entry/8790. Такое нарушение правил может являться основанием для блокировки вашего аккаунта или других штрафных санкций. В случае повторения нарушений, ваш аккаунт может быть заблокирован.

MikeMirzayanov

Что делать в такой ситуации? Я вообще без понятия что это за человек, исключено чтобы он хоть как-то получил доступ к моему решению, я использовал локальный ide

Могу только предположить, что это случайное совпадение – шаблонная обертка и решение в 2 цикла

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

Shit interactive problem