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

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

Всем привет!

31 июля 2017 в 17:35 (по московскому времени) состоится рейтинговый Codeforces Round #427 для участников из второго дивизиона. Как всегда, участники из первого дивизиона смогут принять участие вне конкурса.

Задачи для этого раунда были подготовлены мною. Большое спасибо Алексею Илюхову (Livace) за помощь в подготовке раунда и прорешивание задач, AmirReza PoorAkhavan (Arpa) за вычитывание условий и прорешивание задач, Александру Гаеву (krock21) за прорешивание задач, Николаю Калинину (KAN) за координацию раунда и, конечно, Михаилу Мирзаянову (MikeMirzayanov) за замечательные платформы Codeforces и Polygon.

Раунд будет длиться 2 часа, и вам будет предложено 6 задач. Рекомендую прочитать условия всех задач. Надеюсь, каждый найдёт интересную для себя задачу!

Разбалловка будет объявлена перед началом раунда.

Разбалловка: 500 — 750 — 1250 — 1500 — 2250 — 2250.

UPD.

Cпасибо за участие в раунде!

Разбор здесь.

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

Div2:

  1. ywwyww

  2. nick452

  3. JustAnAverageCoder123

  4. cxt

  5. wa1tz7I9

Div1:

  1. dotorya

  2. rajat1603

  3. anta

  4. Kaban-5

  5. HellKitsune

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

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

wow, already another round, i'm exited!

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

Damnit codeforces, two consecutive rounds is too much.

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

Hope short statements like your announcement :)

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

I missed previous round. I mustn't miss this round, wish everybody luck! :-))))

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

how can registration? please tell me

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

2 rounds in 2 days..amazing..

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

Two consecutive rounds.. in one time, when some people just are not able to take part — they are sleeping, including me :(

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

2 rounds in 2 days?

sign me the FUCK up good shit go౦ԁ sHit thats some good shit right there right there if i do ƽaү so my selfi say so thats what im talking about right there right there (chorus: ʳᶦᵍʰᵗ ᵗʰᵉʳᵉ) mMMMMᎷМ НO0ОଠOOOOOОଠଠOoooᵒᵒᵒᵒᵒᵒᵒᵒᵒ Good shit

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

Can't register. Says I'm already registered for the contest. Can someone help?

EDIT: Fixed now.

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

Will the problem statements as short as this announcement? :)

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

wow double div2 rounds! Brilliant!

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

Whom About this round ?

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

3 day after today will be another contest so we should say : one week ,3 contest,what a beautiful week!!!!

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

WOOOWW so good that 2 contests in 2 days

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

I hope electricity will be fixed till the beggining of the contest :D

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

Wow. i like everyday have codeforces round!

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

Wow, I like have a codeforces round everyday.

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

nice

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

Wrong tag 417! Please edit.

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

is it going to be rated?

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

i wish next round like this start tomarrow :)

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

I had one question. is it rat

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

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

Not able to submit even though I'm registered.Anyone facing the same problem?

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

Problem in submitting soln to second problem, second question is not accepting submission , i m trying to submit but it does'nt resdirect to submission page and keeps loading , plzz look into this matter

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

Too difficult C these days .

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

some guy just opened an account and solved all 6 problems .... (I think this is a hattrick if memory serves me right) -_-

At this rate, there will be fewer div2 coders than div1 coders

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

Answering questions in this round was like.

We're sorry if the statements was not as clear as we thought

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

how to solve C ?

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

Nice pretests xD

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

How to solve D?

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

Very nice problems! Thanks, qoo2p5!

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

Short announcement, short statements. Cool!

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

HELP! Somebody help me with B. I didnt passed the pretest. Though it passed all tests i made my as per my intution on my pc. i dunno what i missed.

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

Thx for the short statements!

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

how to write a proper generator to cause TLE on B. I keep getting Generator crashed. I tried print(1e8) loop 1..1e8 : print('8')

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

Does O(N2log(N)) pass for D ?

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

anyone has any idea about the third pretest for C ??

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

Any hack tcs for div2 A,B? Thanks!

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

How to solve E ???

