awoo's blog

By awoo, history, 3 months ago, translation, In English

Neapolis University Pafos

Hello Codeforces!

The series of Educational Rounds continues thanks to the support of the Computer Science and Artificial Intelligence (CSAI) program at Neapolis University Pafos, with scholarships provided by JetBrains.

Educational Codeforces Round 187 (Rated for Div. 2) will start on Feb/25/2026 17:35 (Moscow time).

This round will be rated for the participants with rating lower than 2100. It will be held on extended ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest, you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally.

You will be given 6-7 problems and 2 hours to solve them.

The problems were invented and prepared by Adilbek adedalic Dalabaev, Ivan BledDest Androsov, Maksim Neon Mescheryakov, Roman Roms Glazov, Maks FelixArg Novotochinov and me. Also, huge thanks to Mike MikeMirzayanov Mirzayanov for great systems Polygon and Codeforces.

Good luck to all the participants!

Our friends at Neapolis University Pafos also have a message for you:

Admission is now open for the BSc in Computer Science & Artificial Intelligence. Up to 40 full scholarships from the JetBrains Foundation will be awarded this year, covering tuition, accommodation, insurance, visa fees, and a €300 monthly stipend.

JetBrains Blackbox Cup 2026 Join our new unique coding competition, happening on March 15, 2026.

  • Imagine joining a project with no documentation and no backlog. Your mission: explore the system, uncover hidden logic, and start solving tasks — step by step, through experimentation and smart guesses.
  • AI tools are welcome! AI assistants and modern developer tools are fully allowed — resourcefulness is part of the challenge.
  • Two leagues: Junior — high school students & Senior — university students, graduates, and professionals.

Registration closes on March 13.

Winning the Blackbox Cup can also boost the chances of getting a fully-funded JetBrains Foundation scholarship for BSc CSAI at Neapolis University Pafos(extra points on the entrance test).

See you!

UPD: Editorial is out

  • Vote: I like it
  • +119
  • Vote: I do not like it

»
3 months ago, hide # |
 
Vote: I like it -24 Vote: I do not like it

SIX SEVEN

»
3 months ago, hide # |
 
Vote: I like it -31 Vote: I do not like it
print("Hello World")
»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

WoW !

»
3 months ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

SIXTY SEVENNNN

»
3 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Why are there people with more than 2100 rating that have registered as an official participants?

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it -32 Vote: I do not like it

    Because when they are registering their rating was below 2100, now their rating has increased above threshold but because of some codeforces bug they still counted as official participants.

»
3 months ago, hide # |
 
Vote: I like it +16 Vote: I do not like it

i love edu rounds but the fact is it always decreases my ratings!!!

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

No testers???

»
3 months ago, hide # |
 
Vote: I like it -10 Vote: I do not like it

Thanks for the round! Interesting to see the Blackbox Cup format—good luck to everyone participating!

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

When can I become purple

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Guys, what are the differences between educational round and normal round?

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I wish I can solve C and become 1500 rating or above. I wish there is at least one problem in difficulty 1400 — 1600 for me to study.

»
3 months ago, hide # |
 
Vote: I like it -13 Vote: I do not like it

cp just ruined my life, i hate cp im never coming back here

»
3 months ago, hide # |
 
Vote: I like it -69 Vote: I do not like it

What is the point of these rounds?

  • They're not "educational" as the name implies (in fact, the average div-2 accomplishes the original goal of these rounds (to expose more users to general algorithmic techniques) to a far greater extent)
  • They're not fun. I think they can be summarized as "div-3s but less fun, less balanced, and way more tedious". Having no testers doesn't help either.
  • They waste slots. Why not have regular div-2s instead of these rounds? Considering how the proposal queue is always full, there's certainly no shortage of problems for regular rounds.
  • ICPC scoring sucks, I have no idea why it's present in this format.

