Submission #1012385

# Submission time Handle Problem Language Result Execution time Memory
1012385 2024-07-02T05:11:26 Z huutuan Languages (IOI10_languages) C++14
72 / 100
6594 ms 34924 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<3; ++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]+=exp(get(h, val, j)*10);
      }
      ans=max(ans, {sum[j], j});
   }
   int real=language(ans.second);
   for (int h=0; h<3; ++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 6594 ms 34924 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 6483 ms 34896 KB Output is partially correct - 66.59%