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

Автор Okrut, 5 лет назад, По-английски

Hello Codeforces!

We have a pleasure to invite you to Good Bye 2020, which will take place on 30.12.2020 17:35 (Московское время). You will have 3 hours to solve 9 problems. The round will be rated for participants of both divisions.

The problems for this round were prepared by gawry, Anadi and me.

We would like to thank everyone who made this round possible:

We hope you will enjoy the problem set! Good luck!

UPD: Score distribution: $$$500$$$ $$$-$$$ $$$750$$$ $$$-$$$ $$$1000$$$ $$$-$$$ $$$1000$$$ $$$-$$$ $$$1500$$$ $$$-$$$ $$$1750$$$ $$$-$$$ $$$2500$$$ $$$-$$$ $$$3500$$$ $$$-$$$ $$$4000$$$

UPD: Editorial

UPD: Congratulations to the winners!

  1. tourist
  2. maroonrk
  3. Benq
  4. scott_wu
  5. fivedemands
  6. Um_nik
  7. mnbvmar
  8. heno239
  9. aid
  10. ainta
Анонс Good Bye 2020
  • Проголосовать: нравится
  • +1604
  • Проголосовать: не нравится

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

New year magic when ?

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

more than glad to say good bye 2020 with more than a trifle of passion

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

Will there be a interactive problem like last year?

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

I was literally waiting for this contest since 10 months :)

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

Can't be more excited for an year to end. Thanks codeforces and all its team for being a constant part of our daily life even in such a pandemic situation.

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

I can smell the taste of rating loss :v (kidding)

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

As a tester, I would like to honor memory of Chester

If you struggle with depression, don't be afraid of reaching for help!

Have yourself a wonderful CF round!

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

Rename it to FUCK OFF 2020

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

As a tester, I would say that this contest is the only good thing happening in 2020.

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

Happy NewBye 2020 !

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

Will there be in this New year a nickname changing and New year magic?

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

Good bye 2020 and Happy 2020-II :))

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

can i reach expert before 20201? what do you guys think?

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

one day I will also reach candidate master. AMEN

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

SecondThread as you are one of the best coders who have experience with problems, what is your opinion about the contest?

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

I am looking forward for this with huge interest!

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

I love coding but I want to gather with my family at the end of the year :((

Good luck to you and have a nice New Year's Eve <3

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

Will be there also Hello 2021 contest?

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

I WISH I WOULD HAVE GIRL FRIEND IN 2021

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

Some coders with the name ---"I LOVE _______" are extremly waiting for 2021...xD

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

Do KAN and Nebuchadnezzar coordinate together because they have the same name?

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

Hope everything will be better in 2021

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

I think that Goodbye 2020 is the only good thing in 2020

Hope everything will be better!

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

As a tester, I found the problems very interesting and enjoyed solving them. Good luck :)

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

Hoping MikeMirzayanov to change his username as a new year gift :)

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

I hope that the design of Legendary grandmaster will be upgraded to New Year Magic. Look at the rating digits

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

Just curious, What is the strategy to be followed to increase rating in global rounds?

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

How come rating of some coders directly start from 1500?

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

As a tester, Good Morning and Goodbye!

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

I wish This Good Bye 2020 will not become good bye expert for me.

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

What about the Score-Distribution (or penalties for wrong submission) ?

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

Can't be more excited for an year to end. Thanks codeforces and all its team for being a constant part of our daily life even in such a pandemic situation.

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

As a tester I think you will enjoy these statements : )

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

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

Request : Dark mode/theme for codeforces in 2021

it feels better on eyes, continuously switching between text editor (which has dark theme) and codeforces Websites causes eye strain.

Just a small request to devlopers.

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

Is it rated?

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

Is this contest suitable for someone in Div. 3. I am in grade 9 and have a decent understanding of CP up until this point.

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

3 hours, 9 tasks. it looks like good training for ICPC.

Can you allow team registration?

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

31 December: Am i joke to You! (*_*)

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

My First Good Bye Contest in Codeforces!

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

The first contest I gave was Hello 2020. How soon a year passed

