Language: C++

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

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:27:9: error: ISO C++ forbids declaration of 'GA' with no type [-fpermissive]
   27 |         GA(char *argv[]) {
      |         ^~
a.cc: In member function 'int GAI::GA(char**)':
a.cc:33:42: error: 'test' was not declared in this scope
   33 |                 for(int j = 0; j < TEST; test++){
      |                                          ^~~~
a.cc:48:9: warning: no return statement in function returning non-void [-Wreturn-type]
   48 |         }
      |         ^
a.cc: In constructor 'GA::GA(char**)':
a.cc:91:38: error: no matching function for call to 'GAI::GAI(char**&)'
   91 |                 gai[i] = new GAI(argv);
      |                                      ^
a.cc:18:7: note: candidate: 'GAI::GAI()'
   18 | class GAI{
      |       ^~~
a.cc:18:7: note:   candidate expects 0 arguments, 1 provided
a.cc:18:7: note: candidate: 'constexpr GAI::GAI(const GAI&)'
a.cc:18:7: note:   no known conversion for argument 1 from 'char**' to 'const GAI&'
a.cc:18:7: note: candidate: 'constexpr GAI::GAI(GAI&&)'
a.cc:18:7: note:   no known conversion for argument 1 from 'char**' to 'GAI&&'
a.cc: In member function 'void GA::lock()':
a.cc:97:19: error: expression cannot be used as a function
   97 |                gai(i).cal_val();
      |                ~~~^~~
a.cc:101:23: error: expected unqualified-id before '[' token
  101 |                 if(GAI[stack].get_sat() < GAI[i]) best = i;
      |                       ^
a.cc:103:16: error: expression cannot be used as a function
  103 |             gai(best).set_lock();
      |             ~~~^~~~~~
a.cc: In function 'int main(int, char**)':
a.cc:137:19: error: expected primary-expression before '.' token
  137 |         cout << GA.get_best(i) << endl;
      |                   ^