Filikec's blog

By Filikec, history, 3 months ago, In English

Hi there, I've been looking at submissions for the latest DIV3 and I've noticed something that has surprised me quite a lot.

People placing intentional bugs in their code?

I filtered submissions by status "hacked" and I've noticed that a lot of those submissions have some code inserted in them that is very obviously meant to be hacked.

For example for problem 2000E - Photoshoot for Gorillas, there's many submissions with code such as this:

if ((n ^ m) + (k ^ w) == MAX_N) {
    cout << "0\n";
    return;
}

Why do people* submit such solutions?

*subject to speculation

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

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

because theyre stupid cheaters

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

    How is that related? If it's done for cheating, do they get banned? Very easy to spot such submissions and there is so many of them. And why would cheaters do that?

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

      they go to telegram or youtube video or whatever and copy paste code without looking through it, and one of the distributors of the code decides to just troll them and put that stuff in, and since theyre stupid and cant comprehend what theyre copy pasting, they end up leaving stuff like that in the code.

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

        How fkin stupid does one have to be to do that. I would binary search the answer but i don't know what the limits is.

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

          You don't need to binary search, you could've just math'd the solution lol :)

          It was a fairly greedy solution, and this part of the code I spent over 30 minutes working on.

          repl(i, 0, n) {
              repl(j, 0, m) {
                  int row = min(i+k-1, n-1)-max(0LL, i-(k-1))+1-(k-1);
                  //if(row == k-1+k-1) --row;
                  int col = min(j+k-1, m-1)-max(0LL, j-(k-1))+1-(k-1);
                  //if(col == k-1+k-1) --col;
           
                  counts.pb(row*col);
                  //debug(counts[sz(counts)-1]);
              }
          }
          

          Just to clarify, counts represents how many times a square will be counted, and repl is just a macro for for(int i = 0; i < n; ++i)

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

            Bro,I wasn't talking about the problem...

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

            you can also count using diffrence array mehtod then prefix sum

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

        some people are actually that retarded?

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

          Yes, just like that time when if(t == 100) cout << "100\n";

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

      Possibly they don't understand the code and submit whatever their community hands over to them (probably they are a part of some cult ,lol)

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

Yeah I noticed it too. Someone cooked here- Oh my it was delicious. I think CF Admins should consider it as Unfair Means as it just can be easily spotted and should skip their solutions.

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

They probably got that code by cheating from someone who either didn't realize there was an error, or from someone who intentionally wanted these people to get hacked, and set up a hackable code that passes all tests.

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

Just cheaters who copy others' code line by line without even understanding it, and this "special case" is also created by our "hero" like in the previous contest.

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

I suspect this is done to allow cheaters to hack their own code (from alternative accounts) and gain hacking points of some sort.

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

TBH this will bend the hacking of the usual round.
Deceiving stupid cheaters is not bad, but lucky innocent participants can get free 100pts, and if someone knows this situation(including the broadcaster), they intentionally get such points. (Though there are many(around 600?) rooms, now we have crazy number of cheaters and maybe exceeding the number of rooms)
What's worse, we can't distinguish them.

A digression, but nowadays many rounds are designed as PT=ST, and some issues about hacking have already been discussed. Maybe we should reconsider the concept of hacking.