#include <stdlib.h>
#include <stdio.h>
#include <unordered_map>
using namespace std;
#include "grader.h"
#include "lang.h"
#define SZ 100
unordered_map<int, int> lang(100000);
int cnt = 0;
void excerpt(int *E) {
int guess = rand()%56;
for (int i = 0; i < 100; i++) {
int key = E[i];
if (lang.find(key) != lang.end() && lang[key] != 56)
guess = lang[key];
}
for (int i = 0; i < 99; i++) {
int key = E[i]*65536 + E[i + 1];
if (lang.find(key) != lang.end() && lang[key] != 56)
guess = lang[key];
}
int answer = language(guess);
for (int i = 0; i < 100; i++) {
int key = E[i];
if (lang.find(key) == lang.end())
lang[key] = answer;
else if (lang[key] != answer)
lang[key] = 56;
}
for (int i = 0; i < 99; i++) {
int key = E[i] * 65536 + E[i + 1];
if (lang.find(key) == lang.end())
lang[key] = answer;
else if (lang[key] != answer)
lang[key] = 56;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
295 ms |
2500 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
243 ms |
2552 KB |
Output is partially correct - 55.44% |