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

Автор cry, 7 дней назад, По-английски
Rating Predictions

2060A - Fibonacciness

Problem Credits: Proof_by_QED
Analysis: larush

Solution 1
Solution 2
Rate The Problem!

2060B - Farmer John's Card Game

Problem Credits: Lilypad
Analysis: larush

Solution
Rate The Problem!

2060C - Game of Mathletes

Problem Credits: LMeyling
Analysis: macaquedev

Solution
Rate The Problem!

2060D - Subtract Min Sort

Problem Credits: Proof_by_QED
Analysis: Proof_by_QED

Solution
Rate The Problem!

2060E - Graph Composition

Problem Credits: LMeyling
Analysis: DivinePunishment

Solution
Rate The Problem!

2060F - Multiplicative Arrays

Problem Credits: Proof_by_QED, cry
Analysis: -firefly-

Hint 1
Hint 2
Hint 3
Solution 1
Solution 2
Rate The Problem!

2060G - Bugged Sort

Problem Credits: chromate00
Analysis: macaquedev

Hint 1
Hint 2
Hint 3
Hint 4
Solution
Rate The Problem!
Разбор задач Codeforces Round 998 (Div. 3)
  • Проголосовать: нравится
  • +63
  • Проголосовать: не нравится

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

C took me incredibly long. I was completely overcomplicating it thinking that we needed to subtract from the answer when there was an odd number of non-pair numbers.

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

    hahaha, I did the same. I didn't realize the fact that non pair numbers can never be odd up until the contest ended, so silly.

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

    hahahaha me too bro

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

    same

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

    Same, I didn't read that n is even only :(

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

    me too brother ...me too

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

It was a nice contest! I got stuck on problem E, but I'll learn from it.

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

    today was the 1st time ever i reached problem E :), all the best to u!

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

I solved 4 but took a shit long of time.Damn That A ,A problem statement can be better

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

    At first reading your comment, I thought you actually had to take a dump during the contest. I almost felt sorry for you.

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

Why is F so damn hard???

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

Is it me or the B problem was kind of hard to implement ? It took me a while to solve it. Even the total number of users who solved the problem is less than the problem C.

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

As an AKer in 2h29min, I think this is closer to DIV2 ;)

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

Problem G is very good.

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

