Language: C++

#include <iostream>
#include <stdio.h>
#include <string>

using namespace std;

#define DAY 365
#define TEST 26
#define DIM 50 
#define I 100
#define LOOP 1000

using namespace std;



class GAI{
    private:
        int code[DAY];
        int test_dis[TEST];
        int test_pls[DAY][TEST];
        int lastday[TEST];
        int sat;
        int lock;
    public:
        GA(char *argv[]) {
            
            for(int i = 0; i < TEST; i++){
                test_dis[i] = stoi(argv[i + 1]);
            }
            for(int i = 0; i < DAY;i++){
                for(int j = 0; j < TEST; test++){
                    test_pls[i][j] = stoi(argv[i+j+27]);
                }
            }
            random_device rnd;
            mt19937 mt(rnd());
            uniform_int_distribution<> rand26(0, 25);
            for(int i;i < DAY; i++){
                code[i] = rand26(mt);
            }
            for(int i;i < TEST; i++){
                lastday[i] = 0;
            }
            sat = 0;
            lock = 0;
        }
        
        void cal_val(){
            for(int i = 0; i < TEST; i++){
                for(int j = 0; j < DAY; j++){
                    if(code[i] == i) {
                        sat += test_pls[j][i];
                        lastday[i] = j;
                    } else {
                        sat -= test_dis[i]*(i - lastday[i]);
                    }
                }
            }
        }
        int get_sat(){
            return sat;
        }
        int get_code(int change){
            return code[change];
        }
        
        void set_code(int change,int value){
            code[change] = value;
        }
        int get_lock(){
            return lock;
        }
        void set_lock(){
            lock = 1;
        }
        void reset_lock (){
            lock = 0;
        }
        
};

class GA{
    private:
        GAI gai[I];
        int best;
    public:
        GA(char *argv[]){
            for(int i = 0; i < I;i++){
                gai[i] = new GAI(argv);
            }
        }
        
        void lock(){
            for(int i = 1;i < I;i++){
               gai(i).cal_val();
            }
            best = 0;
            for(int i = 1;i < I;i++){
                if(GAI[stack].get_sat() < GAI[i]) best = i;
            }
            gai(best).set_lock();
        }
        
        void mix(){
            random_device rnd;
            mt19937 mt(rnd());
            int par;
            uniform_int_distribution<> rand2(0, 1);
            uniform_int_distribution<> randI(0, I);
            for(int i = 0; i < I;i++){
                if(gai[i].get_lock() == 1) gai[i].reset_lock();
                else{
                    par = randI(mt);
                    for(int j= 0; j < DAY; j++){
                        if(rand2(mt) == 0) gai[i].set_code(j,gai[par].get_code(j));
                    }
                }
            }
        }
        
        int get_best(int num){
            return gai[best].get_code(num);
        }
        
};

int main(int argc, char *argv[]){
    GA ga(argv);
    for(int i = 0; i < LOOP; i++){
        ga.lock();
        ga.mix();
    }
    
    for(int i = 0; i < DAY; i++){
        cout << GA.get_best(i) << endl;
    }// Your code here!
    
}


Compiler output:
a.cc:26:9: error: ISO C++ forbids declaration of 'GA' with no type [-fpermissive]
   26 |         GA(char *argv[]) {
      |         ^~
a.cc: In member function 'int GAI::GA(char**)':
a.cc:32:42: error: 'test' was not declared in this scope
   32 |                 for(int j = 0; j < TEST; test++){
      |                                          ^~~~
a.cc:36:13: error: 'random_device' was not declared in this scope; did you mean 'random_data'?
   36 |             random_device rnd;
      |             ^~~~~~~~~~~~~
      |             random_data
a.cc:37:13: error: 'mt19937' was not declared in this scope
   37 |             mt19937 mt(rnd());
      |             ^~~~~~~
a.cc:38:13: error: 'uniform_int_distribution' was not declared in this scope
   38 |             uniform_int_distribution<> rand26(0, 25);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:38:38: error: expected primary-expression before '>' token
   38 |             uniform_int_distribution<> rand26(0, 25);
      |                                      ^
a.cc:38:40: error: 'rand26' was not declared in this scope; did you mean 'random'?
   38 |             uniform_int_distribution<> rand26(0, 25);
      |                                        ^~~~~~
      |                                        random
a.cc:40:34: error: 'mt' was not declared in this scope; did you mean 'tm'?
   40 |                 code[i] = rand26(mt);
      |                                  ^~
      |                                  tm
a.cc:47:9: warning: no return statement in function returning non-void [-Wreturn-type]
   47 |         }
      |         ^
a.cc: In constructor 'GA::GA(char**)':
a.cc:90:38: error: no matching function for call to 'GAI::GAI(char**&)'
   90 |                 gai[i] = new GAI(argv);
      |                                      ^
a.cc:17:7: note: candidate: 'GAI::GAI()'
   17 | class GAI{
      |       ^~~
a.cc:17:7: note:   candidate expects 0 arguments, 1 provided
a.cc:17:7: note: candidate: 'constexpr GAI::GAI(const GAI&)'
a.cc:17:7: note:   no known conversion for argument 1 from 'char**' to 'const GAI&'
a.cc:17:7: note: candidate: 'constexpr GAI::GAI(GAI&&)'
a.cc:17:7: note:   no known conversion for argument 1 from 'char**' to 'GAI&&'
a.cc: In member function 'void GA::lock()':
a.cc:96:19: error: expression cannot be used as a function
   96 |                gai(i).cal_val();
      |                ~~~^~~
a.cc:100:23: error: expected unqualified-id before '[' token
  100 |                 if(GAI[stack].get_sat() < GAI[i]) best = i;
      |                       ^
a.cc:102:16: error: expression cannot be used as a function
  102 |             gai(best).set_lock();
      |             ~~~^~~~~~
a.cc: In member function 'void GA::mix()':
a.cc:106:13: error: 'random_device' was not declared in this scope; did you mean 'random_data'?
  106 |             random_device rnd;
      |             ^~~~~~~~~~~~~
      |             random_data
a.cc:107:13: error: 'mt19937' was not declared in this scope
  107 |             mt19937 mt(rnd());
      |             ^~~~~~~
a.cc:109:13: error: 'uniform_int_distribution' was not declared in this scope
  109 |             uniform_int_distribution<> rand2(0, 1);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:109:38: error: expected primary-expression before '>' token
  109 |             uniform_int_distribution<> rand2(0, 1);
      |                                      ^
a.cc:109:40: error: 'rand2' was not declared in this scope; did you mean 'rand'?
  109 |             uniform_int_distribution<> rand2(0, 1);
      |                                        ^~~~~
      |                                        rand
a.cc:110:38: error: expected primary-expression before '>' token
  110 |             uniform_int_distribution<> randI(0, I);
      |                                      ^
a.cc:110:40: error: 'randI' was not declared in this scope; did you mean 'rand'?
  110 |             uniform_int_distribution<> randI(0, I);
      |                                        ^~~~~
      |                                        rand
a.cc:114:33: error: 'mt' was not declared in this scope; did you mean 'tm'?
  114 |                     par = randI(mt);
      |                                 ^~
      |                                 tm
a.cc: In function 'int main(int, char**)':
a.cc:136:19: error: expected primary-expression before '.' token
  136 |         cout << GA.get_best(i) << endl;
      |                   ^