Submission #404842

# Submission time Handle Problem Language Result Execution time Memory
404842 2021-05-15T06:43:06 Z Jasiekstrz Languages (IOI10_languages) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "lang.h"
#define fi first
#define se second
using namespace std;
const int N=100;
const int K=1;
map<pair<int,long long>,set<int>> mp;
vector<pair<int,long long>> all_fragments(int E[])
{
	vector<pair<int,long long>> tmp;
	for(int d=0;d<k;d++)
	{
		for(int i=0;i+d<N;i++)
			tmp.push_back(hsh(E+i,d));
	}
	return tmp;
}
void excerpt(int E[])
{
	vector<pair<int,long long>> t=all_fragments(E);
	vector<int> cnt(56,0);
	for(auto v:t)
	{
		for(auto l:mp[v])
			cnt[l]++;
	}
	int mx=0,g=0;
	for(int i=0;i<56;i++)
	{
		if(cnt[i]>mx)
		{
			mx=cnt[i];
			g=i;
		}
	}
	int lang=language(g);
	for(auto v:t)
		mp[v].insert(lang);
	return;
}

Compilation message

lang.cpp: In function 'std::vector<std::pair<int, long long int> > all_fragments(int*)':
lang.cpp:12:16: error: 'k' was not declared in this scope
   12 |  for(int d=0;d<k;d++)
      |                ^
lang.cpp:15:18: error: 'hsh' was not declared in this scope
   15 |    tmp.push_back(hsh(E+i,d));
      |                  ^~~
lang.cpp: In function 'void excerpt(int*)':
lang.cpp:37:11: error: 'language' was not declared in this scope
   37 |  int lang=language(g);
      |           ^~~~~~~~