The main reason for my progress this year has been Codeforces

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

.

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

rated for both divisions? I think we have div1, div2, div3. which two are rated?

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

pog

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

I hope this last contest won't land me back into specialist. Fingers crossed :)

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

Seems like this would become the contest with highest number of participants. 17k+ have already registered!

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

My rating is 2021, wondering if I should give this contest to spoil it...

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится
Your code here...
print("Hello 2021")

I think that all code editor should change their welcome style--> "Hello world"-->"Hello 2021"

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

Today's contest will help me to reach pupil. AMEN

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

GoodBye rating!

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

May Almighty make all things right in 2021....

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

This is the last contest of year I hope this at least goes well for me

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

I really don't want to bring my orange name to 2021 . This is my last chance to reach red in 2020!

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

I Love Second :(

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

Nice, I have been waiting for a long time. Thanks Codeforces !!!!

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

HAPPY NEW YEAR GUYS HOPE U ALL GOOD RATINGS :D

BYE 2020 : )

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

Why not be "Hello 2021"???

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

2020 was the worst phase my life. Full of depression and suicidal thoughts. Literally I was striving to overcome. Luckily I survived and now I will be participating here in Good Bye 2020 :)

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

When is the contest "Good bye COVID-19"?

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

This makes me soooo happy. Finally 2020 is going :')

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

I've never had a positive delta in any Div1 Div2 combined round, let's see if I'm able to get out of this curse today :P

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

Goodbye, 2020! Hope this will be a good round with strong pretest, short and clear statement problem.

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

Good Bye 2020 on 30th Dec: MikeMirzayanov be like I can't wait till 31st to say good bye to 2020.

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

I have a feeling I'll have a positive delta in this round :-P

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

Rating Bye-Bye 2020?

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

Those who start 2021 year with a rating of 2021 will be lucky :P

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

4 problems with scoring less than 1000, 6 less than 1750! Is it gonna be SpeedForces :\

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

Hoping this Good Bye 2020 doesn't turn out to be Good Bye ratings. Fingers crossed.

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

One Decade on codeforces will be completed by today's conntest for tourist

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

does this distribution mean problems would be easier?

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

I know the authors and I have an idea. Let's not destroy their New Year's Eve and let's assume that the statements are correct, and not ask 500 questions this round, ok? This is a combined round, we can assume that if something is wrong, then, let's say, somebody orange+ will ask a question about this. OK? If you think that something is wrong with the statement — assume that you misunderstood it.

What do you think about this idea guys? Let's treat this as a gift for them.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -10 Проголосовать: не нравится
cout<<"Happy Good Contest"<<endl;
cout<<"New year luck"<<endl;

:)

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

this year thaught me many things, gave me many experience, but the best thing i ever experienced was that happiness when my first solution was accepted on codeforces contest. hello every coders out here, i love you all.

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

Really enjoyed the statements! Thank you!

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

Something irrelevant, if I submit the correct solution twice do I get -50 as penalty for that?

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

Should've had one more problem between F and G :(

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

Bye 2020 !!... Let's find out how will your 2021 be

click one of the options below...if u get Rick Roll ..Believe me your 2021 will be amazing

1.A

2.B

1.C

2.D

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

How to solve E ??
I wish my knowledge like apollo or pan !

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

I'm like 50-50 on whether G is super brain observation or string algorithm, and either one is :(

Good contest though. A bit on the easy side for the first six questions, but nice problems.

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

test 7 on F

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

A good contest for me at the end of the year, solved 5, wish they pass the system testing :) Finally became specialist at the end of the year :)

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

any ideas/hint for D? i did dfs but can't recognized my bugs :/

EDIT: got AC right now, thanks guys for your insights chenreddy Liviu2000 rum3r Guslix

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

    DFS not needed. Try to solve the problem by observing the optimal edge distribution for small inputs. Try to make use of indegrees.

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

    try to build an array of pairs {degree,weight} and then sort it.

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

    It's can make new subgraph of new color such way that the new subgraph is connected. New subgraph obtains from one of current subgraphes by splitting to 2 parts. Each time when k increasing by 1, the value of coloring is increasing by the value of such vertice where was splitted the old subgraph. So for each k choose maximum vertice of possible. Just count for each vertice the number of edges that adjacent this vertice

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

