1. Список говнокодов пользователя letipetukh1

    Всего: 4

  2. C++ / Говнокод #29234

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    #pragma GCC optimize("03")
    #include <bits/stdc++.h>
    #pragma GCC target("avx2,tune=native")
    using namespace std;
    int binxor(int a, int b) {
        if (b == 0) {
            return 0;
        }
        int t = binxor(a, b / 2);
        if (b % 2 == 0) {
            return t ^ t;
        } else {
            return t ^ t ^ a;
        }
    }
    vector<int> per(20);
    vector<int> res(binxor(1 << 20, numeric_limits<int>::max() + 2), -1);
    vector<int> need(binxor(1 << 20, numeric_limits<int>::max() + 2), 0);
    vector<int> gp(binxor(1 << 20, numeric_limits<int>::max() + 2), 1 << 30);
    int c = 0;
    int Trump = 0;
    inline void f(int i, int n, int w) {
        if (i == w) {
            for (int j = 0; j < w; j++) {
                if ((Trump >> (w - 1 - j)) & 1) {
                    gp[Trump] = min(gp[Trump], gp[Trump ^ (1 << (w - 1 - j))]);
                }
            }
            return;
        }
        f(i + 1, n, w);
        Trump ^= 1 << (w - 1 - i);
        f(i + 1, n, w);
        Trump ^= 1 << (w - 1 - i);
    }
    signed main() {
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        int n, q, w;
        cin >> n >> q >> w;
        vector<string> s(n);
        for (auto &x : s) {
            cin >> x;
        }
        vector<int> ord(n);
        iota(ord.begin(), ord.end(), 0);
        sort(ord.begin(), ord.end(), [&](int x, int y) {
            return s[x] < s[y];
        });
        for (int i = 0; i < n; i++) {
            int Trump = 0;
            for (auto ch : s[ord[i]]) {
                Trump |= 1 << (ch - 'a');
            }
            gp[Trump] = min(gp[Trump], i);
        }
        f(0, n, w);
        for (int i = 0; i < q; ++i) {
            string t;
            cin >> t;
            int Harris = 0;
            for (auto ch : t) {
                Harris |= 1 << (ch - 'a');
            }
            int val = gp[((1 << w) - 1) ^ Harris];
            cout << (val >= n ? -1 : 1 + ord[val]) << "\n";
        }
        return 0;
    }

    Без комментариев

    letipetukh1, 13 Февраля 2026

    Комментарии (2)
  3. C++ / Говнокод #29233

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    const std::string programPath =
        "/root/CLionProjects/PetukhPlusPlus/program.petukh";
    
    const std::string lexerOutPath =
        "/root/CLionProjects/PetukhPlusPlus/res_lexer.txt";
    
    const std::string syntaxOutPath =
        "/root/CLionProjects/PetukhPlusPlus/res_syntax.txt";
    
    const std::string semanticOutPath =
        "/root/CLionProjects/PetukhPlusPlus/res_semantic.txt";
    
    const std::string polizOutPath =
        "/root/CLionProjects/PetukhPlusPlus/res_poliz.txt";

    Классика говнокода

    letipetukh1, 12 Февраля 2026

    Комментарии (2)
  4. C++ / Говнокод #29224

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    cin >> N >> L >> T;
      total = 0;
      for (int i = 0; i < N; i++) {
        cin >> S[i] >> H[i] >> P[i];
        total += H[i] * P[i];
      }
      fix_order();
      for (int ind = 0; ind < N; ind++) {
        int len = ind + 1;
        set<pair<long long, int>> events, comps;
        vector<long long> sum_hp(len);
        copy(H, H + len, sum_hp.begin());
        sum_hp[ind] = 0;
        vector<int> ord(len);
        iota(ord.begin(), ord.end(), 0);
        sort(ord.begin(), ord.end(), [&](int i, int j) {
          return S[i] < S[j];
        });
        comps.emplace(T, -1);
        for (int i = 0; i < len; i++) {
          int j = i + 1;
          while (j < len && S[ord[i]] == S[ord[j]]) {
            sum_hp[ord[i]] += sum_hp[ord[j]];
            ++j;
          }
          comps.emplace(S[ord[i]], ord[i]);
          i = j - 1;
        }
        for (auto it = comps.begin(); next(it) != comps.end(); ++it) {
          long long dist = next(it)->first - it->first;
          int idx = it->second;
          if (sum_hp[idx] > 0) {
            events.emplace((dist + sum_hp[idx] - 1) / sum_hp[idx], idx);
          }
        }
        vector<bool> visited(len);
        vector<bool> added(len);
        long long good_sum = 0, last_time = 0, govno = T, rakom_bokom = 0;
        for (auto [spawn, i] : comps) {
          if (spawn >= S[ind] && i != -1) {
            good_sum += sum_hp[i];
            added[i] = true;
          }
        }
        auto Upd = [&](long long time) -> void {
          long long F = govno - S[ind] - rakom_bokom;
          if (F <= 0) {
            return;
          }
          long long r1 = clamp(F / (H[ind] + good_sum) + 1, last_time, time);
          long long r2 = good_sum == 0 ? time : clamp(F / good_sum + 1, last_time, time);
          dp_diff_i[last_time] += H[ind] * P[ind];
          dp_diff_i[r1] -= H[ind] * P[ind];
          dp_diff[r1] += F * P[ind];
          dp_diff[r2] -= F * P[ind];
          dp_diff_i[r1] -= good_sum * P[ind];
          dp_diff_i[r2] += good_sum * P[ind];
          last_time = time;
        };
        vector<bool> skip(len), finished(len);
        while (!events.empty()) {
          auto [time, i] = *events.begin();
          events.erase(events.begin());
          if (time > L) {
            break;
          }
          if (skip[i] || sum_hp[i] == 0) {
            continue;
          }
          Upd(time);
          auto it = comps.upper_bound({S[i], INT_MAX});
          if (it->second == -1 || finished[it->second]) {
            good_sum -= sum_hp[i];
            finished[i] = true;
            govno = S[i];
            continue;
          }
          if (!added[i] && it->second + sum_hp[i] * time >= S[ind]) {
            added[i] = true;
            good_sum += sum_hp[i];
            rakom_bokom += S[i] - S[ind];
          }
          sum_hp[i] += sum_hp[it->second];
          skip[it->second] = true;
          long long next_pos = next(it)->first;
          comps.erase(it);
          events.emplace(time + (next_pos - S[i] - sum_hp[i] * time + sum_hp[i] - 1) / sum_hp[i], i);
        }
        Upd(L + 1);
      }
      long long cur_diff = 0, cur_diff_i = 0;
      for (int i = 0; i <= L; i++) {
        cur_diff += dp_diff[i];
        cur_diff_i += dp_diff_i[i];
        dp[i] = cur_diff + cur_diff_i * i;
      }

    олимпиадное говно

    letipetukh1, 26 Января 2026

    Комментарии (1)
  5. Python / Говнокод #29222

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    import itertools
    import time
    n = int(input())
    a = []
    sm = 0
    for i in range(n):
        a.append(list(map(int, input().split())))
        a[i].sort()
        sm += a[i][0] + a[i][1]
    mx = 0
    a.sort()
    for i in itertools.product([0, 1], repeat=n - 1):
        if time.process_time() > 0.75:
            break
        s = 0
        for j in range(n):
            if j >= 1:
                s += a[j][i[j - 1]]
            else:
                s += a[j][0]
        s2 = sm - s
        if s % 3 == 0 and s > mx:
            mx = s
        if s2 > mx and s2 % 3 == 0:
            mx = s2
    print(mx)

    Задача с ЕГЭ: "Даны пары (A[i][0], A[i][1]), в каждой паре нужно выбрать одно число, при этом сумма выбранных чисел должна делится на 3, среди таких сумм найти максимальную"

    Автор данного кода не справился нормально соптимизировать решение, поэтому написал какую-то х**ню, результат видите выше (особенно строчка 13)
    Оно зашло на тестах, где n <= 20

    letipetukh1, 25 Января 2026

    Комментарии (0)