Submission #914689

# Submission time Handle Problem Language Result Execution time Memory
914689 2024-01-22T14:22:02 Z abcvuitunggio Languages (IOI10_languages) C++17
0 / 100
337 ms 262144 KB
#include <bits/stdc++.h>

#include "grader.h"
#include "lang.h"

#define SZ 100
#define A 65536LL
#define ld long double
#define MOD 458047
using namespace std;
int g,G,a[SZ][3],d[56][MOD][3];
vector <int> p;
void excerpt(int *E){
    if (g<=1000){
        p={1,2,4};
        G=1;
    }
    else
        p={6,1,9};
    pair <int, int> mx={0,0};
    for (int i=0;i<SZ-2;i++){
        if (G)
            a[i][0]=E[i];
        for (int j=G;j<3;j++)
            a[i][j]=((j?a[i][j-1]:E[i])*A+E[i+j])%MOD;
    }
    for (int i=0;i<56;i++){
        int cnt=0;
        for (int j=0;j<SZ-2;j++)
            for (int k=0;k<3;k++)
                cnt+=min(d[i][a[j][k]][k],p[k])*p[k];
        mx=max(mx,{cnt,i});
    }
    int res=language(mx.second);
    g++;
    if (g==1000)
        for (int i=0;i<56;i++)
            for (int j=0;j<MOD;j++){
                d[i][j][0]=d[i][j][1];
                d[i][j][1]=d[i][j][2];
            }
    for (int i=0;i<SZ-2;i++)
        for (int j=0;j<3;j++)
            d[res][a[i][j]][j]++;
}
# Verdict Execution time Memory Grader output
1 Runtime error 336 ms 262144 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 337 ms 262144 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -