1. Лучший говнокод

    В номинации:
    За время:
  2. Си / Говнокод #25512

    0

    1. 1
    2. 2
    3. 3
    enum {
    #include "opcodes"
    };

    Хотел юзать один файл с перечислением и в "Си" и в "fasm", но только потом понял, что в "fasm" так не получится :(

    BOKCEJIbHblu_nemyx, 05 Апреля 2019

    Комментарии (22)
  3. Куча / Говнокод #25500

    +2

    1. 1
    https://codepen.io/Chokcoco/pen/jJJbmz

    Нихуёво так

    HoBblu_nemyx, 03 Апреля 2019

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

    +3

    1. 1
    2. 2
    3. 3
    //  https://stackoverflow.com/questions/313970/how-to-convert-stdstring-to-lower-case?__=1746193182#
    
    std::transform(data.begin(), data.end(), data.begin(), ::tolower);

    Какой багор )))

    BOKCEJIbHblu_nemyx, 31 Марта 2019

    Комментарии (22)
  5. Куча / Говнокод #25411

    0

    1. 1
    ‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮

    GenkaFF, 26 Февраля 2019

    Комментарии (22)
  6. Python / Говнокод #25410

    0

    1. 1
    Мне кажется или в тройке input(str) не дружит в юникоде в str?

    syoma, 26 Февраля 2019

    Комментарии (22)
  7. C++ / Говнокод #25276

    +1

    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
    97. 97
    #include <bits/stdc++.h>
    using namespace std;
    vector <pair<int,int> > vpp;
    long long vres = 0;
    int get_dist(pair<int,int> l, pair<int,int> r)
    {
        int ans1 = abs(l.first - r.first);
        int ans2 = abs(l.second - r.second);
        return ans1 + ans2;
    
    }
        pair<vector <pair<int,int> > , long long>  rec(const string &s, int id,long long len,pair<int,int> pos,vector <vector <pair<int,int> > > &cl, vector <pair<int,int> > p)
    {
        if(id == (int)s.size())
            return {p,len};
        int st = s[id] - 'a';
        pair<vector <pair<int,int> > , long long> ans,tmp;
    
        for(int j = 0; j < (int)cl[st].size(); ++j)
        {
            p.push_back({cl[st][j]});
            tmp = rec(s,id + 1, len + get_dist(pos, cl[st][j]), cl[st][j], cl,p);
            if(tmp.second >= ans.second)
            {
                ans = tmp;
            }
            p.pop_back();
        }
        return ans;
    }
    #define mag pair< pair< vector< pair<int,int> > , long long>  , pair< pair< int,int >,pair< int,int > > >
    mag raz(int l, int r,const string &s,vector <vector <pair<int,int> > > &cl)
    {
    
        mag v1,v2;
        vector <pair<int,int> > p;
        if(r - l >= 1)
        {
            int tm = (l + r) >> 1;
            v1 = raz(l,tm,s,cl);
            bool f = 1;
            if(tm + 1 > r)
            {
                v2 = v1;
                f = 0;
            }
            else
                v2 = raz(tm + 1,r,s,cl);
          //  int st1 = ar[v1.second.first.first][v1.second.first.second];
           // int st2 = ar[v2.second.first.first][v2.second.first.second];
            long long len = 0;
    
    ///merge
            int n = (int)v1.first.first.size();
            len += v1.first.second;
            for(int i = 0; i < n; ++i)
            {
                p.push_back(v1.first.first[i]);
            }
            if(f)
            {
                len += v2.first.second;
                int n = (int)v2.first.first.size();
                for(int i = 0; i < n; ++i)
                {
                    p.push_back(v2.first.first[i]);
                }
            }
            len += get_dist(v1.second.second, v2.second.first);
            return {{p,len}, {v1.second.second, v2.second.first}};
        }
    
        int st = s[l] - 'a';
        int x1 = rand() % (int)cl[st].size();
        p.push_back(cl[st][x1]);
       // cout << cl[st].size() << " " << l << " " << r <<'\n';
        return {{p,0},{cl[st][x1],cl[st][x1]}};
    }
    //pair<int,vector <pair<int,int> > > solve(ifstream &cin, ofstream &cout)
     void solve(ifstream &cin, ofstream &cout)
    {
        vector <int> used(26);
        vector <vector <pair<int,int> > > cl(26);
        int n, m ,l;
        cin >> n >> m >> l;
        vector <vector <char > > ar(n,vector <char> (m));
        for(int i = 0; i < n; ++i)
        {
            for(int j = 0; j < m; ++j)
            {
                cin >> ar[i][j];
            }
        }
        string s;
        cin >> s;
        for(int i = 0; i < n; ++i)
        {

    omnocoder, 04 Января 2019

    Комментарии (22)
  8. PHP / Говнокод #24940

    +2

    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
    <?php
    define('+1', 16384);
    ${'*.'} = function ($a, $b) {
        return floor($a * $b / constant('+1'));
    };
    
    ${'/.'} = function ($a, $b) {
        return floor($a * constant('+1') / $b);
    };
    
    echo ${'/.'}(1, 1) . "\n";
    echo ${'/.'}(1, 2) . "\n";
    echo ${'/.'}(7, 34) + ${'/.'}(23, 99) . "\n";

    Где-то за кулисами прячется факт, что в "PHP" в качестве имён констант и переменных можно использовать произвольные строки.

    https://ideone.com/3MCnCW

    4EPTA_KyJIuC, 19 Октября 2018

    Комментарии (22)
  9. SQL / Говнокод #24861

    −10

    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
    product_id '14' 
     product_id '17' 
     product_id '18' 
     product_id '19' 
     product_id '20' 
     product_id '21' 
     product_id '22' 
     product_id '25' 
     product_id '28' 
     product_id '29' 
     product_id '30' 
     product_id '31' 
     product_id '32' 
     product_id '33' 
     product_id '34' 
     product_id '35' 
     product_id '36' 
     product_id '37' 
     product_id '38' 
     product_id '39' 
     product_id '40' 
     product_id '41' 
     product_id '42' 
     product_id '152' 
     product_id '166' 
     product_id '181' 
     product_id '183' 
     product_id '184' 
     product_id '187' 
     product_id '188' 
     product_id '189' 
     product_id '190' 
     product_id '191' 
     product_id '192' 
     product_id '193' 
     product_id '194' 
     product_id '195' 
     product_id '196' 
     product_id '197' 
     product_id '198' 
     product_id '200' 
     product_id '202' 
     product_id '203' 
     product_id '803' 
     product_id '805' 
     product_id '806' 
     product_id '807' 
     product_id '808' 
     product_id '809' 
     product_id '810'

    snegoviktlt, 04 Октября 2018

    Комментарии (22)
  10. C++ / Говнокод #24802

    +1

    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
    #include <map>
    #include <stdio.h>
    #include <vector>
    using namespace std;
     
    int main() {
       map<string, int> karta;
       for (auto pituh : vector<string> {"foo", "bar", "foo"}) {
        	karta[pituh]++;
       }
       printf("foo: %d\nbar: %d\n", karta["foo"], karta["bar"]);
       return 0;
    }

    <?php

    $karta = [];
    foreach (["foo", "bar", "foo"] as $pituh) {
    if (!isset($karta[$pituh])) {
    $karta[$pituh] = 0;
    }
    $karta[$pituh]++;
    }
    echo "foo: {$karta['foo']}\nbar: {$karta['bar']}\n";


    Поэтому за что я?

    guestinxo, 24 Сентября 2018

    Комментарии (22)
  11. Куча / Говнокод #24770

    −6

    1. 1
    2. 2
    3. 3
    Поцны, по советуйте какой нибудь опен-сорсный свободный, бесплатный xml редактор таблиц.
    Libre в этом плане, слишком много мусора сует, да и она придерживается стандартов. А мне нужна собственная таблица.
    Да, можно самому написать, но мне лень, к тому же если самому писать зачем мне тогда xml когда на lua проще бахнуть таблу.

    3oJIoTou_xyu, 16 Сентября 2018

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