THE_THUNDERSTORM_BEGINS's blog

By THE_THUNDERSTORM_BEGINS, history, 20 months ago, In English

hello codeforces

yesterday i noticed that someone from my friends solved problem D in 8 minutes.

well this friend is known in our telegram training group to be a cheater.

i refused that fact cuz there is no direct proof.

while i was looking at his code i noticed that some code was copied and pasted 3 times in different functions doing nothing.

i knew that was not normal , so i needed a proof now.

so i decided to look at problem D solves and was suprised that so many solutions are alike in a way, but different only in variable names, and some of them were in a straight one line of code , but the same idea over and over.

you can check some examples

308151686 308117651 308160744 308153550 308165846 308152360 308142455 308171609 308166500 308167550 308158553 308146140 308144552 308158580 308144531 308170236 308171447 308138274 and best for last 308165802

you can notice the large similarity between them,,

most of them were submitted at the near end of the contest,

these acts are not acceptable in this community, so many coders leave CP because others are cheating and he is getting negative delta over and over while not cheating.

i would like to notice MikeMirzayanov to these acts.

update:

the same person cheated today

i invastigated more and found a code on a telegram group

further more

here is his submission 308347774

here is the code on the telegram group


D1?#include <bits/stdc++.h> using namespace std; int f(long long m, long long n, int B, const vector<int>& p) { if (m <= n) return p[(int)m]; return (m & 1LL) ? B : B ^ f(m / 2, n, B, p); } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) { long long l, r; int n; cin >> n >> l >> r; vector<int> a(n + 1); for (int i = 1; i <= n; i++) { cin >> a[i]; } if (l <= n) { cout << a[(int)l] << "\n"; continue; } vector<int> p(n + 1); p[0] = 0; for (int i = 1; i <= n; i++) { p[i] = p[i - 1] ^ a[i]; } int fn = p[n]; int B = (n & 1) ? fn : fn ^ p[n / 2]; long long m = l / 2; cout << f(m, n, B, p) << "\n"; } return 0; }

you don't need to be smart to know whats happening , these codes are being distributed through youtube and telegram channels, too bad we can't stop them , but at least cheaters don't deserve to get to expert by cheating and get away with it.

note: i will share the same codes that were shared for B C

i don't care about A if you cheat A just get a life man.

| Write comment?
»
20 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

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

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

I feel some of the solutioms havent used mod correctly

Like they have done (a * b) mod instead of (a mod * b mod) mod

If this can give some overflow, lets try hacking them ?

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

    its unhackable btw since both a and b will always be below mod

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

      i tried to find a hack but didnt even understand their approach , they are starting from leaves rather than the root .

      also they somehow understand dp alot to get some relation like this .

      also through the problem i did not notice that

      p(i)<i

      in the input

      what a coincidence that they all noticed that

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

        I'm not sure how can you not start from leaves, look 308132441 my solution, it is more direct. But looking at how gods of DP solve it, it really is obvious that for every depth you add children of others of same depth and subtract own, so can reduce it to one multiplication.

»
20 months ago, hide # |
← Rev. 7  
Vote: I like it 0 Vote: I do not like it

Also these:

awoo

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

exstream is my new favourite word

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

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

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

cheaters code for C


C?#include <bits/stdc++.h> using namespace std; void dfs(int node, int parent, vector<vector<int>>& tree, vector<int>& dist) { for (int neighbor : tree[node]) { if (neighbor != parent) { dist[neighbor] = dist[node] + 1; dfs(neighbor, node, tree, dist); } } } void solve() { int n, st, en; cin >> n >> st >> en; vector<vector<int>> tree(n + 1); for (int i = 0; i < n - 1; i++) { int u, v; cin >> u >> v; tree[u].push_back(v); tree[v].push_back(u); } vector<int> dist(n + 1, -1); dist[en] = 0; dfs(en, -1, tree, dist); vector<int> perm(n); iota(perm.begin(), perm.end(), 1); sort(perm.begin(), perm.end(), [&](int a, int b) { return dist[a] > dist[b]; }); if (dist[st] == -1) { cout << "-1\n"; } else { for (int p : perm) cout << p << " "; cout << "\n"; } } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) solve(); return 0; }
»
20 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

heaters code for B


B?#include <iostream> #include <vector> #include <set> #include <cmath> using namespace std; bool isPerfectSquare(long long x) { long long s = sqrt(x); return s * s == x; } void solve() { int t; cin >> t; while (t--) { int n; cin >> n; long long totalSum = (1LL * n * (n + 1)) / 2; if (isPerfectSquare(totalSum)) { cout << "-1\n"; continue; } set<int, greater<int>> available; for (int i = 1; i <= n; i++) { available.insert(i); } vector<int> p; long long prefixSum = 0; while (!available.empty()) { for (auto it = available.begin(); it != available.end(); ++it) { if (!isPerfectSquare(prefixSum + *it)) { prefixSum += *it; p.push_back(*it); available.erase(it); break; } } } for (int num : p) { cout << num << " "; } cout << "\n"; } } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); solve(); return 0; }
»
20 months ago, hide # |
 
Vote: I like it +13 Vote: I do not like it

I agree, actually, when I try to hack other's D2 solutions , I find many similar codes, because they use actually the same template and hash function. Most of them are Newble or pupil, this is unbelievable.(I'm not arguing that these people can't solve D2, I just think it's unusual for so many people to submit so many similar answers in a very short period of time.)