#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
using ld = long double;
#define all(v) begin(v),end(v)
mt19937 rng(1210);
int freq[60][1<<16];
int cnt = 0;
void excerpt(int *E) {
if(!cnt) {
cnt = 1;
for(int i=0;i<60;i++) fill(freq[i]+1,freq[i]+(1<<16),1), freq[i][0]=196;
}
pair<ld,int> bst={-1e9,0};
for(int i=0;i<56;i++) {
ld prob = 0;
for(int j=0;j<100;j++) prob += log(freq[i][E[j]])-log(freq[i][0]);
bst=max(bst,{prob,i});
}
int lang = language(bst.second);
for(int i=0;i<100;i++) freq[lang][E[i]]++;
freq[lang][0]+=100;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
851 ms |
15708 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
872 ms |
15960 KB |
Output is partially correct - 80.37% |