이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdlib.h>
#include <stdio.h>
#include <map>
using namespace std;
#include "grader.h"
#include "lang.h"
#define SZ 100
#define LANG 56
int A[LANG][65536];
int appear[LANG];
void excerpt(int *E) {
double langcnt[LANG];
for(int i=0;i<LANG;i++) langcnt[i]=0;
for(int i=0;i<SZ-1;i++){
unsigned int triplet=((E[i]*53)+E[i+1])&65535;
for(int j=0;j<LANG;j++){
int v = A[j][triplet];
langcnt[j] += (double)v/(appear[j]+1);
}
}
double max=0;
int maxi=0;
for(int i=0;i<LANG;i++){
if(max<langcnt[i]){
max=langcnt[i];
maxi=i;
}
}
int res=language(maxi);
appear[res]++;
for(int i=0;i<SZ-1;i++){
unsigned int triplet=((E[i]*53)+E[i+1])&65535;
A[res][triplet]=A[res][triplet]+1;
}
return;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |