# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
204898 |
2020-02-27T12:29:40 Z |
MetB |
Languages (IOI10_languages) |
C++14 |
|
10000 ms |
168432 KB |
#include <bits/stdc++.h>
#include "grader.h"
#include "lang.h"
using namespace std;
int a[5][56][200000], b[5][200000];
int cnt[5][200000];
const int MOD = 199999;
void excerpt (int* E) {
int n = 100;
memset (cnt, 0, sizeof (cnt));
std::set <int> s[5];
for (int i = 0; i < 100; i++) {
for (int j = 1; j < min (4, n - i); j++) {
int val = 1;
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;
double mult = 1;
for (int k = 1; k < 5; k++) {
for (int j : s[k]) {
if (b[k][j]) points += cnt[k][j] * ((double) a[k][i][j] / b[k][j]) * mult;
}
mult *= 3;
}
if (mx < points) {
mx = points;
x = i;
}
}
x = language (x);
for (int i = 0; i < 100; i++) {
for (int j = 1; j < min (5, n - i); j++) {
int val = 1;
for (int k = 0; k <= j; k++)
val = val * E[i+k] % MOD;
a[j][x][val]++;
b[j][val]++;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10085 ms |
168304 KB |
Time limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10019 ms |
168432 KB |
Time limit exceeded |