Submission #914693

# Submission time Handle Problem Language Result Execution time Memory
914693 2024-01-22T14:26:26 Z abcvuitunggio Languages (IOI10_languages) C++17
98 / 100
2936 ms 241092 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],p[3]={6,1,9};
void excerpt(int *E){
    pair <ld, int> mx={0,0};
    for (int i=0;i<SZ-2;i++)
        for (int j=0;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++){
        ld cnt=0;
        for (int j=0;j<SZ-2;j++)
            for (int k=0;k<3;k++)
                cnt+=(ld)(d[i][a[j][k]][k])/(d[i][a[j][k]][k]+1)*p[k];
        mx=max(mx,{cnt,i});
    }
    int res=language(mx.second);    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 Correct 2927 ms 241024 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 2936 ms 241092 KB Output is partially correct - 89.23%