Submission #760487

# Submission time Handle Problem Language Result Execution time Memory
760487 2023-06-17T16:28:18 Z SanguineChameleon Languages (IOI10_languages) C++17
0 / 100
9209 ms 44488 KB
#include <stdlib.h>
#include <stdio.h>

#include "grader.h"
#include "lang.h"

#define SZ 100

#include <bits/stdc++.h>
using namespace std;

unordered_map<long long, int> cnt[56][4];
long long score[56];
int weight[4];

void excerpt(int *E) {
	weight[0] = 1;
	weight[1] = 0;
	weight[2] = 0;
	weight[3] = 1;
	for (int i = 0; i < 56; i++) {
		score[i] = 0;
	}
	for (int len = 1; len <= 4; len++) {
		for (int i = 0; i < 101 - len; i++) {
			unsigned long long h = 0;
			for (int j = 0; j < len; j++) {
				h = h << 16 | E[i + j];
			}
			for (int j = 0; j < 56; j++) {
				auto it = cnt[j][len - 1].find(h);
				if (it != cnt[j][len - 1].end()) {
					score[j] += it->second * weight[len - 1];
				}
			}
		}
	}
	pair<long long, int> best = make_pair(-1, -1);
	for (int i = 0; i < 56; i++) {
		best = max(best, make_pair(score[i], i));
	}
	int id = language(best.second);
	for (int len = 1; len <= 4; len++) {
		for (int i = 0; i < 101 - len; i++) {
			unsigned long long h = 0;
			for (int j = 0; j < len; j++) {
				h = h << 16 | E[i + j];
			}
			cnt[id][len - 1][h]++;
		}
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 9209 ms 44488 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8944 ms 44488 KB Output isn't correct - 28.14%
2 Halted 0 ms 0 KB -