Cool NY contest, thanks!

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

This round was sexy AF. I really enjoyed the problems (like a lot!). This has been my best performance so far and I'm very happy that I was able to do so in the last contest of the year. It's been a rough year for many, a great time to grind CP for others and a somewhat meh year for me. Whatever it has been, happy new year to everyone! Hope everyone has a great year ahead!

I don't understand how F could possible have 1000+ solves as it seems way too orz than normal. If someone could tell me how to solve, I would be very happy about it. The problems this round were great (to say the least) and the difficulty ordering and level felt perfectly balanced. Thank you authors!

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

    If you think about how xor of individual dimensions cancel out on F, we can reduce it to a minimum spanning tree problem. Edges will be connecting the two dimensions that are on in a matrix (or a dimension to 0 if the matrix only has one on dimension), and weights on the edges is simply the edge number. This produces lexicographical order.

    It can be shown that all 2^|S'| possible sums produced are unique.

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

Was score decay adjusted for 3 hour duration?

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

Another shit of 2020 ended today lowering n to 10000 in C allows dp[N]*[26]*[26] solutions but memory limit exceeded due to tight constraints.

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

I wish you a happy new year Hoping for your increasing success and a world without corona virus in 2021!

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

How to Solve Problem C ?

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

How to solve C, anyone?

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

    You can always make a palindrome cease to exist if you change its middle character (if even length) or change 2 middle characters (odd length > 3). So we just need to find length 2 and 3 palindromes and change them so that they donot remain palindromic.

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

      I came up with that idea, but couldn't proceed more than that. tried a way to remove greedily but was failing i.e. getting WA. Can you elaborate how to remove 2/3 len palindromes?

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

        Check if the first two characters are same, then change the second one. Now run a loop form the 3rd character to last and check if it is equal to any of the previous two characters. If it is, change it. When I say change, consider to changing it to some arbitrary character which is not a lower case alphabet. This is because, since you have 25 choices to change the character, and a character from the string can only contribute to maximum 4 different palindromes, that is, i-2, i-1, i+1, i+2. There is always an optimal choice that doesn't affect other palindromes.

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

        Yeah sure,

        For len 2 palindromes, say at indices : (i,i+1) you have to set the second character(i+1) such that it does not equal to i,i+2 and i+3.

        For len 3 palindromes, say at indices : (i,i+1,i+2) you have to set the third character(i+2) such that it does not match (i,i+1,i+3 and i+4).

        Also there is a condition for len-3 here : (s[i]!=s[i-1]) which is explained below :

        So we would first correct all 3 len palindromes and then proceed to filter all 2 len.

        Explanation of condition:

        Say there is some string of form "bbab". Here there is a 3 len "bab" substring. So according to our logic we would make the last b equal to some other valid character, say now it became : "bbax". Now we proceed to 2 len filter and find "bb". And now say we get "byax". So changes are 2, but answer is 1 as you can always change the second b. i.e "bxab" works here.

        Lastly we count the new changes by storing the indices in a set.

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

    approach each adjaent 3 characters must be different. think of greedy/dp now

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

