#include <bits/stdc++.h>
#include "grader.h"
#include "lang.h"
using namespace std;
int a[3][56][100000], b[3][100000];
int cnt[3][100000];
const int MOD = 100000;
void excerpt (int* E) {
int n = 100;
memset (cnt, 0, sizeof (cnt));
std::set <int> s[3];
for (int i = 0; i < 100; i++) {
for (int j = 0; j < min (2, n - i); j++) {
int val = 0;
for (int k = 0; k <= j; k++)
val = val * E[i+k] % MOD;
cnt[j][val]++;
s[j].insert (val);
}
}
double mx = 0;
int x = 0;
for (int i = 0; i < 56; i++) {
double points = 0;
for (int k = 0; k < 2; k++) {
for (int j : s[k]) {
if (b[k][j]) points += cnt[k][j] * ((double) a[k][i][j] / b[k][j]) * (k + 1);
}
}
if (mx < points) {
mx = points;
x = i;
}
}
x = language (x);
for (int i = 0; i < 100; i++) {
for (int j = 0; j < min (2, n - i); j++) {
int val = 0;
for (int k = 0; k <= j; k++)
val = val * E[i+k] % MOD;
a[j][x][val]++;
b[j][val]++;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
541 ms |
2080 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
500 ms |
2048 KB |
Output isn't correct - 1.86% |