PS: E was a very awesome problem.

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

    I have an idea asking for each of bit of the position but dont have enough time to code

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

    Let answer be A and B (A<B). For each bit position, find whether the bits at that position are same or different in A and B. For highest diff position, A has 0 and B has 1. For all other positions, find the bit at that position in A. Correspondingly, you get the bit for B.

    To check if the bits at position pos are same/different for A and B, put all numbers having 0 at position pos in a set and query the system. If the number of occurrences of Y is 1, then the bits at pos are different in A and B.

    To find the bit at position pos for A (after you've found the highest differing bit high), put all numbers with high=0 and pos=0 in a set and count the number of Ys in it. If the number of Ys is odd, then A has 0 at position pos and 1 otherwise. Now based on the relation found earlier (bits at position pos are same/diff for A and B), you know the bit for B too.

    To count the number of Ys in a set, use the following -
    If size of set is even, the no of Ys is 0/2 if XOR is 0 and 1 if XOR is X^Y.
    If size of set is odd, the no of Ys is 0/2 if XOR is X and 1 if XOR is Y.

    You can see my code for an implementation of the same.

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

    I was asking for each bit. Then answer for some bit must be y or x xor y and then I have numbers which have only one y. For first number I just make binary search on numbers with this bit.

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

    For simplicity, suppose there are 1024 icicles numbered from 0 to 1023, so you can interpret them as 10-bit bitstrings.

    First 10 questions: ask the icicles that has 0 on i-th position, for each i. If there are 0 or 2 of the special icicles, the XOR will be 0; otherwise, the XOR will be x^y. Also note that it's impossible for all questions to give XOR 0.

    Now you know the answers to the questions. Suppose the special icicles are numbered p, q, and their XOR is r. We claim that the i-th bit of r is 1 if the i-th question gave x^y, otherwise it's 0. It's actually not difficult to prove; you can try it, or I'll expand on it later.

    Now you know that there are 512 possibilities of pairs of the special icicles. Interestingly, each icicle is involved in exactly one of them. Pick one icicle from each pair arbitrarily, then binary search on them.

    EDIT: Since n is not necessarily 1024 (it's impossible to be that, in fact), you need to fudge with it a little. You're still asking the same question, but now the response is either 0 or x^y (if there are an even number of icicles), or either x or y (if there are an odd number of icicles).

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

    Let set Ai be the numbers from 1 to n that have their ith bit on. Also let F(H) function be the xorsum of set H's elements. If for some set X or then X contains only one special element. We'll calculate F(Ai) for every 0 ≤ i < 10 (this is 10 operation). Let j be the first set Aj that Aj contains a special thing. Let's do binary search in 9 steps to find it (we can do it because |Aj| < 512). So we have the index of one special thing, but remember the 10 steps we did earlier? Just invert those bits in this one to find the other special thing.

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

Can someone please explain problem D in detail!!

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

It's really scared that In problem D I came out with a very complex idea( to me :) ),which make me code for more than an hour T^T,Hope it pass...

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

Waiting for round #428 ...

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

-- Как всегда, участники из первого дивизиона смогут принять участие вне конкурса. -- Кажется, участникам первого дивизиона не интересно участвовать ВНЕ конкурса :)

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

I finished problem C, but I have not submitted. T^T

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

I'm curious did anybody manage to get AC on D with O(n^2logn)? My O(n^2logn) solution was about as optimized as it could be (super low constant) but got TLE.

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

This was a really nice and smooth contest, good problems, short statements and good pretests. Thanks to everyone involved for making this such a great contest.

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

I literally spent the whole contest trying to solve C but I kept getting WA on pretest 3
Here's one of my submissions 29072095

I'd be glad if someone tells me what I'm doing wrong, it really drove me nuts throughout the entire contest.

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

The test case for problem C were very weak. Brute force solution is getting AC verdict.

See this code

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

В задаче С, мне кажется, следовало бы добавить пояснение о том, что в одной клетке могут быть несколько звезд.

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

how to solve problem — C?

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

Any discussions on the last problem? How do people write such long codes in such short time.

I cannot even write codes for C without bugs.

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

Test cases in Div 2 C problem are very weak. Even brute force of O(Q*10^4) is getting AC :(

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

test cases for problem C were very weak.even O(q*n*n)(n=100) solution got AC. see this solution i think it should be rejudged with proper test cases.

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

By the way, I would like to thank qoo2p5 for the absence of anti-hash tests for problem D :) This really makes me happy (although I should have calculated lcs in O(n2) time :D).

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

Because of one symbol, I got WA. I erased this symbol after contest and got AC. I'm so sad...

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

how to hack in contest

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

Could someone help with this one ? O.o Problem B submission I can't figure out why it should get WA on 24 :/

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

How to solve F?

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

Scrolling to find a comment about rating change? If yes, like this comment :P

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

regmsif is a cheater for sure. Templates of his submissions are completely different. KAN

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

Is the educational round unrated? Or somebody just forgot to update the ratings.

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

In problem C, Is it possible that two stars are at same position?

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

Is it rated? Looks like not...

Or somebody just forgot to update the ratings.

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

Can someone explain why is't publish the final result of contest?!

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

KAN qoo2p5 Please check Ali.P and Ali.PI submissions, seems same thing to me, possible cheat. Ali.PI Submission , Ali.P Submission

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

Ratings rolled back? weird. Edit: They are back with new ratings. Apparently mine increased. wtf?

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

What's wrong with the rating changes in this contest? My new rating disappeared and so does many others (I checked)!!!

UPD: NOW BACK TO NORMAL.

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

How this one passed C — 29077578 :| Just looping from (x1, y1) to (x2, y2). Shouldn't that give TLE? As it is O(1e5 * 100 * 100) ~ O(1e9) in worst case!

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

My rating disappears and my submission is marked "skipped". What's wrong

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

Actually the problem F is quite similar to one problem in NOI(China)2013 . So if I have solved that problem before and I copied the code so I finished the problem very fast(only in less tha 5 min, for example ) , is that cheating?(Actually this time I wrote the code again)

Sorry for my poor English.

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

The same solution for problem C using C++ got accepted link

but got TLE using C# during the contest Link

And I see many solutions like this.

very nice...

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

I tried to solve E using binary search, where first i'm finding index such that xor of indices 1 to index contains exactly one y. Then using binary search between [1,index] and [index+1, n] i'm finding indices of y. But due to redundant queries i'm not getting right answer for n > 500. Can someone optimize it or tell why is it not possible to solve using binary search. Here's my code http://mirror.codeforces.com/contest/835/submission/29088791. Thanks in advance

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

    It is not possible to find using binary search the first Y in a sequence which has 2 Ys, because the prefix XOR function is not monotonous.
    eg. Let the sequence be str[] = XXXYXXXYXXX (1-indexed)
    The prefix XOR of str[1..2] is 0, of str[1..4] is X^Y and that of str[1..8] is also 0.

    What do you do when you encounter a prefix XOR having value 0? Do you go left or right? In case of str[1..2], you need to go right. But in case of str[1..8], you need to go left. The prefix XOR values are NOT monotonous.

    The algorithm you mentioned will work if the sequence has only 1 Y.

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

      Let's say mid = (1+n)/2, now if 1 to mid values don't contain only one y i.e(value is not y or x^y) then we take mid1 = (1+mid)/2 and mid2 = (mid+n)/2, now we keep doing mid1 = (1+mid1)/2 and mid2 = (mid2+n)/2 until one of these mid values don't contain exactly one y. Then we assign values as i mentioned before i.e start1 = 1, end1 = mid(or mid1 or mid2), start2 = end1+1, end2 = n and proceed as before. If something's wrong here, please correct me.

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

I don't know why DIV.2 problem C is NA... 29145513

BUT!!! This code is accept.. 29145520

It's just different this code

for (int t = 0;t <= 10;t++) { sum_val_map[t][y][x] = ((c + t) % (C + 1)); (NOT ACCEPTH)

for (int t = 0;t <= 10;t++) sum_val_map[t][y][x] += ((c + t) % (C + 1)); (ACCEPT)

Somebody explain it to me plz!!

Do duplicates come in as inputs?