I lost like 1000-2000 rank because of B and D :( and also got too confident on my two different solutions to E and submitted them both. But nevertheless, This was the most problems I ever solved in any contest yet and I am quite happy.

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

Imo, C was easier than B.

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

Can anyone explain D?

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

contest was really cool...solved A,C but couldn't solve B:(

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

I solved A, C and D but can't solve B. I don't know what is the logical mistake in my solution.

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

    my approach which might help:

    store in the form of int[n][m] sort all vectors find order by taking first el of all check if order is valid, else -1

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

    I created a vector of size n * m, and for each card assigned the number of the person holding it. The problem stated that you have cards starting from 0 to n * m — 1 and each card has to be greater than the last one. So with this array, you already have the sequence:

    Cow 1 has cards: 1 4 7

    Cow 2 has cards: 5 2 8

    Cow 3 has cards: 0 3 6

    The vector will be {3, 1, 2, 3, 1, 2, 3, 1, 2}. We have 3 cows, so we only get the sequence from up to index |qty. of cows-1| and check if it is equal the rest of the sequence.

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

    check for edge case n=1

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

    consider total m rounds.

    In each round that is total N cows will place a card. so,First create a map of all the numbers (0->n*m-1)-> for each number assign the cow. which cow is holding this particular card. Now iterate from z=0.(this is current card number) total we have to place m rounds .and in each round total n cows has to participate. say in round 1 -> z=0->search which cow has this z=0 number.insert that into a vector. increment z; z=1->search which cow has this z=1 .insert that cow number into a vector. after "n" cows played a permutation will be generated. you have to make sure that this is the only permutation will come at the end of the M rounds.

    insert this vector into a set after each round.

    at the end check whether the size is 1 or not you can refer

    https://codeforces.me/contest/2060/submission/301815602

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

Did anyone use Faulhaber formula to solve F?

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

    Test Case :

    1

    4

    1 3 5 2

    Expected Ans : NO

    Your Code Output : YES

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

    I did the same at first , you can see my solution and find that we almost coded the same thing , except we both ignored the fact to change a[i-1] , we only focused on changing a[i] , you might ask how does that affect out solution.... Well , for the given test case : n = 8 a = [4 5 4 5 4 5 4 5] try printing your answer , it gives: [4 1 4 1 4 1 4 5] which is non decreasing , but still the answer is YES and that's a fluke.... so what is our next approach? Well luckily for us we dont need to change a lot in this code , just make sure to understand the fact that , we won't change the values only when a[i] > a[i + 1] , we might need to do it otherwise as well , its kinda hard to explain the intution , until i come up with a proper proof but a rough proof might look like : let's take the above array that i used as an example , there your code didn't use the operation on 2nd index(0 based) and hence in the answer array we get a 4 , instead if we had applied the operation then the answer array would've looked like [0 0 0 0 0 0 0 4] so just apply this operation on all the indices , and check in the end if it is sorted or no , lmk if you have any doubt , here's my submission : here

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

      Yeah I got it now thanks for such detailed reply, I don't understand how can I not notice such a simple thing..

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

good contest , bad contest

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

My brute force is failed for C. Its was basic level question

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

The testcases for E couldve been better. I just thought we have to make both the graphs same but i guess thats what makes me a newbie

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

thank for contest

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

man i dont know why my c is wrong .


#include <bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; while(t--){ int score = 0; int n,k; cin >> n >> k; vector<int> v(n); for(int i = 0; i < n; i++){ cin >> v[i]; } sort(v.begin(),v.end()); for(int i = 0; i < n/2; i++){ if(*min_element(v.begin(),v.end()) + *upper_bound(v.begin(),v.end(),k -1 -*min_element(v.begin(),v.end())) == k){ score++; v.erase(upper_bound(v.begin(),v.end(),k -1 - *min_element(v.begin(),v.end()))); v.erase(min_element(v.begin(),v.end())); }else{ v.erase(min_element(v.begin(),v.end())); v.erase(min_element(v.begin(),v.end())); } } cout << score << endl; } }
  • »
    »
    5 часов назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Maybe, you are erasing from the vector ,this will change the vector,so in future issues mayrise with the upperbound and lowerbound later.these upper bound and lowerbound may change and they may not the ones which you think they'll be..Try out a test case and try printing all the upperbound's and lowerbound's and see..

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

    It fails on this testcase: 1 2 4 2 3

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

why 301896773 gives TLE when submitted in C++20 but accepted when submitted in C++17

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

I'm quite new to graph theory problems, so please pardon any ignorance. However, for the life of me, I cannot understand why in problem E you cannot just count the number of pairs of (u, v) that are in G and not F, and the pairs in F but not G?

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

Can someone explain how for E on the second test of test 2 the # of operations needed is only 2? I'm getting 33.

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

F was awesome

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

Nice contest. D was pretty easy, though.

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

    didn't you get it hacked ??

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

      Nope, not yet at least. Might get hacked since I didn't really think much on it aside for my initial doubts about my approach being too simple to work.

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

Jeez!! I got stuck on problem E. Now reading the tutorial I noticed that I had the idea but still have lots of problems on the implementation looool. Btw, interesting contest, good problems. Wanna upsolve rn!!!!

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

301778309 Can someone point out the error in this for B?

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

Any good resources to learn combinatorics?

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

Self review no one asked for:

so mad that i sold around 50 penalty points because of the misread on a...

i lost a little time on b because of interesting construction

rushed on c, my mind was too disorganized

c-d turnaround was lowkey clean, i hit an instant mindsolve

e i sent two wa because i thought we needed to simply match the edge list, rather than the path. test case 1 seemed to support this. i sent another wa submission because i thought it was overflow

f and g were beyond me

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

    Quite same. Got stuck on A and thought I was screwed. Than tried D and bam! solved it in first go. C was also a smooth sailing, but got stuck at B again. I really don't know what to feel as A and B gave me more trouble than my whole college exams combined.

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

    My man, at least you realize it in time.

    When I was realized I read the problem E wrong, the contest is already over.

    It only took me ~ 30 min of implementation so if I could realize I read the problem wrong, I can comeback easily (theoretically)...

    Ready going back to pupils and wait for Div 4.

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

    can I know the extension that you are using to predict the rating changes

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

Why was d at d?

  • »
    »
    4 часа назад, # ^ |
      Проголосовать: нравится +13 Проголосовать: не нравится

    Because we hoped that some people will prove the result instead of resorting to guessing that the obvious strategy works, and the proof is actually not so simple.

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

      Hey can you tell me whethe my proof was correct?

      I started from the first index of array and started taking the mid of first two elements. Than I subtracted it from both. Than we will reduce one element to 0 and the next to whatever was left after subtracting. By the way this was done only when first element was smaller than second as otherwise if this operation is performed there is no way that array can be non decreasing as zero is the minimum element obtainaible and everytime we pair an element with 0 the min of them both will be zero. So if we get something like 1 0 than it's likely impossible but if we have smooth sailing till last index than you are good to go.

      Does it seem satisfactory or you have a better proof? I'd love to hear your take.

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

        This doesn't tell me why it is optimal to decrease on the first element first. Perhaps it is better to do them in a different order. My proof is in editorial

»
4 часа назад, # |
Rev. 7   Проголосовать: нравится 0 Проголосовать: не нравится

There is an easier solution for G without dp and more straightforward to prove(?). Imagine $$$a$$$ and $$$b$$$ stacked on top of each other, draw an arrow pointing downwards from $$$a_i$$$ to $$$b_i$$$ if $$$a_i > b_i$$$ otherwise draw an upwards arrow from $$$b_i$$$ to $$$a_i$$$. Now doing an operation on $$$(i,j)$$$ is equivalent to swapping the pairs $$$(a_i,b_i),(a_j,b_j)$$$ then flipping their arrows.

Following from the editorial, the order of the pairs in the final sorted configuration is fixed and we can freely reorder the pairs. The question left is whether we can orient the arrows correctly?

Assume we already fixed the final direction of each arrow in the final state, the number of up arrows in the final and initial state has to have the same parity (parity of up arrows is invariant under swapping). So we now ask what possible parities of up arrows can the final state have?

First sort the pairs by $$$\min(a_i,b_i)$$$. For each $$$i$$$, if $$$\max(a_i,b_i) > min(a_{i+1},b_{i+1})$$$ then their arrows must share the same direction, otherwise they can be different or the same. Now we split the pairs into consecutive segments where each all arrows in the same segment must have the same direction. The parity of number of up arrows can be $$$0$$$ or $$$1$$$ iff there exist a segment of odd length because changing the direction of all arrows in an even segment does not change the parity of up arrows. The answer to yes or no reduces to these two conditions:

1) No $$$\max(a_i,b_i) > \min(a_{i+1},b_{i+1})$$$ exist

