Submission #1030057

# Submission time Handle Problem Language Result Execution time Memory
1030057 2024-07-21T18:09:49 Z Tob Languages (IOI10_languages) C++14
0 / 100
3859 ms 262144 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, le = 1;
const int C = 1e6*le + 7;
 
map <char, int> m[C];
map <vector <int>, int> key;
 
void score(int x, int c, vector <int>& res) {
	for (auto y : m[x]) res[(int)y.F] = y.S*c*c;
}
 
void excerpt(int arr[]) {
	vector <int> res(56, 0);
	for (int i = 0; i < siz; i++) {
		vector <int> v;
		for (int j = i; j < min(siz, i+10); j++) {
			v.pb(arr[j]);
			if (key.find(v) == key.end()) key[v] = key.size();
			score(key[v], j-i+1, res);
		}
	}
	int x = 0;
	for (int i = 1; i < 56; i++) if (res[i] > res[x]) x = i;
	char y = language(x);
	for (int i = 0; i < siz; i++) {
		vector <int> v;
		for (int j = i; j < min(siz, i+10); j++) {
			v.pb(arr[j]);
			m[key[v]][y]++;
		}
	}
}
# Verdict Execution time Memory Grader output
1 Runtime error 3854 ms 262144 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3859 ms 262144 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -