Submission #1029967

# Submission time Handle Problem Language Result Execution time Memory
1029967 2024-07-21T15:05:54 Z Tob Languages (IOI10_languages) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>

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

#define F first
#define S second
#define all(x) x.begin(), x.end()
#define pb push_back
#define FIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;

typedef long long ll;
typedef pair <int, int> pii;

const int siz = 100;

map <vector <ll>, ll> m[56];

vector <ll> score(vector <ll> v) {
	ll c = v.size();
	vector <ll> res(56, 0);
	for (int i = 0; i < 56; i++) res[i] = m[i][v]*c*c;
	return res;
}

void excerpt(int* arr) {
	vector <ll> res(56, 0);
	for (int i = 0; i < siz; i++) {
		vector <ll> v, d;
		for (int j = i; j < min(siz, i+10); j++) {
			v.pb(arr[j]);
			d = score(v);
			for (int k = 0; k < 56; k++) res[k] += d[k];
		}
	}
	int x = 0;
	for (int i = 1; i < 56; i++) if (res[i] > res[x]) x = i;
	int y = language(x);
	for (int i = 0; i < siz; i++) {
		vector <ll> v;
		for (int j = i; j < min(siz, i+10); j++) {
			v.pb(arr[j]);
			m[y][v]++;
		}
	}
}

Compilation message

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:40:10: error: 'language' was not declared in this scope
   40 |  int y = language(x);
      |          ^~~~~~~~