이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#if 01
#include <stdlib.h>
#include <stdio.h>
#include "grader.h"
#include "lang.h"
#define SZ 100
#define M (100003)
#define LANG (56)
#define P (65537)
typedef long long ll;
const int roll = 3;
ll save[SZ + 1];
int cnt[LANG][P];
int hcnt[LANG][M];
int vote[LANG];
ll hash(int *E){
	ll hash_value = 0;
	ll p_pow = 1;
	for (int i = 0; i < roll; i++){
		hash_value = (hash_value + E[i] * p_pow) % M;
		p_pow = (p_pow*P) % M;
	}
	return hash_value;
}
void excerpt(int *E) {
	for (int i = 0; i < SZ - roll + 1; i++){
		save[i] = hash(E + i);
	}
	for (int i = 0; i < LANG; i++){
		vote[i] = 0;
		for (int j = 0; j < SZ; j++){
			if (cnt[i][E[j]])vote[i]++;
			if (i < SZ - roll + 1)
				if (hcnt[i][save[j]])vote[i]++;
		}
	}
	int guess = 0, max = 0;
	for (int i = 0; i < LANG; i++){
		if (max < vote[i])guess = i, max = vote[i];
	}
	int ans = language(guess);
	for (int i = 0; i < SZ; i++){
		cnt[ans][i]++;
		if (i<SZ - roll + 1) hcnt[ans][save[i]]++;
	}
}
#endif
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |