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

Автор Stefan2417, 23 месяца назад, По-русски

Привет, Codeforces!

Спустя год ожиданий и нескольких полных изменений набора задач я рад пригласить вас принять участие в Codeforces Round 948 (Div. 2), который состоится в воскресенье, 26.05.2024 17:35 (Московское время). Раунд будет рейтинговым для участников с рейтингом менее 2100. Участники из первого дивизиона приглашены принять участие в раунде вне конкурса.

Вам будет дано 5 задач и 2 часа, чтобы их решить. Все задачи раунда придуманы и подготовлены Stefan2417 и alexchist.

В раунде может встретиться 1 или более интерактивных задач. Рекомендуем прочитать этот пост.

Также я хочу поблагодарить:

  • Vladithur за отличную координацию раунда!

Разбалловка: $$$500 — 1250 — 1750 — 2000 — 2500$$$.

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

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

Div 2:

  1. sun_gan_chou_yu_guan

  2. Maksiwelle

  3. suomynonA

  4. new_mistakes

  5. Kosyaaa

Div 1+2:

  1. tourist

  2. Sugar_fan

  3. sun_gan_chou_yu_guan

  4. abc864197532

  5. BurnedChicken

Upd: Появился Разбор

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

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

Автокомментарий: текст был обновлен пользователем Stefan2417 (предыдущая версия, новая версия, сравнить).

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

Школа ЦПМ вперёд!!!

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

Это мой одногруппник

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

Не знаю что там будет, но Саша и Стёпа крутые ребята, поэтому, уверен, раунд тожа будет крутой!

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

Auto comment: topic has been updated by Stefan2417 (previous revision, new revision, compare).

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

As a tester, there are some beautiful ideas in the tasks, and I encourage everyone to participate!

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

Не знаю кто такие Саша и Стёпа, но раунд крутой, поэтому, уверен, Саша и Стёпа крутые ребята!

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

cf > ipl

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

As a tester, I can assure you that this is definitely one of the rounds ever created.

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

as a participant, will I make it to expert?

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

As a participant, I am 100% sure that the contest will happen. Hope it stays!!!

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

clashing with IPL final

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

As a tester

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

As a participant hoping to get positive delta today :)

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

Only the brave coders can participate in a contest on the night before an exam.

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

Need only +1

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

Hopefully, the problem statement will be short and precise just like the announcement!

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

wishing to get one step closer to cyan!

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

Since the last 5 contest I'm stuck at 1100's hoping to cross 1200 this time. Best of luck everyone :)

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

Это мой первый будет раунд!

»
23 месяца назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится
meme
»
23 месяца назад, скрыть # |
 
Проголосовать: нравится -6 Проголосовать: не нравится

I sooo want to appear for this round, but same time IPL finals.

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

C looks buff

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

I think it's time to repeat all Stefan tricks... https://mirror.codeforces.com/blog/entry/117352

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

I rarely get any positive delta in Div 2. Hope this time is my time. :)

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

Hoping for a positive delta

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

cf>>>ipl

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

1750 for C... interesting.

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

My confidence booster to achieve high positive delta

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

Scoring is wild on this one

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

Kontest > IPL hehe...

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

now, nikita is a boy!!!! its a girlllll

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

