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

Автор 300iq, 6 лет назад, По-русски

Hello, Codeforces community!

I'm glad to invite you to Codeforces Round #609 (Div. 1) and Codeforces Round #609 (Div. 2), which will be held on 21.12.2019 14:05 (Московское время). The round will be rated for both divisions.

The problems were taken (mostly) from the ByteDance — Moscow Workshops Online Contest, that's happening at the same time. They were prepared by myself and tested by EvenImage, Claris, quailty, jiry_2 (camp TA team), and gamegame, isaf27, tmwilliamlin168, mango_lassi, WNG, Lewin, sas4eka, UselessDev, Aleks5d,MrDindows.

ByteDance is a technology company operating a range of content platforms that inform, educate, entertain and inspire people across languages, cultures, and geographies. ByteDance has partnered with Moscow Workshops ICPC and Codeforces to organize a top tier and exclusive training camp for the International Collegiate Programming Contest. The upcoming Programming Camp will be held in Beijing from February 10th to 16th, 2020.

ByteDance — Moscow Workshops Online Contest is an opportunity to participate as teams in this camp.

You can find more information about this training camp, including registration and prizes at https://programcamp.bytedance.com/.

UPD: Editorial

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

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

Very cool round!!!

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

I thought Syloviaely was the one testing the round XD

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

Will you come to the camp in Beijing? Hope our team can qualify though......

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

EvenImage choose to wait and let the tourist drop, would it Success?

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

2019 has come to an end and Codeforces contests are a lot and really great. Love that, love Codeforces <3

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

I'm having an HTTP status 403 — forbidden message when trying to register. Cannot login from any other device/browsers as well. Is it an ISP issue?

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

300iq's problems being tested by Chinese coders. Yet another proof that...

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

It overlaps 1 hour with the topcoder SRM

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

So many contests in December! Codeforces is growing to be more and more awesome. Love you Codeforces!

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

Здравствуйте! А условия на русском языке будут?

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

Will In div 2 be a lots of greedy?

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

Огласите разбалловку задач.

»
6 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится +116 Проголосовать: не нравится
when i hear about a chinese something
»
6 лет назад, скрыть # |
 
Проголосовать: нравится -11 Проголосовать: не нравится

Score distribution?? Reaaly want to come expert!

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

Thank you for the short statement problems...!!! :)

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +23 Проголосовать: не нравится
When you are sure that it's going to fail system testing
»
6 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -22 Проголосовать: не нравится

Pretests for Problem B too weak!!!

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

Задача Div.2C отстой.

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

How to solve problem DIV2 B and C ?

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

First 3 tasks in div 2 were rather boring and technical.

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

What was pretest 4 in Div2 D?

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

How to solve div2 D?? wa4..

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

pretests of C are weak.I did a hack with:-
6 3
129999

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

Can someone explain the idea of problem C?

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

    Notice that the answer will have same number of digits as the original number. Because 9999...999 will always be a beautiful number.

    Well, it is clear that only first k digits need to be decided.

    So, first make a number by taking initial k digits as it is and check if it is greater than or equal to the original number. If yes, that is the answer.

    If no, then find the rightmost position in the first k digits such that it is less than 9 and update all the digits are this position to 0. Then form the beautiful number from this and return this as the answer.

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

    I did in this way:
    Firstly you can observe that the answer will not have more than $$$n$$$ digits.
    Let the number created by the first $$$k$$$ digits is $$$z$$$. First repeat $$$z$$$ (upto length $$$n$$$). Now, we get a number let's say $$$y$$$. If $$$y$$$ is greater than $$$x$$$, then this is your answer. Else, if $$$y$$$ is less than $$$x$$$ then increment $$$z$$$ by $$$1$$$ and repeat this new number (upto length $$$n$$$).

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

what is the hacking case for Div 2 C ?

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

How to solve div-2 D??

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