Even contests like Good Bye 2023 are infinitely superior to whatever today's round was.

  • »
    »
    3 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    Considering how the proposal queue is always full, there's certainly no shortage of problems for regular rounds.

    actually it's not very full right now

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it -10 Vote: I do not like it

    Actually, I fell educational rounds like math rounds?! Of course, it can be helpful for some people, but I think it should have a tag like "MATH-HEAVY ROUND". An educational round on a place where people practice algorithm should not have 5 out of 6 problems kinds of math =((((

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Guys, I think you misunderstood my opinion. I really enjoy ICPC format, and I also like math problems too. What I am trying to say is that there should be some other kinds of algorithm in the round instead of so many math and observation-based problems in a round like this. I didn't intend to be that rude in this comment, just felt bad because of bad performance so pls don't downvote me T_T

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I strongly disagree

    I think what makes this round special and fun is the fact that it's in ICPC scoring it's a fresh and nice thing that you know that solving the problem is more important than not getting WA, plus it's really the format of most Olympic comp where number of sub doesn't matter

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

why is it so hard man:(

»
3 months ago, hide # |
Rev. 2  
Vote: I like it +12 Vote: I do not like it

Nice round! Though I feel like C > D

»
3 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Hey guys, During this contest and in the last 10 minutes, I headed towards B, I thought this would be a simple greedy algorithm, but I never really had learned any algorithm, I now have wrote this code

#include <bits/stdc++.h>
using namespace std;

int main() {
  int m= 0;
  int t;
  cin >> t;
  while (t--) {
    string x;
    cin >> x;
    int l= x.length();
    if (l == 1) {
      m++;
    }
  }
  return 0;
}

Its not even complete, If anyone knows what should I do next, please help me.

  • »
    »
    3 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    Well, it is a greedy=)))). We have a claim that a number is beautiful only if sum of its digits <= 9. Therefor, just continue replace the biggest digit with 0 (with 1 if it is the leading digit) until you have the sum <= 9. This is my AC submission for it 364339561

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    already someone said but i hope it helps you understand a little bit

    function F needs only one digit(zero to nine). so another number(10~ ...) is not beatiful numbers. this is the start.

    and i solve this way. first enter the x as string. and do the for loop to init the vector (example, if x is 645 -> v = {5, 4, 5}, x'first can't be zero) and calculate sum of x in same for loop. and sort(v.vegin(), v.end(), greater<>()). until sum is samller than 10, subtract the v's element and count reps. that's it.

»
3 months ago, hide # |
Rev. 8  
Vote: I like it +36 Vote: I do not like it

Solution of F: First put numbers from 1 to n on a binary tree, where the root is floor((1+n)/2), and the left and right child of each node represent the left and right range of the next step of binary search. For example n=12:

             6
          //   \\
       3          9
    /    \      /   \
   1     4    7      11
    \     \    \    /  \
     2     5    8  10  12

Then we can observe that for any two nodes u < v (proof omited):

(1) If u is ancestor of v, or the v is ancestor of u: beauty(u,v) = n-(v-u).

(2) Otherwise, beauty(u,v) = n- (2 + (size of subtree of right child of u) + (size of subtree of left child of v)).

We denote the formula above as n- (2 + RSZ(u) + LSZ(v)).

To calculate the answer, first we pretend that there's no situation (1). Then we iterate v from 1 to n, use a map to maintain for each possible size k, there are how many u < v such that RSZ(u) = k. By the structure of the binary tree, there are at most O(log(n)) different possible sizes of subtrees, so the complexity is O(n*log(n)).

Second, we need to deal with situation (1). Note that the height of the binary tree is at most O(log(n)), there are at most O(n*log(n)) pairs of nodes with ancestor relation, so we can brute force for every single pair.

Therefore, we solved the problem in O(n*log(n)).

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Code example: 364371615

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    You can deal with both situations in one dfs: 364374549

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Actually, it's possible(and not hard) to reach $$$O(n \log^t \log n)$$$(t is a number from 0,1,2, depends on how you write the code) for this problem.

    For situation (1), we can enumerate the node with the smaller depth between u and v, and it becomes two range adds. There's $$$n$$$ nodes, $$$O(1)$$$ each, $$$O(n)$$$ total.

    For situation (2), we can enumerate the LCA of u and v, and we only need to merge the nodes in the left subtree and the ones in the right. Since when a node has a depth $$$k$$$, there's $$$O(\log(n)-k)$$$ different values of $$$\rm{RSZ(a\ node\ in\ its\ left\ subtree)}$$$ and $$$\rm{LSZ(another\ node\ in\ its\ right\ subtree)}$$$, calculating this node costs $$$O((\log(n)-k)^2)$$$ (if you use map, there could be one or two $$$\log \log n$$$s), the total cost is $$$O(\sum\limits_{i=0}^{\log n} (\log(n)-i)^2 \times 2^i)$$$, which turns out to be $$$O(n)$$$.

    Though, this optimization would give the code a great constant factor, it doesn't seem to be better than your $$$O(n \log n)$$$ one.

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Man I almost got D but TLE is kicking my butt.

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Though i couldn't solve problem C, i enjoyed thinking about. Any ideas on how to solve it?

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    hint just think in terms of bit you know that the answer will be sum of each numbers bit for example say 13 3 so you know that whatever a b c d e will be itll be just sum of bits of 3 so find greedily n using binary search or you can do this with in nlogs time

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Man I have so much work to do, and I left all that in the hopes of giving this contest and solving some nice problems.

Wasted 2 hours of my time, and now I still have work to do. GGs.

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

In C, we were supposed to take ceil of s/m, given that the least bit of m must be less than or equal least bit of s, then answer exists. What am I missing?

  • »
    »
    3 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    try $$$m=73,\,s = 132$$$

    in binary:

    $$$m = \,1001001$$$

    $$$s = 10000100$$$

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Thanks. I found direct maxing when all bits are not on is failing and gives negative values so I think maybe a binary search approach will work for those cases. Another simple case I found is $$$ m = 10,s = 14$$$.

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

D is too IO-bottlenecked, it's not humane

»
3 months ago, hide # |
Rev. 2  
Vote: I like it +2 Vote: I do not like it

Is there an easier way to solve E than:

  1. Maintaining BITs for prefix / suffix cnt / sum
  2. Calculating $$$prefixScore_i = prefixCnt_i \cdot sortedA_i - prefixSum_i$$$ (and $$$suffixScore_i$$$ simularly) using the corresponding BITs.
  3. Using BIT + binary lifting to quickly find the i-th currently used position in sorted order ($$$sorted_i$$$).
  4. Binary searching on the inflection point of $$$prefixScore_{sorted_i} \gt suffixScore_{sorted_{i + 1}}$$$ and checking adjacent positions for optimality.

It took me like an hour to implement this T_T (though my implementation skills have never been good)

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it +5 Vote: I do not like it

    Id also like to know if there is any cleaner approach. Only difference between my solution and your idea is that i used segtree for the (cnt,sum) part, then the binlifting becomes a simple find_kth in the segtree cnt field 364371413

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Imagine the binary search you do in step 4 as you have a big seesaw with points that weigh down on it based on how far away it is from the center, and you are trying to find the center which balances the seesaw. You can do some math to show that the center should be the average of the currently active values so it suffices to try $$$O(1)$$$ choices for Alice near the average.

    Based off this, all you need to do is maintain a set of active values, use lower_bound to find an element near the average, decrement/increment the iterator to get surrounding active values, and use your BITs to compute the best score Alice can achieve.

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Does it not work if you try to locate the point in which the prefix sum is approximately equal to suffix sum of the sorted list of elements and iterate on values near there?

»
3 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

My solution for E got TLE in Python, but after translating it to C++ post-contest, it got AC. Sad for Python users, it’s time to learn C++ I guess.

Otherwise, fun contest!

»
3 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

For C i though check all the bits in S(from MSB to LSB) where there is a one and find all distances after the postion of the one in S to the ones in M bits, if some of those distances have been found before do nothing and if not add the min distance, after that sum up all the unique distances as power of 2. I could not prove why it is incorrect yet it gave me a wrong answer on the last test case in the problem. Can someone help me?

»
3 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Could any please explain solution to C?

  • »
    »
    3 months ago, hide # ^ |
    Rev. 3  
    Vote: I like it +11 Vote: I do not like it

    $$$m$$$ allows us to use only certain degrees of $$$2$$$ to be used in $$$a_i$$$. The problem reduces to represent the target value $$$s$$$ as a sum $$$\sum 2^{k}s_k$$$ where $$$2^k \& m$$$, minimizing $$$\max{s_k}$$$

    Notice that larger degrees of $$$2$$$ can always be exchanged into lower degrees of $$$2$$$.

    Therefore the strategy is to do a binary search on $$$n$$$, for each guessed $$$n$$$ we iterate over allowed degrees of $$$2$$$ in decreasing order and subtract greedily

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Understood, thanks!

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      but the s is not in 2^k so how we ensure that subtracting the highest value of 2^k will always give the best answer??

      • »
        »
        »
        »
        3 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        I saw a solution without binary search below, but in my solution we do binary search on the maximum number any of $$$2^k$$$ can occure in $$$n$$$.

        Therefore my suggestion was not sutract the highest value of $$$2^k$$$, but subtract the maximal possible value not exceeding the current threshold (whihc we conduct the binary search on)

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Why? My O(n log n) solution for Problem D got TLE on the 12th test case.364371872

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it +4 Vote: I do not like it

    for(int j=a[i];j<=V;j+=a[i])

    This can iterate V times for each i if a[i] = 1

    You should sum equal elements

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      what the solution for d i tried to get every divs for each ele in b and check if it in a but i get tle

    • »
      »
      »
      3 months ago, hide # ^ |
      Rev. 2  
      Vote: I like it 0 Vote: I do not like it

      Hey,

      can you please explain your solution for C. I tried going through your solution but didn't get it. I understood that we need to Binary search of some sort but unable to understand it. Help would be appreciated .

      • »
        »
        »
        »
        3 months ago, hide # ^ |
         
        Vote: I like it +4 Vote: I do not like it

        In C you can binary search the anwer. An element a[i] can only have some bits that m has.

        To check for a value k if you can get the sum s you can assume that all k elements are equal to m at the begining meaning you have k instances of all bits in m you can use. Then you try to get all the bits in s.

        You can start from the most significant bit. You greedily take bits starting from this bit to 0 and try to get it by summing the values of taken bits. If you cant get a bit you lose or else you move on to the next bit

        For example: you want to get bit 3 with k = 2 and m = 3 (you have bits 0, 1) You first take all 3 bits 1 and have sum = 6 You still need 2 so you take 2 bits 0 and reach the sum

        It is always optimal to take higher bits because lower bits can be used to create other lower bits and taking a bit wont mess up the sum because it is divisible by lower bits.

        This kinda was my thought process

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      thank you so much.

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it +5 Vote: I do not like it

      I think C is definitely more difficult than D.Do you think so too?

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    And don't forget the magical

    int main() {
        std::ios_base::sync_with_stdio(false);
        std::cin.tie(NULL);
        ...
    }
    

    ...

»
3 months ago, hide # |
 
Vote: I like it +15 Vote: I do not like it

i totally got cooked by C, reaching cm is so tough

»
3 months ago, hide # |
Rev. 2  
Vote: I like it +7 Vote: I do not like it

Test Cases of D have IO Bottleneck.

My Contest Submission: TLE

Same Solution when attempted with this, worked:

std::ios_base::sync_with_stdio(false);
std::cin.tie(NULL);

Same Solution with Above Code: Accepted

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it +6 Vote: I do not like it

    Same issue here. Realized after contest that I didn't enable fast io and so did almost 10 to 12 submissions with tle

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Same here. Took too long to realize... Never had problems without it here before this problem

»
3 months ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

Looks like D has very tight constraints. Can someone explain why my solution https://mirror.codeforces.com/contest/2203/submission/364365602

here gives TLE, whereas I can see similar solutions have got accepted

  • »
    »
    3 months ago, hide # ^ |
    Rev. 3  
    Vote: I like it 0 Vote: I do not like it

    Maybe because of extra overhead, you are unnecessarily storing values in freq vector. Store them in simple vectors

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      I realized that in all my submissions, I hadn't enabled fast IO, that's why it was failing. Solved this problem pretty fast in contest but it didn't pass. Now realized it was the problem :(

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    It gives TLE because the nested loop that checks all multiples for every possible value up to n + m is too slow, especially when there are many test cases. Even when most values do not appear in the input, the code still iterates over them, leading to roughly (n + m) log (n + m) operations per test case. On top of that, large vectors are recreated for every test case, which adds extra overhead. Together, these factors make the program exceed the time limit.

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it +3 Vote: I do not like it

      I realized that in all my submissions, I hadn't enabled fast IO, that's why it was failing. Solved this problem pretty fast in contest but it didn't pass. Now realized it was the problem :(

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

B was nice

»
3 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Can someone either prove or disprove my solution for C? If it's incorrect you're welcome to hack it :)

