Submission #525997

# Submission time Handle Problem Language Result Execution time Memory
525997 2022-02-13T13:06:22 Z tkwiatkowski Languages (IOI10_languages) C++17
66 / 100
2518 ms 142644 KB
/*
	Zadanie: 
	Autor: Tomasz Kwiatkowski
*/

#include <bits/stdc++.h>
#include "lang.h"
#include "grader.h"
#define fi first
#define se second
#define pb push_back

using namespace std;
typedef long long ll;

const int MAXN = 1e6 + 7;
const int INF = 1e9 + 7;

map<ll, int> lang[56];

void excerpt(int *E)
{
	vector<int> best(56, 0);
	for (int i = 1; i < 100; ++i) {
		ll p = (E[i - 1] - 1)*65535 + E[i] - 1;
		for (int l = 0; l < 56; ++l)
			best[l] += lang[l][p];
	}

	int guess = 0;
	for (int i = 1; i < 56; ++i)
		if (best[i] > best[guess])
			guess = i;

	int L = language(guess);
	for (int i = 1; i < 100; ++i) {
		ll p = (E[i - 1] - 1)*65535 + E[i] - 1;
		lang[L][p]++;
	}
}
# Verdict Execution time Memory Grader output
1 Correct 2392 ms 142644 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 2518 ms 142572 KB Output is partially correct - 61.52%