twosquares's blog

By twosquares, 4 months ago, In English

We'd like to thank you all for participating in the contest, and hope you enjoyed it. Any feedback would be appreciated!

Rate the contest

Did Franklin (from problem D) succeed in massacring a village of innocent elves like Frieren and Dilhan (from problem E)?

2178A - Yes or Yes

Did you like the problem?

Idea: conqueror_of_tourist
Preparation + Editorial: conqueror_of_tourist

Hint 1
Hint 2
Solution
Implementation

2178B - Impost or Sus

Did you like the problem?

Idea: YuukiS
Preparation + Editorial: twosquares, YuukiS

Hint 1
Hint 2
Solution
Implementation

2178C - First or Second

Did you like the problem?

Idea: YuukiS
Preparation + Editorial: conqueror_of_tourist, YuukiS

Hint 1
Hint 2
Solution
Implementation

2178D - Xmas or Hysteria

Did you like the problem?

Idea: twosquares
Preparation + Editorial: twosquares, YuukiS

Hint 1
Hint 2
Hint 3
Hint 4
Solution
Implementation

2178E - Flatten or Concatenate

Did you like the problem?

Idea: twosquares
Preparation + Editorial: twosquares

Hint 1
Hint 2
Hint 3
Hint 4
Solution
Implementation
Bonus

2178F - Conquer or of Forest

Did you like the problem?

Idea: YuukiS
Preparation + Editorial: conqueror_of_tourist, YuukiS

Hint 0
Hint 1
Answer 1
Hint 2
Answer 2
Hint 3
Answer 3
Hint 4
Answer 4
Hint 5
Solution
Implementation

2178G - deCH OR Dations

Did you like the problem?

Idea: YuukiS
Preparation + Editorial: YuukiS

Hint 1
Hint 2
Answer 2
Hint 3
Solution
Implementation

2178H - Create or Duplicate

Did you like the problem?

Idea: YuukiS
Preparation + Editorial: conqueror_of_tourist, YuukiS

Hint 1
Answer 1
Hint 2
Solution
Implementation
Bonus

2178I - Numbers or Fireworks

Did you like the problem?

Idea: YuukiS
Preparation + Editorial: conqueror_of_tourist, YuukiS

Hint 1a
Hint 1b
Hint 2
Hint 3
Hint 4
Solution
Implementation
Tutorial of Good Bye 2025
Tags sus
  • Vote: I like it
  • +697
  • Vote: I do not like it

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

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

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

    mayank69goel got banned!!

    He was Rank 11 in India!!!

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

      if he is a cheater he should be banned, I am myself from IIT Kanpur and I have seen so many people cheat here because they want to get internships, its honestly sickening. These morons are destroying the culture of cp in general. Gosh I hope we can go back to pre AI times!

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

ok So there are indeed two 'f's in conqueror_of_fourist

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

Thanks for a super fast editorial. Enjoyed the contest. Happy New Year!

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

9 problems 1 voter :(

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

I think the single voting is attached to all the problems — after I clicked "good problem" on D my "awesome problem" on E became a "good problem"

It was a great contest! Happy New Year everyone :)

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

great problems but no way there are 10 k solves on 'c'

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

Happy new year!

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

happy new year everyone :3

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

I'm just curious, How many guys guessed the solution to E without any proof

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

Why the voters of all problems are actually the same one

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

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

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

Nice, I thought of D in this way:

Each elf is an island (node) Initially, you have n elves representing n islands(connected components with a single node with value their attack/hp) .

At every turn, an elf who hasn't attacked yet attacks another elf. Translates to: "A connected component merges with another connected component via a directed edge). This costs loss in hp for both the islands involved in the merge.

Similarly the entire simulation revolves around the approach of building

We're asked to find whether "m" connected components exist simultaneously at any round in our simulation.

The rest of logic, follows on building with these. (Hope you liked this perspective of the problem D).

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

W Editorial.

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