Solution

EDIT: This has been answered here.

»
3 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

For D,

https://mirror.codeforces.com/contest/2203/submission/364378879 -this gives tle https://mirror.codeforces.com/contest/2203/submission/364379153 -this doesn't. why?

the only difference in both sol. is a extra set for all elements of b that isn't even used. weird

»
3 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

Most solve it as binary search solution, but actually there is an easier binary observation and this is the simplest approach.

Problem: 2203C - Test Generator Submission: 364327744

Since ai & m = ai, every ai can only use bits that are already set in m. So each ai is formed only from allowed bits of m.

First, look at the lowest set bit in m, which is (m & -m). This is the smallest value any ai can contribute. So if s is not divisible by this value, then it is impossible and the answer is -1. Also if m = 0, it is impossible.

To minimize n, think in binary. Iterate over bits from 0 to 60 and keep:

  • sum1: total value of bits of s up to this bit.
  • sum2: total value of bits of m up to this bit.

At any prefix, to build sum1 using numbers formed from m, we need at least ceil(sum1 / sum2) numbers.

Take the maximum of this value over all prefixes. That maximum is the minimum possible n.

So the whole idea is just binary counting, no need for binary search.

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    How do you prove that $$$\max \lceil \frac{\text{sum1}}{\text{sum2}} \rceil$$$ is not only necessary, but also sufficient?

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Pareto frontier

      • »
        »
        »
        »
        3 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        The issue I have isn't that. It's not obvious how we can construct the final array since $$$\text{sum1} \mod \text{sum2}$$$ may not be a subset of bits of $$$\text{sum2}$$$. How can you guarantee that a valid construction actually exists?

        • »
          »
          »
          »
          »
          3 months ago, hide # ^ |
           
          Vote: I like it +6 Vote: I do not like it

          The trick is that you don't just "fit" the total sum into $$$m$$$ once. You have $$$n$$$ different slots (elements in the array).Even if a bit in $$$s$$$ isn't in $$$m$$$, you can "break it down" into smaller bits that are in $$$m$$$. For example, if $$$s=8$$$ and $$$m=7$$$ (bits 4, 2, 1), you can't use an 8. But if $$$n=2$$$, you can break that 8 into two 4s (which $$$m$$$ does allow) and put one in $$$a_1$$$ and one in $$$a_2$$$.

          Sufficiency: The condition $$$n \ge S_k / M_k$$$ literally means: "At this bit level $$$k$$$, do I have enough parallel slots ($$$n$$$) to carry all the value from $$$s$$$ that hasn't been placed yet?"

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      It’s like water flowing down a series of pipes. The condition $$$\lceil S_k / M_k \rceil \le n$$$ ensures that at any level $$$k$$$, the total amount of "water" (the sum $$$s$$$) isn't more than the total "pipe capacity" ($$$n$$$ copies of $$$m$$$) available from that level downwards.

      Because binary is powers of 2, if the "total volume" fits, you can always redistribute the water into the individual pipes as you go down.

      • »
        »
        »
        »
        3 months ago, hide # ^ |
         
        Vote: I like it -6 Vote: I do not like it

        Pareto frontier is better here to explain why only certain dp transition are required. Water flow analogy is more intuitional.

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I have a solution for problem D but I'm pretty sure its not intended to pass.

