Submission #914699

# Submission time Handle Problem Language Result Execution time Memory
914699 2024-01-22T14:44:23 Z abcvuitunggio Languages (IOI10_languages) C++17
97 / 100
2750 ms 97652 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][4],d[56][MOD],p[4]={1,2,4,8};
void excerpt(int *E){
    pair <ld, int> mx={0,0};
    for (int i=0;i<SZ-3;i++){
        if (G)
            a[i][0]=E[i];
        for (int j=1;j<4;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-3;j++)
            for (int k=0;k<4;k++)
                cnt+=min(d[i][a[j][k]],p[k])*p[k];
        mx=max(mx,{cnt,i});
    }
    int res=language(mx.second);
    for (int i=0;i<SZ-3;i++)
        for (int j=0;j<4;j++)
            d[res][a[i][j]]++;
}
# Verdict Execution time Memory Grader output
1 Correct 2644 ms 97652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 2750 ms 97596 KB Output is partially correct - 88.45%