how to prove the m=0 case in D? btw happy new year

  • »
    »
    4 months ago, hide # ^ |
    Rev. 2  
    Vote: I like it +10 Vote: I do not like it

    If m = 0, then all elves must die. The only way we can't make all elves die is that the total amount of HP in all but the largest HP-value elf is strictly smaller than the largest HP-value elf. This is because we can always use the smaller-HP elves to attack the largest HP-value elf, therefore if after all the attacks the HP of the largest one is still larger than 0 then we can't do it.

    Otherwise, we can attack the largest-HP elve by using the smallest-HP elf. At some point the largest-HP elve at the beginning will become the smallest-HP elve in the remaining elves (when using the "smallest" one to attack the "largest" one will result in a HP value of less than 0). When we reach this point, it is always possible to take (the initial value) of the smallest-HP one and the second smallest-HP one. The smaller one will die, and at the end of the process, both the two remaining ones will have HP < 0.

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

    Each elf can hit the strongest one at most once (they die immediately afterwards), so the maximal amount of damage the strongest elf can be dealt is the sum of attack powers of all other elves, so if this is less then the strongest elf's health, the strongest elf can't die, thus it's impossible.

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

      How to choose the other elves optimally?

      For example m=0, a=[1,2,3,5] If we use elf 2,3 to attack elf 4, then elf 1 will remain. Otherwise we use elf 1,2,3 respectively, there will be no elves remain.

      My English is really bad, so hope you can understand it. Thanks!

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

        What's important is that you should kill the elves not attacking the strongest elf before anyone actually attacks the strongest elf. The simplest way is to take the smallest suffix of elves (after sorting, excluding the strongest one) that can actually kill the strongest elf, let all weaker elves die first by having them attack the next stronger elf (weakest first, so weakest attack second weakest, second weakest third weakest, etc.), and then attack the strongest elf with the suffix.

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

        Elf 1 can attack elf 2 and die and then elf 2,3 can attack elf 4.

        What I did was I founded the strongest elf X such that Elf X, X+1,...n-1 can defeat elf n. But before that Elf 1 attacks 2, 2 attacks 3,...X-1 attacks X.

      • »
        »
        »
        »
        4 months ago, hide # ^ |
        Rev. 2  
        Vote: I like it +1 Vote: I do not like it

        If the elves are a1, a2, ..., an with increasing initial health / attack power, and sum(ai.attack) 1 <= i <= n — 1 is >= an.health, then we can choose the elves like this:

        Let a1 attack an, a2 attack an, etc until we reach the ai that can kill an. This means a1 through a(i-1) are all dead now, and anything else that attacks an will both die and kill an.

        For all the elves ai through a(n-2), set them up to kill each other. At most 1 of these elves can survive the bludgeoning. If any of them survive, let it attack a(n-1). It will die, and a(n-1) will survive. Then, let a(n-1) attack an. They both die.

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

    sort the sequence, and check if sum of first n-1 terms is at least the numerically greatest term.

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

    the code given in the editorial is failing for 1"\n" 7 0"\n" 1 2 3 4 5 6 7

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

Queueforces

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

How the actual f* does a world exist where 186 people solved a problem that even Tourist couldn’t?

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

Really enjoyed F. It requires some thinking but the solution code is clean. Nice to see it wasn't just ad-hoc.

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

    I was panicking when my F sol is O(N^2) 10 minutes before contest end,
    the world felt heavy. thankfully got it in the end.
    3 minutes of testing also bonus anxiety.

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

anyone pls help me implement the m = 0 case for D.

My logic that I thought during contest was something like storing the elfs in multiset and then attacking largest and second largest and thus second largest dies and largest hurts. So, i remove(both) and insert(the health after hurting) in multiset.

Any help will be appreciated

code :

full code : 355403171

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

    I haven't looked too in-depth at your code but just glancing at it, why are you using a multiset? All the elves are guaranteed to have distinct strengths in the problem text, there's no need to use multiset here? Also if you could link the entire code (I don't know what p.sc, p.fs are) so that I and others could tell what each variable is, it would make it a lot easier to help

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

      I am using a multiset here because i'll insert the remaining health of the suriving elf in the multiset after removing both the elf (the attacker and the elf being attacked in my case they are 2nd max and maximum of the multiset).

      So, it can be possible that the suriving elf have a health equal to some existing one. For example : 1 ... 3 4 5 8 then 5 attack 8 (or 8 attack 5) : 5 dies and 8 surivied. So, i'll remove 5, 8 form my multiset and add (8-5) in the mutliset. But there was a 3 already so, a multiset is needed.

      Also I had linked the entire code too. (p.sc is the health value and p.fs is index) (sc means second and fs first)

      Lemme do it again : 355403171

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

        Yeah but each elf also has a distinct index, there’s no need for a multiset here.

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

    what if exactly one elemnt left and all others are died ? (ms.size() = 1)

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

      Oh yeah ig I forget to do that thanks!

      But wait this code even fails on test 1 :

      6 0
      998244353 1000000000 314159265 676767677 999999999 987654321
      

      It gives something like :

      5
      5 2
      6 1
      3 4
      1 4
      2 4
      

      So, i mean this should not be the case for 1 elf to remain. Every one must die.

      So, it mean there might be either bug in implementation or my approach is wrong.

      If 2nd is the case then i wanna know why. Atleast i want to hear it form someone else except me :)

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

    UPD: I got to know that this approach is not correct. I dry run this thing and yes i got it. Thanks

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

