#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;
#include "grader.h"
#include "lang.h"
#define SZ 100
const int B = (int) 1e5;
unordered_map <ll, int> ok[60];
bool vis[60];
inline ll myrand() {
return (1LL * rand() << 15) + rand();
}
void excerpt(int *E) {
int i, j;
unordered_map <ll, int> mp;
for(i = 0; i < 100; i++) {
ll cur = 0;
for(j = i; j < 100 && j < i + 3; j++) {
cur = cur * B + E[j];
mp[cur]++;
}
}
vector <int> arr(56);
int id = -1;
for(auto it : mp) {
for(i = 0; i < 56; i++) {
if(ok[i][it.first]) {
arr[i]++;
}
}
}
id = max_element(arr.begin(), arr.end()) - arr.begin();
if(arr[id] == 0) {
id = -1;
}
if(id == -1) {
vector <int> ids;
for(i = 0; i < 56; i++) {
if(vis[i] == 0) ids.push_back(i);
}
int sz = ids.size();
id = ids[myrand() % sz];
}
id = language(id);
for(i = 0; i < 100; i++) {
ll cur = 0;
if(i % 5 == 0) {
for(j = i; j < 100 && j < i + 3; j++) {
cur = cur * B + E[j];
if(i < j)
ok[id][cur]++;
}
}
ok[id][E[i]]++;
}
vis[id] = 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
4536 ms |
262148 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
4734 ms |
262144 KB |
Execution killed with signal 9 (could be triggered by violating memory limits) |