why did this submission get time limit :(

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

Because of question E, I learnt how to write and submit C++ code today. I have always been writing in Python.

It is a good start for 2021.

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

I tried to solve problem F in following way : First sort the input . Now we traverse from smallest to largest in lexicographic order, if i am at some string of form say 010001 , then i will check if there exist two strings previously 010000,000001 or 010x00,000x01 i.e two strings whose xor can give the that string .If there exist such strings then we can skip the current string. I didn't knew fast way of doing that . Is my approach correct and if yes how to do above fast ?

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

I feel so sorry for you Radewoosh

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

can anyone share how to solve F?

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

Very interesting problems!Thanks to everyone who contributed!

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

I do not get why would I not get E. The math was correct I got test case 1 and then I would not pass test case 2. Please tell me what I could be possibly doing wrong.

#include<bits/stdc++.h>
#define ll long long
#define ld long double
//#define M_PI (2*acos(0))
#define MAX_N 10001
#define MOD 1000000007
#define apo(a,b) sqrtl( powl(a.x-b.x,2) + powl(a.y-b.y,2) )
#define ldeq(a,b) ( fabsl(a - b) < 0.00000000007 )
#define rep(a,b) for(int i=a; i<=b; i++)
#define repv(a,b,i) for(int i=a; i<=b; i++)
#define mmod(a,b) ( (a >= 0) ? ((a%b)%b) : ( ( ( a + ( ((abs(a)+b)/b) * b ) ) % b ) % b ) )
#define int ll
using namespace std;

int p[60];
int mp[600000+1];
int all[60];

void doit(){

	int n;
	cin>>n;

	vector < int > x;
	x.push_back(0);

	int f;
	rep(1,n){
		cin>>f;
		x.push_back(f);
	}

	n = x.size()-1;

	int ans = (int)( 0 );
	rep(0,59){
		all[i] = (int)( 0 );
	}

	rep(1,n){
		int s = 0;
		while( s < 60 ){
			if( (int)( x[i] & p[s] ) != (int)(0) ){
				all[s]++;
			}
			s++;
		}
	}

	rep(1,n){
		int tmp = 0;
		int s2 = (int)(0);
		while( s2 < 60 ){
			if( (int)( x[i] & p[s2] ) != (int)(0) ){
				tmp += ( ( n * ( p[s2] % MOD % MOD ) ) % MOD % MOD );
				tmp = (tmp % MOD % MOD);
			}
			else{
				tmp += ( ( all[s2] * ( p[s2] % MOD % MOD ) ) % MOD % MOD );
				tmp = (tmp % MOD % MOD);
			}
			s2++;
		}
		mp[i] = tmp;
	}

	rep(1,n){

		int s = (int)(0);
		while( s < 60 ){

			if( (int)( x[i] & p[s] ) != (int)(0) ){
				int ep = ( ( all[s] * p[s] ) % MOD % MOD );
				ans += ( ( ep * mp[i] ) % MOD % MOD );
				ans = ( ans % MOD % MOD ); 
			}

			s++;

		}

	}

	ans = ans % MOD % MOD;
	cout<<ans<<endl;

}

#undef int
int main(){

	ios::sync_with_stdio(false);
  	cin.tie(0);

	ll t=1;
	cin>>t;

	ll k = 1;
	for(int i=0;i<60;i++){
		p[i] = k;
		k = k * (ll)(2);
	}

	while(t--){
		doit();
	}
  	
}
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +83 Проголосовать: не нравится

Duh, H was so incredibly unnatural it took me 15 minutes to parse the statement and 45 more to understand it on an intuitive level so that I could even start thinking about it >_>

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

    It looks much more natural if you know about stable matchings. The condition for a matching to be stable is that there are no bad cycles of length 2. Here it's premutation instead of matching and we check cycles of all lengths. And the greedy solution is also similar to stable matching.

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

      Maybe I don't see something, but the setting that "i-th person has i-th item and some other hypothetical assignment that has absolutely nothing to do with current assignment is optimal if blah blah" sounds absurdly to me. It would make sense for me if "A is not optimal if I can change it locally and get better assignment", but "A is not optimal if I can take some other assignment and change it locally and get better assignment than A" is very artificial

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

    the third agent got an item that is worse for him, but this does not prevent the set $$${1,2}$$$ from being dissatisfied

    Well, agent 3 has good heart and might not be angry, but I was so unhappy with that; So unfair and unintuitive.

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

How to solve F?

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

Solutions to problems like F make you feel so freaking stupid. My dumbass brain kept thinking variations of xor gauss for two whole hours before getting the idea of dsu ╥﹏╥

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

Some people were giving solutions of A in youtube while contest was running :/ Youtube Link

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

Lot of plagiarism in this contest, many newbies have solve more than 4 problems which is kinda sus.

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

can anyone tell me why my code has a runtime error on pretest 2 for 1st problem it works on the test given https://mirror.codeforces.com/contest/1466/submission/102858058

include

include<stdlib.h>

include

using namespace std; int numberofarea(int arr[], int n) { int area[100]={51}; int diff,areas=0; for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ diff=arr[j]-arr[i]; area[areas]=diff; areas++; } } sort(area, area + 100);

