Submission #1012383

# Submission time Handle Problem Language Result Execution time Memory
1012383 2024-07-02T05:09:09 Z huutuan Languages (IOI10_languages) C++14
80 / 100
7987 ms 50260 KB
#include <stdlib.h>
#include <stdio.h>

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

#include <bits/stdc++.h>

using namespace std;

const int mod=65537;

int cnt[10][65537][60];

double get(int h, int i, int j){
   int sum=accumulate(cnt[h][i], cnt[h][i]+60, 0);
   if (sum==0) return 0;
   return (double)cnt[h][i][j]/(double)sum;
}

int cc[56], tc;
double sum[56];

void excerpt(int *E) {
   ++tc;
   pair<double, int> ans={0, 0};
   for (int j=0; j<56; ++j){
      sum[j]=0;
      for (int h=0; h<4; ++h) for (int i=h; i<100; ++i){
         int val=0;
         for (int j=i-h; j<=i; ++j) val=(1ll*val*65536+E[j])%mod;
         sum[j]+=get(h, val, j);
      }
      ans=max(ans, {sum[j], j});
   }
   int real=language(ans.second);
   for (int h=0; h<4; ++h) for (int i=h; i<100; ++i){
      int val=0;
      for (int j=i-h; j<=i; ++j) val=(1ll*val*65536+E[j])%mod;
      ++cnt[h][val][real];
   }
}
# Verdict Execution time Memory Grader output
1 Correct 7987 ms 50256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 7797 ms 50260 KB Output is partially correct - 73.69%