2)There exist an odd segment or the parity of up arrows in the initial state is even

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

    My solution is similar to yours, but I think you're missing one case.

    Even if all the fixed segments are even length, if there exists two consecutive i's where max(ai,bi)>min(ai+1,bi+1) is false, then you can flip the first of those two i's without changing anything else. This means you can always make the total number of flips even.

    (Also you still have to check that after ordering the pairs, one of the flips (or arrow directions) is valid — such as in the first example test case where the middle pair can never be valid.)

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

      Yes that condition should be condition 1), I miswrote $$$\min(a_{i+1},b_{i+1})$$$ as $$$\max(a_{i+1},b_{i+1})$$$

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

In the tutorial of B, it says in general,

the i-th cow (where i∈[0,n−1]) must be able to place i,n+i,2n+i,….

but what if the input is

1

3 3

3 4 5

0 1 2

6 7 8

here there is still a possible permutation but not according to the tutorial ??

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

    No player can play consecutive turns, so suppose player 2 plays 0, player 1 plays 3, and player 3 plays 6, then player 2 can't play any of his cards since they are smaller than 6. (If you think that player 2 can play all his cards, then player 1, then player 3, then you might have misread the question) A player will only get his turn after all other players have played, everyone maintains the same turn order throughout the game

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

    "Farmer John wants the game to be fair, so each cow should only be able to play 1 card per round."

    Maybe you read too fast or forgot about this part.

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

In problem F solution 1, how are we calculating \begin{align*} \binom{n+1}{j+1} \end{align*}

since n is very large?

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

my downfall was A. I don't know why I was overthinking it so much when it was so obvious. Took me nearly one hour to solve. I really have a lot to learn...

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

Amazing contest! I was able to solve A, B, C on whiteboard. Hope to see more contests like this!

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

Is it just me or anyone else feels like there are a bunch of people using AI to solve the problems, given LLM's are basically on Master's level. Some low rank people just straight up solve E. I tried plugging the question into ChatGPT and it instantly gave me a working answer. What is the future of these types of contests?

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

For D I used a completely different approach, where the logic (at least if you have to prove it!) is simpler: starting from the end, find the allowed interval for the previous element. Then check that the first element fits in the required interval.

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

Although B is quiet easy there is better way to implement it(or should I say more efficient)(although the logic remains the same) , we could just find the modulo the elements of each row with n if they are all the same , then it is possible else it isn't . Finding the permutation is also easy , we can just create an array and append the remainders (if they are all equal for a row). Now the permutation would be the remainder+1 . The time complexity would be $$$O(n*m)$$$ here (This is what I did during the contest).[I know that this is fairly simple problem , but I thought this would be nice to point out nonetheless]

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

Damn... I've used DSU implementation from Algorithmica. And it was wrong all from the start. Spent 30 minutes to find a bug in my solution, and the only bug was my trust in this site.

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

Can anyone explain why my solution of B 301795916 is giving wa.

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

I solved G without using dynamic programming and I think it's a bit more intuitive (at least for me).