Ai can solve problem B like chatGPT 4. there are lots of people who use GPT4 to solve problem B. you can find many newbies who solved problem B but could not solve problem A. Xd I think the round should be unrated. and setters ensure that any problem can't be solved by any AI.

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

    I want the round to be unrated to dodge this -40 delta I'm about to get :(((

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

    It's already hard to check for AI solutions and also it's very hard to come up with div2A which will be unsolvable by LLMs.

    I think it's not feasible even now but in 6-12 months LLMs will be able to solve most existing div2A and div2B and some div2C so it will be almost completely impossible to prepare AI-resistant div2 contests.

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

      So are we near to the end of CP(atleast for those solving Div2 A,B & C)? Because most of the participants on codeforces are able to solve only Div2 ABC. If these problems are taken by AI then we will see only purple and above competing.

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

        This is not the end of CP but will create some issues. Cheating is already a problem but it will be way more widespread soon.

        You can just ignore cheaters, e.g. compete with your friends or try to solve as much problems as possible. Or maybe at some day there will be alternative rating system which will be based on difficulty of tasks but not in comparison with other participants.

        Also, look at chess, they have much worse problem with cheating, it is not only more direct PvP game (so experience suffers from cheating more), chess AI on smartphones is way stronger than humans so the problem persists even at elite level.

        Nevertheless, chess is alive and well even though there is a sometimes heated discussion about cheaters and anti-cheating measures.

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

        AI compiles all the data from its dataset and gives you an answer. You may solve Div2A or Div2B (rarely) as it does not contain new things or logic. You can find that AI can solve many standard problems of various DSA topics, which are pretty tough and challenging to understand.

        So, for AI to solve problems, the person using AI must know how to solve the problem and what prompt is required to give to the AI model for it to create the solution. AI can help reduce your labour work but cannot think on your behalf. So, instead of crying about it, learn different topics and upskill yourself. Also, Idk if it's valid for you, but if you were unable to solve a problem, then it's your fault or lack of knowledge/skill. You also have the access to GPTs, you could have also solved the problem using the similar way.

        Just because you couldn't solve doesn't means that the round should be unrated

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

      Well may be ,if the language of problems is twisted

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

    I wasn't able to perform as well as others == The round needs to be unrated

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

What a terrible problem distribution, I was performing at ~2000 rating despite having solved only 2 problems, and this was till last 30 mins of the contest.

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

Speedforces

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

cant believe beat jiangly to problem E lmfao

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

.

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

I solved D using hashing. For each column there are $$$\leq n + 1$$$ ways to get only one $$$1$$$. And these "ways" are almost identical. (We should either remove all $$$1$$$ and recolor one $$$0$$$, or remove all $$$1$$$ except one)

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

is problem C using dp?

I tried tokenize each element by counting prime factor then greedy n^2 but didn't worked.

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

    Yes it's kind of dp, the main idea is that there are 2 options:

    1. LCM of whole subset is larger than max(a) -> then answer is n
    2. LCM of whole subset is <= max(a) <= 1e9 and then there are not that many possible LCMs, I don't have a proof but intuitively if you have a lot of different prime factors, then LCM quickly grows to be large and also that if you add a new number to a subset LCM either stays the same (does not increase amount of LCMs) or multiplies (so grows very fast).

    So the solution is: check for option 1, if it's not the case just keep dp = map<LCM, max_subset_size> and add elements one by one (iterate over all previously calculated LCMs) and update dp

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

can you give me hint for B please

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

E is very similar to this problem: https://oj.uz/problem/view/IOI23_longesttrip

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

is C brute force try all subsets of factors of the largest element to see which subset will give the largest count

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

    Basically, yes. You first calculate the LCM of all the numbers. If that number is greater than $$$10^9$$$ then the LCM cannot be inside of the array, so you just take all the numbers. Otherwise, you iterate over every divisor of the LCM (works in $$$\sqrt{LCM}$$$ time), check for each number in the array if it's divisible, and then return the maximum result. Here is my submission: Submission

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

      I think if the $$$LCM(array)$$$ $$$ \gt =$$$ $$$max(array)$$$ is more appropriate than checking $$$ \gt =$$$ $$$10^9$$$

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

      can you tell me what you are doing in this line? Thanks

      if (tl != x)continue;

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

        Let $$$x$$$ be the considered divisor of the LCM, and $$$S$$$ be the set of all numbers in the input such that $$$x$$$ is divisible by that number. The variable tl represents the LCM of the set $$$S$$$.

        For a subsequence to be valid, the LCM of that subsequence is not allowed to be in the input. Now, if the LCM and $$$x$$$ are not equal, there might be a chance that the LCM already is inside the input, so we just skip it. If the set $$$S$$$ was a valid subsequence however, then it would pass this constraint when the considered divisor $$$x$$$ is different, namely the same as the LCM of $$$S$$$.

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

Optimal approach for C?

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

    Find LCM of list. If LCM > max element: answer is n.

    Otherwise iterate through all factors of LCM.

    If factor not in list. Keep track of cnt of items divisible by factor and LCM of said items.

    Answer max(cnt of items for all factors not in list and where LCM(items) = factor).

  • »
    »
    23 месяца назад, скрыть # ^ |
     
    Проголосовать: нравится +4 Проголосовать: не нравится
    • If LCM of array =/= largest value in array, answer is N
    • Iteratively calculate LCM of array. If at any point exceeds 10^9, we know the above case is automatically satisfied.

    Now, where LCM = largest value in array = L.

    The LCM of the elements for our answer can be only factors of L. So, find all factors of L.

    For each factor of L that does not appear in the original array, count how many maximum elements divide it. Ensure that LCM of these elements = this factor. If this is satisfied, find maximum across all count values.

    complexity: O(N sqrt(max(A_i)))

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

