Language: C++

#include<bits/stdc++.h>
using namespace std;

const long long MOD = 1000000007;
const long long MAX = 2000000;

template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}
int D;
int koushin(int c[26],int last[26],int used,int d,int kasan,int sum){
    int tm=last[used];
    last[used]=d;
    int sum_m=sum;
    for(int i=0;i<26;i++){
        sum_m-=c[i]*(d-last[i]);
    }
    last[used]=tm;
    sum_m+=kasan;
    return sum_m;
}
int keisan(int c[26],int sousa[365],int s[D][26]){
    int sum=0;
    int last[26];
    for(int i=0;i<26;i++){
        last[i]=0;
    }
    for(int i=0;i<365;i++){
        sum=koushin(c,last,sousa[i],i+1,s[i][sousa[i]],sum);
        last[sousa[i]]=i+1;
    }
    return sum;

}

int main()
{
    
    int c[26];
    int last[26];
    for(int i=0;i<26;i++){
        last[i]=0;
    }
    cin>>D;
    pair<int,int>s[D][26];
    pair<int,int>p[D][26];
    for(int i=0;i<26;i++){
        cin>>c[i];
    }
    for(int i=0;i<D;i++){
        for(int j=0;j<26;j++){
            int tmp;
            cin>>tmp;
            s[i][j]=make_pair(tmp,j+1);
            p[i][j]=make_pair(tmp,j+1);
        }
        sort(p[i],p[i]+26);
    }
    int sousa[D];
    for(int i=0;i<D;i++){
        sousa[i]=p[i][25].second;
    }
    int now=keisan(c,sousa,s);
    int sum=0;
    vector<int>anss;
    random_device seed_gen;
    mt19937 engine(seed_gen());
    int tmpp_sum;
    for(int i=0;i<D;i++){
        clock_t start = clock(); 
        clock_t end = clock(); 
        int y=engine()%26;
        if(y==0){
            y=26;
        }
        int mae=last[y];
        int tmp_sum=koushin(c,last,p[i][25].second,i+1,s[D][y].first,sum);
        bool first=true;
        int number=p[i][25].second;
        while(end-start<1000){
        int x= engine()%26;
        if(x==0){
            x=26;
        }
        int l=sousa[x];
        sousa[i]=x;
        if(keisan(c,sousa,s)>now){
            now=keisan(c,sousa,s);
            number=l;
        }else{
            sousa[i]=l;
        }
        end=clock();
        
        }
        sum=tmp_sum;
        anss.push_back(number);


    }
    for(int i=0;i<D;i++){
        cout<<anss[i]<<endl;
    }

    


    
    

}


Compiler output:
a.cc:28:43: error: size of array 's' is not an integral constant-expression
   28 | int keisan(int c[26],int sousa[365],int s[D][26]){
      |                                           ^
a.cc: In function 'int main()':
a.cc:69:28: error: cannot convert 'std::pair<int, int> (*)[26]' to 'int (*)[26]'
   69 |     int now=keisan(c,sousa,s);
      |                            ^
      |                            |
      |                            std::pair<int, int> (*)[26]
a.cc:28:41: note:   initializing argument 3 of 'int keisan(int*, int*, int (*)[26])'
   28 | int keisan(int c[26],int sousa[365],int s[D][26]){
      |                                     ~~~~^~~~~~~~
a.cc:93:27: error: cannot convert 'std::pair<int, int> (*)[26]' to 'int (*)[26]'
   93 |         if(keisan(c,sousa,s)>now){
      |                           ^
      |                           |
      |                           std::pair<int, int> (*)[26]
a.cc:28:41: note:   initializing argument 3 of 'int keisan(int*, int*, int (*)[26])'
   28 | int keisan(int c[26],int sousa[365],int s[D][26]){
      |                                     ~~~~^~~~~~~~
a.cc:94:32: error: cannot convert 'std::pair<int, int> (*)[26]' to 'int (*)[26]'
   94 |             now=keisan(c,sousa,s);
      |                                ^
      |                                |
      |                                std::pair<int, int> (*)[26]
a.cc:28:41: note:   initializing argument 3 of 'int keisan(int*, int*, int (*)[26])'
   28 | int keisan(int c[26],int sousa[365],int s[D][26]){
      |                                     ~~~~^~~~~~~~