// Traverse the sorted array
int res = 0;
for (int i = 0; i < 100; i++) {

    // Move the index ahead while
    // there are duplicates
    while (i < 99 && area[i] == area[i + 1])
        i++;

    res++;
}

return (res-1);

}

main(){ int t,n,x; cin>>t;

for(int i=0;i<t;i++){
    cin>>n;

    if(n==1){
        cin>>x;
        cout<<"0"<<endl;
    }
    else{
            int arr[50];

        for(int j=0;j<n;j++){
            cin>>x;
            arr[j]=x;
        }
        cout<<numberofarea(arr,n)<<endl;
        free(arr);
    }
}

return 0; }

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

can anybody please tell what's wrong with my submission for D https://mirror.codeforces.com/contest/1466/submission/102825313

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

I hate Python.

Problem E is Python's nightmare.

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

System testing seems to be stuck at 40% for a long time now. I wanted to submit for C and E.

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

Seems that the system testing is going fast again

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

Let's have a 9 problem round!

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

I think it will be great if we will have "Hello 2021" too. Special thanks for this good contest

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

Hi. How was it for you? It was the worst contest for me. Really bad :(

I hope no one will be sad in 2021.

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

Editorial vanished ,"You are not allowed to view the requested page". Anadi please check .

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

Iam happy I solved 3 problems.may be I will reach pupil now.

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

Thanks for the excellent contest with interesting problem set and happy new year!

Hope I can reach 1900 after the rating update, then it means every contest that I participated in 2020 increased my rating.:) But can't really be too positive coz it's 2020 lol

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

I think solution of F was leaked during contest. I suspected some gray and green coder solving F. Their solutions were almost same. Here are few

102850390 102838530 102840741 102846397 102831257 102830882 102847086 102852571 102856887 102830939 102833288 102858390 102859336 102837504 102855188 102830843 102832179 102831022 102834391 102848243

and many more.

MikeMirzayanov can you please run plagiarism check on problem F?

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

why the time limit for the problem E is so tight?? My solution O(n*60) gives me TLE but the solution O(n*MaxLog(Xi)) gives accepted. I don't know but i think you should increase the time limit a little bit:(

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

102856933

Isn't it illegal or something?

EDIT:

Ok, it was made after the contest, but this one is the same: 102821945

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

Will this round influence our ratings? If so, then when will the ratings be updated?

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

Does the contest will be unrated ??? https://mirror.codeforces.com/blog/entry/86135

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

Awesome way to end year regained expert with exactly 1600 points

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

First to solve: (There is one impostor among us) tourist

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

such a bad year

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

    I think problem E is at least 1900 difficulty. Congratulations on your HUGE progress in TWO days!

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

    Hi bro, I find this on the cheating group posted by others.

    Solution for E

    I think this code is very similar to yours. Because of programming habits, even similar ideas will result to quite different coding style.
    Or you can convince me by explaining:
    1. Why you mix the use of scanf and cin?
    2. Why you set the length of cnt[70] to 70?
    3. Why you use variable name of cntt and modd?

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

guys can anyone explain what's wrong with my submission ,it is passing the given tests. https://mirror.codeforces.com/contest/1466/standings/friends/true#

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

Can someone explain me why my PyPy submission for Problem D getting TLE and same code get accepted in Python. Got 9 wrong submission for this. Any justice out here.

Python code — 102842960

PyPy code — 102839435

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

Can anyone help me iam getting wrong answer in Problem D(13th Labour of Heracles). Thanks in Advance! My Submission-> 102895743

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

Any idea about Hello 2021 contest?

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

Amazing contest thanks

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

In the comment section, I noticed some red coders, opened their profile and saw that their max rating hadn't crossed even 1700 yet their profile name is being displayed as IG or LG. Even their contest graph has not touch the red-region. Am I missing something guys?? :/