11

Aising Programming Contest 2022(AtCoder Beginner Contest 255) Announcement

 1 year ago
source link: http://codeforces.com/blog/entry/103738
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Aising Programming Contest 2022(AtCoder Beginner Contest 255) Announcement

We will hold Aising Programming Contest 2022(AtCoder Beginner Contest 255).

The point values will be 100-200-300-400-500-500-600-600. We are looking forward to your participation!

107 minutes ago, # |

Wow, this ABC feels so different(looking at B and C's unusual difficulty). Took 20 min for C, but 5 min for D...

E is really nice. How to solve E better than ? My solution surprisingly TLEs on 12 cases with that complexity

  • 102 minutes ago, # ^ |

    Did you try treemap? is enough for E. My submission

    • 101 minute(s) ago, # ^ |

      Maybe its unordered map constant factor

      • 94 minutes ago, # ^ |

        Actually no. It's probably because [] operator inserts the element into the map if it's not already present, with default value 0. So you should first check the element's presence and then only access it using [].

        • 91 minute(s) ago, # ^ |

          Rev. 2  

          0

          Thanks, it removes the TLE. Lesson learnt. Solution

  • 82 minutes ago, # ^ |

    There are two main observations:

    • If we fix the value of any element of , then the value of all other elements can be determined easily.

    • Let us say we fixed the value of index = , then if we increase by , then all such that = , value of will increase by and for other elements their value will decrease by .

    Now since we've already fixed the value of , we can easily find the value of other elements of . Now, to maximize the answer we will find the value by which should be increased (or decreased) such that becomes equal to . After finding this for every possible , we will just increase(or decrease) by the most frequent value and calculate our final answer.

    Submission

    • 6 minutes ago, # ^ |

      Personal lesson from this contest: Read statements carefully. At first I tried to solve Problem E assuming . When I was done, the sample didn't match and I realized my error.

      Went on to solve F instead, to forget my wrong assumptions.

      Turned back to E, realized how to solve it when reading it correctly, but then the contest was over. Upsolved 10 minutes after the contest: Submission — It's basically the same idea as your's. I'm not entirely sure why your's takes only 668ms compared to 861ms from my cleaned-up version


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK