제출 #408800

#제출 시각아이디문제언어결과실행 시간메모리
408800rainboyLanguages (IOI10_languages)C11
34 / 100
481 ms5832 KiB
#include <ctype.h> #include <string.h> #include "grader.h" #include "lang.h" #define N 100 #define A 512 #define L 56 #define INF 1e9 double abs_(double a) { return a > 0 ? a : -a; } double kk[L][A]; void excerpt(int *E) { static double kk_[A]; int i, l, l_, l1, a, k; double d_, d; memset(kk_, 0, A * sizeof *kk_), k = 0; for (i = 0; i < N; i++) { if (isspace(E[i])) continue; kk_[E[i] / 128] += 1, k++; } if (k != 0) for (a = 0; a < A; a++) kk_[a] /= k; l_ = -1, d_ = INF; for (l = 0; l < L; l++) { d = 0; for (a = 0; a < A; a++) d += abs_(kk_[a] - kk[l][a]); if (d_ > d) d_ = d, l_ = l; } l1 = language(l_); for (a = 0; a < A; a++) kk[l1][a] = kk_[a]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...