I factorise the numbers and do some goofy caching to squeeze it under the time limit. I find the primes beforehand and then factorise and generate the factors for each number to tell if Alice can use the number or not.

An explanation of the intended solution would be interesting; or I'm not sure if my solution is intended to pass. I wasn't sure of the exact time complexity because of prime factorising and then constructing the factors for each number is difficult to bound.

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

E is really cool

Mostly probabilities are kind of disgusting but this one is really nice

But in comp I wrote i instead of n and forgot 1 modulo operation so no score for me :(

»
3 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

What's the reason to set $$$N = 5'000'000$$$ for pF? The TL/ML seems very tight under such constraint :/

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it +9 Vote: I do not like it

    Mostly to cut off FFT-based solutions because I think solving this problem with FFT is too boring. Unfortunately, it makes other $$$O(n \log n)$$$ solutions a bit difficult to squeeze, but the model solution is $$$O(n \log \log n + \log^3 n)$$$ and works in less than one third of the TL.

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can someone help explain C? I spent over half an hour on that but still can't figure out :<

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    ok so here is my approach for C instead of guessing n randomly i use BS we know n is between (0 to x) we pick a mid value and check is it possible to form s using mid value if Yes we try smaller n if No we need more numbers so we search higher

    if you want i can share my code with you Peace:)

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Assume that an array of length k can be generated, can you explain that an array of length k+1 can still be obtained?

      • »
        »
        »
        »
        3 months ago, hide # ^ |
         
        Vote: I like it +1 Vote: I do not like it

        If getting an valid array of length k is possible, then getting k+1 length array is also possible, as we can just add a zero to the k length array to get a k+1 length array, and this k+1 length array is still valid, as adding 0 doesn't change the answer at all.

»
3 months ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

I sincerely hate the problem C. It made me green.

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

i am getting trouble while hacking the problems , the hacking page isn't loading at all :(

»
3 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

How can I solve the Problem C?

»
3 months ago, hide # |
 
Vote: I like it -17 Vote: I do not like it

Problem F is so HARD, +1 please

»
3 months ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

Where is the Editorial??

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I AbdGraph sincerely hate the problem C. It made me green.

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can anyone please hack my submission for problem D : 364389424

»
3 months ago, hide # |
 
Vote: I like it +14 Vote: I do not like it

When will rating change reflect on account

»
3 months ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

Has the rating been updated ?

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can we do E better than n(logn)^2?

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

where do i find the solution for this contest

»
3 months ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

Apparently my yesterdays D solution would have passes with magic words : ios_base::sync_with_stdio(false), cin.tie(nullptr); Really... Before : https://mirror.codeforces.com/contest/2203/submission/364376838 After : https://mirror.codeforces.com/contest/2203/submission/364456720

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

dang, should have participated, cuz i solved ABD fast (3 problems)

»
3 months ago, hide # |
 
Vote: I like it +20 Vote: I do not like it

When would the rating update, it's been quite a while after the system test ended.

»
3 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

when will our ratings be updated?

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can someone explain me how to do D please?

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    In number theory if we traverse for each 1 to n for each of their multiples in o(nlogn) this is the major hint of this problem

    like for i from 1 to n -> for j from i to n/i ...

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    you can do the following:

    • try to find a way to compute a triple (x, y, z) where:
      • x is the number of numbers in b that can be removed only by alice
      • y is the number of numbers in b that can be removed only by bob
      • z is the number of numbers in b that can be removed by anlice and bob

    how to find this triple? how to use this triple to solve the problem?

»
3 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Any idea why no update to rating till now?

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

very nice round that i realy enjoy — nice and classics task — and one question why there is still not rating changes (i want my rating)

»
2 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hello, I would like to clarify that my submission for problem 2203D is my own original implementation of the standard editorial idea for this problem.

The solution uses a common and natural approach: counting frequencies, computing how many values from array a divide each value, and then classifying the elements of b into the same logical groups. Because this is the standard solution pattern for the problem, similar implementations from different users can naturally look alike in structure.

I did not copy my code from any leaked or public source during the contest. Any similarity is due to the standard nature of the solution, not to code copying.

I kindly ask you to review my submission again with this in mind.

Thank you.

364349636