How to solve D, I was trying to solve it in O(n*m*min(n, m)), was getting TLE on pretest 19 :(

  • »
    »
    23 месяца назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится
    i had a hashing soln but i couldn't submit due to small bug.
    my idea is for each column compute all possible operation which can be made on i'th column  such that i'th column becomes special
    there will be n such operation possible ops
    pick the operation which occurs most of the times
    
  • »
    »
    23 месяца назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Even I'm wondering how to D. I had some partial ideas , first of all take a particular column j , and make all it's elements zero , by choosing appropriate rows and inverting them. Then we can choose an i such that we will again apply inversion at the row i making this column good with 1 at row i. Now all the other columns , which had a 1 at i_th row and one more 1 at some other row will become good , but the main challenge seems to me is how to find them efficiently?

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

      let mask = j'th column which wan to make specail
      if you want i'th position to be 1 and all other positions 0, operation required is
      ops = mask ^ (1 << i)
      now you can use hashing to store all these ops and pick the most frequent ops

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

    I saw your code and you have the right idea for small $$$m$$$.

    For small $$$n$$$ you can just iterate over all the $$$n$$$-sized bitsets that make each column have exactly one 1, group them in a map, and return the bitset that maxes the result.

    Code: 262803308

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

      Wow great!! Got it, that’s an amazing solution. I think if we use hashing along with your method, that would pass for any n and m. Thanks!

      Upd: I tried Hashing 262808152, getting wrong answer on test 4. Cannot really figure out why, I tried to debug it and there is a collision, 2 different bitsets are giving the same hash. I’ll try to figure out why. Also I tried submitting with multiple different values of mod and p but still the same result :(

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

        I was having the same issue, and I fixed it by having two keys with two different primes (I am using polynomial hashing).

        It is definitely not an elegant solution, and I see the other guys doing something with rand that probably provides a better solution (but I honestly do not understand it).

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

          Damn, I never expected it was actually due to collision, because I tried so many values different values of mod. I thought there was some flaw with the algorithm to hash 2 vectors the same. I'll try double hashing then. Thanks!

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

            You can overcome this by again calculating the max value using the hash you found (changing the columns accordingly) . This gives correct answer (I implemented this) but cannot say why this works.

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

how to approach B?

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

i need 5 more minutes for D i am too noob at implementation. i had a small bug in code :(
upd : it's a correct AC soln

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

Even though I was only was able to solve 2 questions, I must say the questions were really interesting

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

CHATGPT

ChatGPT give me correct solution to B

LOL

I think most of participants use ChatGPT to get the solution

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

I love this round!

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

B is not easy T_T

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

B is not easy :(((

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

how to avoid tle in c?

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

I thought the problems this contest were nice (and normal). For some reason the standings seem very unbalanced though, so probably my judgement is incorrect.

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

B was tough ,but as many participants said code of Chat GPT passes ,means many submitted it maybe you should check the question before, i lost my cool when i saw 9000+ submission, man i am bad at this but not that bad. Anyway if someone is interested in Non Chat GPTed solution then here it is 262781288

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

during this round i suddenly realised that i have dyslexia

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

Partial Editorial:

A — If n>=m and n and m share parity( both even or both odd) then yes, else no.

B: Repeatedly do the following until n = 0. If n is even. Output 0 and divide n by 2. If n is one more than a multiple of 4, Output 1 and divide n by 2. If n is one less than a multiple of 4, Output -1 and add one before dividing by 2.

C: If LCM(array)> max(array) answer is n.

Else, iterate through max(arr)'s factors,

For each factor track amt of items in list divisible by factor and LCM(those items).

Answer = max(amt of items if factor not in array and LCM(amt) = factor).

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

Hi Stefan2417, in the problem C I have made a small error in factorisation (instead of checking till $$$\sqrt{n}$$$, I only checked till $$$\lfloor\sqrt{n}\rfloor$$$), this caused my solution to be wrong for some cases, one of them is: n=4, a=[1,2,3,36]

If possible kindly rejudge my solution 262765545, I hope I will be cautious next time to not make these mistakes, at the same time I feel it would be unfair if I got a good rank due to this small error.

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

    Why do you care about rating? =)

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

    WA is WA.

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

    Ahh... bad luck. I used to have this feeling 10 years ago (feeling that such a small error should be allowed to rejudge, or why do I have to suffer for such a negligible mistake where my logic/thought process is correct), so I totally understand your frustration. Thanks for making me nostalgic.

    Lesson: Error is error. 100% your fault. Own it, embrace it, learn from it, overcome it, grow from it.

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

    Ok, so what I think is that people probably misunderstood you: You were saying that your solution was incorrect because of a small typo, but it got marked as correct during the contest, because of which you got a good rank which you feel like you didn't deserve, correct (instead, they assumed that you were saying that your solution got WA because of a small bug, and so you should get AC just because it's so small)? Well, I'm saying that you do deserve it: Just look above / below you, there are so many people with solutions that aren't actually correct for D, but they work on all the testcases. In the end, in competitive programming, what matters is passing all the tests, not whether your solution is actually correct (although for most problems with strong tests, those two are equivalent...). So, if you deserve your rating, you will keep it in the next contest, and if you don't, well you're gonna drop down next contest anyway, so it's fine :)

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

Damn, I couldn't even solve B when ChatGPT could :(

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

MY submission 262742856 was accepted during the round but during testin g phase it got runt ime error on TC 1?I changed my language to c++ 20 and it got accepted.My question is why was it showing accpeted during the contest then? please look into this Stefan2417

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

scoring worse than last div2

how is that even possible...

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

I have seen many solutions that seems to me ai generated, Is there a way to report such solutions?

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

solving two gray problem fast was sufficient to become an expert in this round

interesting

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

In problem D, is it true that atleast one of the first 39 columns should be special for the max case?

If not, hack : 262784406

UPD : Hacked :)

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

short solution for D till editorial is not out
for each column consider all possible ops that can be performed to make i'th column special there will be n such ops possible for each column pick the operation which occurs most of the times ops can be store in the form of hashes

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

Weak tests on Problem C, my solution is wrong shouldn't pass but it did.
Instead of checking if the whole LCM of the array is greater than the max. I just keep using modulo to avoid overflow, I used map to generate all possible LCMs hoping it wont TLE and I didn't.
It's easy to hack my solution just generate an array which it's LCM Mod 1e9+7 already exists in the array.

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

Please donate me +4 i want to be 1700 (crying emojis)

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

In one sentence: the correct solution B is hidden in the tests.

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

I had partial ideas for D, basically first make an ith column's each row , by appropriately choosing rows. Then to make this column good , we will apply an operation at some kth row, and all other columns having 1 at k_th row plus one more extra 1 at some other row , will be good. But I don't know how to count these efficiently.

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

For problem B, my solution didn't pass the pretest. However, I think my output was correct if I'm not mistaken. I might be hella dumb but here is my answer for pretest 1 case 7:

input:
19
output:
6
-1 0 -1 -1 0 1

32 — 8 — 4 — 1 = 19
I don't know please help I'm a noobie.

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

Can anyone explain to me why my submission 262785189 is accepted. I have read others and tried it out. It was correct. I do not understand why this is.

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

The Test Cases are weak in D!

I designed a code to solve the problem which should solve the problem with O(m * m * n) time complexity! But the code passed with O(45 * m * n) time complexity, though it shouldn't pass!

Here is my solution: 262786847 Time: 249ms, Memory: 6976 KB

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

Can anyone tell me how I can improve? Seeing my recent performance in the past 2 contests, I seem to have hit a roadblock.

My C++ concepts are limited, and don't know much about DSA either. Should I stop participating in the contests for now and focus on learning or just continue practising from the problem set?

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

can anyone give hints for problem E? or similar problem that might be helpful for solving E

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

Guys please help. I AC'ed on B during the contest, but I got a TLE during system check. But when i submitted the exact same code but without fast io, it AC'ed.

Can anyone explain why it happened?

With fast io 262763870 Without fast io 262791262

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

editorial please. How to solve D?

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

    Use hashing. For each column, only $$$n$$$ possible sets of rows can make it special, and all of them can be calculated quickly since they are very similar (any two sets only differ in 2 rows). Then just find the max frequency hash.

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

My solution to C by factorization and brute-force: 262772972

First, factorize each input numbers to product of some a_i ^ p_i, and maximize each p_i to get the LCM.

If LCM is greater than the largest input, the answer is trivial (n), otherwise:

Let's brute-force each p_i, i.e. brutu-force each (including non-prime) factor of LCM:

  • This factor should not occur in the inputs.
  • Choose all inputs that are divisible by this factor.
  • Verify that the LCM of the chosen inputs are this factor.
  • If all the above is satified, then we consider this as a proper answer. Maximize the count of chosen inputs during the brute-force.

Integers below 10^9 with the most count of factors is 735134400, which has 1344 factors. Time cost: 1344 * n * (count of prime factors) + cost of factorization

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

    nice solution, some of my friends had a solution which got accepted in the contest, but later when I tried, failed on test case 18

    Your solution is absolutely correct

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

      I just noticed that we only need to enumerate the factors of the largest number, all the remaining things can be easily solved by plain gcd() and lcm(). Factorization can be totally skipped.

      Anyway, the core logic is the same: enumerating factors and brute-force.

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

I reached Pupil but suddenly I'm seeing that the rating decreased by 9 and I'm stuck in 1199 ....Why did it happen

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

262792905 Why is this submission giving WA?

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

Welp there goes my elo

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

Thanks for contest! C and D were not that great but B was nice and E is amazing!

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

how do hacks work in div 2 contests?

a few people got hacked, but those hacks were added only after the contest ended and not while sy

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

This submission is giving wrong answer for this test case:

1

10

2 3 4 4 4 4 6 12 100003 1200036

But it still got Accepted.

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

editorial when

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

when do we get the editorial for this contest ?

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

thanks

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

Why no editorial yet ?

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

يا زنديق انت واياه راوند 949 وقت الصلاة بلا شغل زندقة

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

In 1977C - Nikita and LCM few solutions have been accepted but on the testcase

n=8

arr=2,2,2,3,35,35,35,210

they are giving wrong answer maximum length subsequence is 6, they are giving 4, please add this testcase in main tests.262768289, 262777464

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

Upsolved E. Beautiful problem indeed, had fun solving it.

Enjoyed all problems from B-E.

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

For question 5, Can someone please tell what will be the output of this graph:

Test Cases : 1.

Number of nodes : 5.

Edges: 4 which are 3 -> 1, 3 -> 2, 4 -> 3, 5 -> 3.

I tried dividing them in black and white groups but just can't, thank you for your help.

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

good contests

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

A great experience

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

So where is the tutorial?

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

When will the editorial be out ?

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

Very cool problem D!

I initially thought the solution will be something complex, but then I found the trick :)

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

C is harder than usual, anyways nice contest.

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

Problem B could be solved by GPT, and many of the user took the same approach as of me, but why is only my solution skipped. The solution to the problem is obvious and there is no other way of solving the problem that i could think of. Please do reconsider my solution , i think it should be rechecked kindly look @MikeMyrzayanov

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

The test cases of problem C are weak and many solutions are hackable.

1
8
2 2 2 3 35 35 35 210

Many solutions give answer for above test case as 4 while it should actually be 6.

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

    Oh god, you are right. I uphacked nearly 20% of the Python 3/PyPy 3 AC submissions made during contest with it. The problem is, rather than the fact that the test is weak itself, that most of those 'hackable' solutions were submitted in a long sequence in a short amount of time and their code looked almost the same; i.e. possibly a massive amount of cheats.

    (not saying all of them are cheats, but probably worth investigating in them)

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

Can anyone give a detailed analysis of the hashing error rate of D ? I tried three types of hashing: (1) 64-bit xor hashing (2) 32-bit xor hashing (3) 64-bit sum hashing with automatic unsigned long long overflow. Only the (1) got accepted. Why?

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

I solved 1977B - Binary Colouring problem of Div 2 category. I think my solution fulfils all the requirements of the problem, although it's been labelled as Wrong answer on test 1. The question says that in case of multiple solutions I can print any one of them. So can someone please help me on how to request for review of my submission. Submission Id: 263005014 Stefan2417.