Using the same insights as mentioned in the hints, my solution builds out a possible answer and checks if it has enough degrees of freedom to end up with an even number of flips, or necessarily has an even number of flips.

Say you've placed the first n pairs (as the editorial mentions, this order is fixed by $$$min(a_i, b_i)$$$), then you take the next smallest pair and decide how it should be flipped. There are 4 cases:

  • it needs to be flipped (meaning the element from $$$a$$$ should end up in $$$b$$$)
    • for example, the previous is $$${1, 3}$$$ and the next to place is $$${4, 2}$$$, the 2 cannot come after the 3, so it has to be flipped first
  • it needs to stay unflipped
    • for example, the previous is $$${1, 3}$$$ and the next to place is $$${2, 4}$$$
  • it can be either orientation
    • for example, the previous is $$${2, 3}$$$ and the next to place is $$${4, 5}$$$
  • or can't be either
    • In this last case, you can early return a "NO". This would be like in the first example case where you place $$${1, 6}$$$ first and then have to place $$${2, 4}$$$, but no matter how you flip $$${2, 4}$$$ the number after the array with 6 will no longer be increasing.

You don't need to track the whole array, just the chosen state of the previous pair, which you can initialize as $$${-1, -1}$$$ (since the first actual pair can have either orientation).

If at any point you have two in a row which can be either orientation, then you can flip or not flip that fist one to make the total number of swaps even, regardless of how the total turns out. From this point on, you will return "YES" as long as you don't find a situation where a pair can't be either orientation.

You will also want to track the number of fixed orientations there are in a row. If you end up with a block of fixed orientations which is of an even count, then you can flip the pair just before this block (which is necessarily one that can be either orientation, otherwise it would be part of this block) which would flip the orientation of all the pairs in this block as well, which will have flipped the orientation of an odd number of pairs, meaning the number of total flips will have gone from even to odd or vice versa. This freedom will mean no matter what the parity of the other fixed blocks are, you can make the total number of flips even or odd.

After going through all pairs, if you found either degree of freedom (either two free pairs in a row, or a block of fixed pairs of even count) or the number of flips applied for the array you built is already even, then it's possible.

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

Why is dp[3][1] = 1 in solution of question G? Shouldn't the dp[4][1] be equal to 1 since we flip the first pair and the total flips is equal to 1?

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

    Editorial author here. Sorry, just a really annoying typo, because I got confused between zero and one-based indexing! It's definitely meant to be dp[4][1].

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

in c we can count number of pairs using 2 pointers, i did so so maybe update tags

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

In problem F, why are we only doing (n,j), there can be sequence of repeated factors as well which will reduce the multiple.

i.e. example consider a sequence [2,3,3,4,4,4] and then (n-6) 1's for any n. The multiple should be n!/((n-6)! * 2! * 3!)

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

why am i getting TLE in C? I need help pls

#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
 
using namespace std;
int N = 200002;
 
void solve();
 
int main()
{
    IOS

    int t;
    cin >> t;
 
    while(t--)
    {
        solve();
    }

    return 0;
}
 
void solve()
{
    int n, k;
    cin >> n >> k;
 
    vector<int> numbers(n);
    vector<int> counter(N, 0);
 
    for(auto& num: numbers)
    {
        int temp;
        cin >> temp;
        counter[temp] += 1;
        
        num = temp;
    }
 
    int result = 0;
 
    for(int i = 0; i < n; i++)
    {
        if(counter[numbers[i]] > 0 && counter[abs(numbers[i] - k)] > 0 && numbers[i] == abs(numbers[i] - k))
        {
            result += counter[numbers[i]] / 2;
            counter[numbers[i]] = 0;
            counter[abs(numbers[i] - k)] = 0;
        }
        else if(counter[numbers[i]] > 0 && counter[abs(numbers[i] - k)] > 0)
        {
            
            result += min(counter[numbers[i]], counter[abs(numbers[i] - k)]);
            counter[numbers[i]] = 0;
            counter[abs(numbers[i] - k)] = 0;
        }
    }
    
    cout << result << endl;
}
  • »
    »
    86 минут назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    You're declaring an vector of length 200002 for each test case, which is slow and can cause a TLE with many test cases.

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

You can solve problem B in O(nm) time complexity. You don't have to sort cards array, you have to only check is difference between consecutive terms in array is factor of n or not.

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

This is a very nice round, thank you for the authors!

The problem statements are clear and interesting, the difficulty levels are appropriate for Div 3, and even the hard problems have something instructive to learn when I can't solve it.

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

Can someone tell me why my code for E does not work?

»
100 минут назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

B took me forever and couldn't even solve it :(

»
56 минут назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Coming up with a solution was easier than understanding the question.