As a gamer,
recoil != counter-attack
this confused me for a bit.

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

    Yeah I definitely agree… our main goal was to choose a phrasing that doesn’t make people think that y also attacks x.

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

      Hmm, I tried find a single word/phrase that describe this situation, but no great result.

      what about changing the sentence phrasing/structure instead,
      like:
      x actively attack and y passively attack, only active attack counts.
      or
      x initiate attack and y reciprocates, only initiative counts/counted.

      Though, it's not a big deal.

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

in D, why is recoil considered an attack?

intuitively, i thought the attacks are like directed

- "Then, elf x attacks elf y"

x attacks y doesnt mean y attacks x is what i thought

its like u punched a wall and got hurt so u tell everyone the wall hit u

edit: mb gng, im dumb af

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

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

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

Missed the part in E that the chosen element has to be "maximal" :sob:

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

As a Magic The Gathering enjoyer I have to give a shoutout to poor old forgotten Mass Hysteria all the way back from Mirrodin

Mass Hysteria

Maybe I'm alone in this I don't know

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

It turns out that for each of the children in this range, we can choose each of their signs independently

bro this took me so long to identify this in problem C

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

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

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

Got cooked.... anyways happy new year._.

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

I was so close to solving D but the m = 0 case fried me lol. Great contest, good job to the problemsetters.

»
4 months ago, hide # |
 
Vote: I like it -33 Vote: I do not like it

The second problem has a hidden line in the statement that normal users cannot see on CF. It only shows up when the statement is copied (like into AI tools). That line asks LLMs to add a specific assert.

Humans would never add that assert because the input already guarantees it. So if you see solutions with that unnecessary assert — yeah, that’s CF quietly catching AI users / cheaters

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

E is very nice problem. Just simple logic.

