# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
869929 | Matjaz | Languages (IOI10_languages) | C++14 | 7521 ms | 39816 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdlib.h>
#include <stdio.h>
#include <set>
#include <vector>
#include <algorithm>
#include <unordered_set>
using namespace std;
#include "grader.h"
#include "lang.h"
#define SZ 100
unordered_set<int> S[56];
int L = 56;
void excerpt(int *E) {
vector<int> sample;
long long a = 719;
long long b = 479001599;
int l = 4;
for (int i=0;i<100 - l + 1;i++){
int hash = 0;
for (int j=0;j<l;j++){
hash = (hash * a + E[i + j]) % b;
if (j > 0) sample.push_back(hash);
}
}
int best_score = 0;
int best_guess = 0;
for (int i=0;i<L;i++){
int score = 0;
for (int j=0;j<sample.size();j++) score += S[i].count(sample[j]);
if (best_score < score){
best_score = score;
best_guess = i;
}
}
int target = language(best_guess);
S[target].insert(sample.begin(), sample.end());
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |