#include <stdlib.h>
#include <stdio.h>
#include <cmath>
#include <set>
#include "grader.h"
#include "lang.h"
#define SZ 100
using namespace std;
typedef unsigned long long ll;
const int M = 100;
const int N = 2;
const int K = 15;
set<pair<ll, int>> x;
int y[65];
//int cnt = 0;
void excerpt(int *E)
{
// int mx2 = -1, mi2 = 0;
// for(int i = 0; i < 56; i++) y[i] = 0;
// for(int i = 0; i < 100; i++)
// {
// int mx = -1, mi = 0, mx2 = -1;
// for(int j = 0; j < 56; j++)
// {
// if(x[E[i]][j] > mx) mx = x[E[i]][j], mi = j;
// else if(x[E[i]][j] > mx2) mx2 = x[E[i]][j];
// }
// y[mi] += M + N * sqrt(mx - mx2) + K * sqrt(sqrt(mx - mx2));
// }
// mx2 = -1;
// for(int i = 0; i < 56; i++)
// {
// if(y[i] > mx2) mx2 = y[i], mi2 = i;
// }
int mx = -1, mi = -1;
for(int i = 0; i < 56; i++)
{
int cnt = 0;
for(int j = 0; j < 97; j++)
{
ll t = E[j] * 65536ULL * 65536ULL * 65536ULL + E[j + 1] * 65536ULL * 65536ULL + E[j + 2] * 65536ULL + E[j + 3];
t += 65536ULL * 65536ULL * 65536ULL;
int tt = x.count({t, i});
int lg = 0;
while(tt >= 0) tt /= 2, lg++;
cnt += lg;
}
for(int j = 0; j < 98; j++)
{
ll t = E[j] * 65536ULL * 65536ULL + E[j + 1] * 65536ULL + E[j + 2];
int tt = x.count({t, i});
int lg = 0;
while(tt >= 0) tt /= 2, lg++;
cnt += lg;
}
if(mx < cnt) mx = cnt, mi = i;
}
int k = language(mi);
for(int i = 0; i < 97; i++)
{
ll t;
t = E[i] * 65536ULL * 65536ULL * 65536ULL + E[i + 1] * 65536ULL * 65536ULL + E[i + 2] * 65536ULL + E[i + 3];
t += 65536ULL * 65536ULL * 65536ULL;
x.insert({t, k});
}
for(int i = 0; i < 98; i++)
{
ll t;
t = E[i] * 65536ULL * 65536ULL + E[i + 1] * 65536ULL + E[i + 2];
x.insert({t, k});
}
// cnt++;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10069 ms |
384 KB |
Time limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
10081 ms |
256 KB |
Time limit exceeded |