What was i thinking during the contest :(

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

happy new year everyone :3

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

Hello everyone

I cheated on all the tasks, but I felt very ashamed. I want to admit it. Banish me, please, otherwise my conscience will torment me.

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

Thanks for the contest, congrats to the authors for a flawless round. I found E not very enjoyable and a bit hit or miss (in particular, I think guessing the correct approach is much easier than proving it works). The rest of the set is peak though. B is great, C is definitely very educative for the target audience, D is interesting enough, and H is an AMAZING problem!!

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

"Each remaining elf should attack the (larger) elf to its right before the elves before it are dead." That line in the editorial for problem D is unclear. In fact each remaining elf must attack the larger elf first, and only after the last elf required to kill the largest one has been reached, should start the "killing the largest elf with a bunch of smaller ones" part.

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

I can't see the implementation of the solution to problems in editorial

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

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

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

I'm quite confused about the m = 0 case in problem D. What I was thinking during the contest is that the last two elves should be having same health values. How does the solution in the editorial guarantees that?

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

    Even though I didn't solve the problem nor read the editorial, the last two elves (m=0 case) does not need to be same health, for example:

    h[i] = 10, h[j] = 15

    a[i] = 20 (because other elves attacked this elf before), h[j] = 15

    Then both elves would die at the same operation

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

    That's exactly what I thought. But then I realized that $$$a_i$$$ values don't change (Only $$$h_i$$$ values change). Misread the problem for most part of the contest

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

Can we even solve D if ai's are not distinct ? I misread the problem and was trying to solve this

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

Solved C using dp, though its pretty not simple as compared to editorial

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

anyone like me who didn't read that only maximal element was getting split x->x/2 ::( .

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

Any clues or hints on how to solve the Bonus problem of E? :3

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

I'd say that G is a wonderful problem!

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

I thought I've trained hard by the end of 2025,but last night I was stuck by D and haven't noticed "removing maximal" in problem E so I got -77.

It really makes me depressed but I think I will get a better score in 2026.

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

"Consider the arrays a and b before the final concatenate, so that the hidden final array is ab . Since a and b are identical, we can find where the split point in ab is using binary search on prefix sums."

I think here it's meant to be the sums of elements of a and b are equal?

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

imo, problem E could have been really hard if a guess was not possible from the max number of queries allowed and typical sum setup which demands for B.S. in interactive problems.

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

When I was working on D, I even forgot the question's meaning and kept thinking mechanically. Eventually, I got stuck for two hours before finally solving it.

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

can someone please help where my solution fails on E? for this submission https://mirror.codeforces.com/contest/2178/submission/355617425

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

    You're binary searching for the half with the bigger sum, but the half with the bigger sum doesn't have to contain the maximum of the array (e.g. 2 2 2 2 1 1 1 1 4)

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

      how will u build the array?

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

        If you're asking how I constructed the counterexample array start with 8 as the starting number you can flatten the arrays into 4 4 then 2 2 2 2 and for the second into 4 4 then 2 2 4 then 1 1 1 1 4 and concatenate them.

        If you're asking about the solution, you can check the official solution in the editorial, it's quite interesting!

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

    Here is a failing test case: [2 2 2 2 2 2 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]

    The array can be generated with

    a=[8] b=[8]
    a=[2 2 2 2] b=[8] (flatten a 3 times)
    a=[2 2 2 2] b=[2 2 4] (flatten b 2 times)
    a=[2 2 2 2 2 2 4] b=[2 2 2 2 2 2 4] (concatenate)
    a=[2 2 2 2 2 2 4] b=[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] (flatten b 9 times)
    a=[2 2 2 2 2 2 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] (concatenate)
    
»
4 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can someone please give the intuition behind coming up with the construction strategy in task d for m = 0 and m > 0 case.

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

There's an $$$O(n)$$$ time for 2178D — Xmas or Hysteria.

Idea is almost same as editorial, except that we now need a strategy $$$S$$$ that runs in linear time and does the following :

On input any sequence of elves $$$Elves[i,...,j]$$$, output a sequence of valid attacks such that at the end there's exactly one or zero elf remains.

Now suppose we have such magic $$$S$$$, then

for $$$m \ge 1$$$ case : same as editorial, except that we're gonna use std::nth_element to put the largest $$$m$$$ elves in $$$I = Elves[n-m+1,...,n]$$$ and the second largest $$$m$$$ elves in $$$II = Elves[n-2m+1,...,n-m]$$$. Also we're gonna deal with the remaining $$$n-2m$$$ elves with our magic $$$S$$$ (in the case that there's one elf remains, let it attack any elf in $$$II$$$). Finally, we do a parallel scan of $$$I$$$ and $$$II$$$ and let elves in $$$I$$$ attack elves in $$$II$$$.

for $$$m = 0$$$ case : still very similar to editorial. Suppose we pass the sum check (otherwise no solution). First swap the strongest to $$$Elves[n]$$$ and second strongest to $$$Elves[n-1]$$$, then starting at $$$i=1$$$, while $$$Elves[i].attack \lt strongest.hp$$$, let $$$i$$$ attack strongest and strongest.hp -= Elves[i].attack, then ++i. The while loop terminates when we reach an elf Alice where $$$Alice.attack \ge strongest.hp$$$ (it's guaranteed that this occurs and Alice $$$\neq$$$ strongest due to the initial sum check). Now deal with the elves between Alice (inclusive) and $$$2nd$$$ strongest (exclusive) using our magic $$$S$$$. If there's one elf remaining, let it attack the $$$2nd$$$ strongest. Finally, let $$$2nd$$$ strongest punch the strongest (this punch will kill the strongest as $$$strongest.hp \le Alice.attack \le 2ndStrongest.attack$$$).

Here's one possible way to design our magic strategy $$$S$$$. The idea is to be greedy and always let the dying elf to attack. We're going to do a linear scan over the input $$$Elves[i,...,j]$$$. Suppose we're now at $$$p$$$, lets call $$$Elves[p]$$$ Alice and $$$Elves[p+1]$$$ Bob. The invariant is that (1) Alice has never attacked before (2) Bob will always have full hp. Then some case analysis

if(Alice.hp <= Bob.attack){
    if(Alice.attack > Bob.attack){
        //both will die, it doesn't matter who attacks who
        let Alice attack Bob
        p+=2 //skip both Alice and Bob
    }else{
        //only Alice will die
        let Alice attack Bob //valid by invariant
        Bob.hp -= Alice.attack
        p++
    }
}else{
    //only Bob will die
    let Bob attack Alice //valid by invariant, full hp means not attacked before
    Alice.hp -= Bob.attack
    Elves[p+1] = Alice
    p++
}

please check invariant is maintained for all cases. It's clear that either one or zero elf remains when we finish.

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

How can one come up with ideas for ad-hoc problems like problem H? Are there other problems that use the same idea? I honestly think I would never have been able to come up with this on my own.

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

F. Conquer or of Forest

  • (k−2)!⋅s1⋅si⋅∏j∉{1,i}s2j**2

why sj**2, not just s2j?

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

    An internal component is connected to two other components, and when drawing an edge between two components you must choose what vertex is at the endpoint. So you get to choose out of $$$s_j$$$ vertices twice, which there are $$$s_j^2$$$ ways to do.

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

I really liked the problem H!

»
4 months ago, hide # |
 
Vote: I like it -15 Vote: I do not like it

TinTin_in_Quant (Chaitanya Mahawar) is an AI-cheater. In his submissions he constantly uses reserve which is an LLMs' one of most favorite functions. Moreover, for random numbers generation in G, he unsurprisingly uses splitmix64, instead of mt19937, also a huge 'why' and also a thing that LLMs like to generate.

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

    not really sure why this is getting downvoted, but you guys should check out his linkedin profile, take a look before he takes it down. the whole profile is just pieces of LLM-generated text. a monthly portion of absolute fun

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

    reserve is used for prevention of hacking no?

    almost everyone uses reserve buddy.

    splitmix64 is quite well known as well. especially in stats computing (assuming hes studying statistics from iitk, it kinda makes sense)

    idk bruv stop hating

    • »
      »
      »
      4 months ago, hide # ^ |
      Rev. 2  
      Vote: I like it -14 Vote: I do not like it

      what are you talking about? reserve is just a pre-allocation of memory for vectors, which is almost never used in CP. It's useless piece of code because in problems, the vector sizes are deterministic and fixed.

      splitmix64 is almost never used for basic random number generation in CP. Why would you need it if you have mt19937? It only helps when you're trying to cheese some unordered map/set solution.

      you're an obvious cheater trying to defend yourself from an alt. you aren't even familiar with basic concepts of CP (what a pity for GM!).

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

    alright, you guys didn't believe me but here we are. Let's review his submissions for Global Round 31. his standings with submissions

    We can first immediately notice failure on problem C. It took some time for some LGMs to solve it so let's just assume the problem is really unobvious and our subject couldn't solve this problem. (as numerous banned LLM-cheaters, see standings).

    However, we take a look at his submissions for D. 354177144 (WA2), 354181465 (AC, 6 minutes later).

    Removing all that 600 lines mess that he anyway doesn't use at the top of solve(), we can clearly see the LLM changes to his code:

    <         ll lo = 0, hi = LIM;
    <         ll a = 0, b = LIM;
    <         bool p = 0;
    ---
    >         ll rp = 0, lo = 0, hi = LIM;
    >         ll mo = 0, me = LIM;
    >         bool od = 1;
    > 
    

    Why would you change these variables' names? We continue further:

    <             ll need = 0;
    <             ll ref = p ? a : b;
    <             if (ref < LIM)
    <                 need = max(0LL, v - ref);
    <             if (j + 1 < n && need >= x[j + 1] - x[j])
    <                 break;
    ---
    >             ll pm = nd ? mo : me;
    >             ll ex = 0;
    >             if (pm < LIM) ex = max(0LL, v - pm);
    >             if (j + 1 < n && ex >= x[j + 1] - x[j]) break;
    

    Why, why, why? Why would you change these ref, pm, need? All in 6 minutes!?

    Finally:

    <             if (p)
    <                 a = min(a, v);
    <             else
    <                 b = min(b, v);
    <             p = !p;
    ---
    >             if (nd) mo = min(mo, v);
    >             else    me = min(me, v);
    >             od = nd;
    

    There's no objective reason for making such changes unless first submission was LLM-generated and the changes were suggested by LLM as well.

    Ban this nasty cheater already.