People should google instead of solving problems during contest.
T̶o̶d̶a̶y̶'̶s̶ ̶p̶r̶o̶b̶l̶e̶m̶ ̶B̶.̶
A similar chessboard problem of today's B. link.

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

    But any proofs that it is the case in this problem?

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

      Lets color the whole table black and white like chess board

      Lets call the number of black cells B and number of white colors W. It is obvious that you cant place more than min(W,B). Because each domino takes one cell from each color.

      We can also prove that we can place min(W,B) dominos with induction. but it is complicated and long and needs drawing pictures that i don't know :).

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

        I mean, I know the answer is $$$min(W, B)$$$, but the proof is really hard.

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

          Not so hard, see another thread for details

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

          Yes . It was not that easy

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

          Not sure if it true, but we can try to construct in this form.

          There are 4 types of rows, starting with a color x and ending with a color y. So we will have a row in the form x?..?y.

          The difference of the total quantities of black and white, will happen in the types of rows with (x = WHITE, y = WHITE) and (x = BLACK, y = BLACK).

          So if we have more black than white, we can remove the last cell of a row (x = BLACK, y = BLACK). Similar when we get more white than black.

          Now we want to know, how to assign the extra rows (x = WHITE, y = WHITE) and (x = BLACK, y = BLACK), as the others types of rows can be assigned easily.

          Then we find the first position of rows of type (x = WHITE, y = WHITE) and first position of rows of type (x = BLACK, y = BLACK) and remove one cell from start + 2*k of the rows of type (x = WHITE, y = WHITE) and (x = BLACK, y = BLACK) and remove two cell from start + 2*k in the rows in between, where k is the number of column that have been used in the rows in between, the removal part can be tiled easily and repeat until there is no more rows of these types.

          Following this process we can obtain a possible tiling for the remain, and we can check that this removal process is aways possible.

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

    How is this today's problem B?

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

      "The other answer correctly explains that such a covering is impossible because it would require an equal number of black and white squares (since each domino must cover one black and one white square), which the corner-cut board does not have."

      Just paint given board as a chessboard. Alternative black and white in colour. Take minimum.

      I got WA 4. I just googled "place 2x1 and 1x2 pieces on board" this was the first link with that statement as the first answer. Then AC.

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

    I did know this that if we remove opposite corners of a chess board, its impossible to cover it with 2x1 dominos, but how does this derive to solution of this problem?

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

    I would expect that specific problem from SO to be known to most of div1 contestants.

    However, I would say there is a long way to go from that problem to solving and proving div1 B.

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

    Can relate

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

    Skill of googling is much harder than what is described in your link.

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

    Unpopular opinion: I have two goals when doing contests: to have fun and to improve my problem solving abilities. Googling doesn't fulfill any of these goals, so I don't do that even though it is suboptimal sometimes.

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

What's pretest 7 in Div2 C?

My solution involved taking the first k digits of the number. Then, check if we can just repeat those first k digits and get a valid number greater than equal to the original number, If not, I just incremented the first k digits by one (increment the rightmost digit not 9, and set all the digits to its right to 0), and then repeated it.

Am I right with the observation that the answer will never have more digits than the original number? What else could be wrong with my approach here?

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

Prestest are weak for c,My soLn will fail for 7 3 3993998.

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

The problem statements were concise and clear. Nice work!

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

Difficulty level of B's increasing these days .

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

Is that solution of Div1B?

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

Is problem "K integers" solvable, without using treaps? btw: "K integers" AKA div1C/div2E

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

    Answer for some k is number of inversions between these numbers, and cost of bringing together the numbers. If number is > k it should go to left of first position, or right of last position, so it's sum of min(cntLeft, cntRight), which can be calculated with two segment trees.

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

    I thought of a solution using segment tree and adding small changes to the change in median of the previous k permutation and the inversion count. Couldn't implement properly in time :(

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

In C Div2 , I think the main idea is to have k chains or k components , each of them has one digit but you have to intersect between them to get the minimum number I tried but i couldn't solved it ... any help ?

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

Hackforces yeeeeeeeeah

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

How to solve div2A ?

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

Nice contest, thanks!

Two incorrect hacks on A because of possibly passing $$$O(n^2)$$$ solution (link). Looks like a traditional for me rule "if $$$n \ge 100000$$$, no $$$O(n^2)$$$" should be revised.

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

What is the issue on 28 test of problem Div1D? Swistakk

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

    I simply got a stupid bug, I sorted not this vector which I was supposed to, so I don't know in what way it can be tricky. It was in the part of determining which vertices when flipped lead to strongly connected graph.

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

MathForces!!!

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

For me always most of the competitions were worst as I performed poorly in the contests but this contest led me to think that googling out is better rather than thinking and applying the logics. 300iq wasted my day today..............

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

How to solve div2 B problem,i am getting time limit exceeded!!

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

Again I will go green

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

I am always delighted whenever it is useful to determine strongly connected components of tournament in $$$O(n)$$$ knowing degrees of vertices :D

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

I locked my solution for B and later realised that I never read that minimum x was asked, and also that I didn't make x positive. RIP rating.

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

for div2 B if a=[0,4,5] and b=[1,4,5] and m=7 there is no such x

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

what are good tests

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

Hello, dear 300iq, it seems to me that you would be good at doing olympiads for mathematicians!

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

...

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

The pretests are just sad.

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

C was easier than B imo.

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

1417th before sys tests, 813th after

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

I hacked div2.C of the guy who was at the top of my room and I took his place. After it he made another submission. Finally, his second submission passed the system tests, but mine didn't. LOL! https://mirror.codeforces.com/contest/1269/room/251

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

Just before the end of this contest, my rank is 70 and it became 776 after system test. Anyway, It's first time for me to get two FST in one contest, so it's a fruitful contest (maybe?) .

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

300iq request to enable link of contest in " Codeforces Round #609 (Div. 1) and Codeforces Round #609 (Div. 2)," of announcement.

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

tourist comes again in Div1 and once again consolidates his number 1 rank.

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

Can anyone tell me why my codes gets TLE. 10^5*2^3 = 2*10^8 should have been passed within 3 second? Code Link: https://ideone.com/US2vA8 Thanks

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

How to solve B via string matching algorithm?

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

...

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

Я думаю это будет достаточно сложный контест, т.к. тут замешаны китайцы :D PS:Я никого не осуждаю не принимайте близко к сердцу :(

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

submission — 79465012

problem — 1269C - Long Beautiful Integer

submission

Anyone who can tell why this failed in test case 7 ?

It will be a great help if someone can take time out from their busy schedule and help a co-learner. :)