Submission #1030058

# Submission time Handle Problem Language Result Execution time Memory
1030058 2024-07-21T18:15:47 Z Tob Languages (IOI10_languages) C++14
0 / 100
496 ms 53840 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, lang = 56, 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(lang, 0);
	for (int i = 0; i < siz; i++) {
		vector <int> v;
		for (int j = i; j < min(siz, i+le); 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 < lang; 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+le); j++) {
			v.pb(arr[j]);
			m[key[v]][y]++;
		}
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 490 ms 53664 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 496 ms 53840 KB Output isn't correct - 3.06%
2 Halted 0 ms 0 KB -