# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
512966 | Markomafko972 | Languages (IOI10_languages) | C++17 | 9628 ms | 34552 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include <stdlib.h>
#include <stdio.h>
#include "grader.h"
#include "lang.h"
using namespace std;
typedef unsigned long long ll;
unordered_map<int, ll> m[60];
set<ll> s;
vector<ll> v;
void excerpt(int *E) {
s.clear();
v.clear();
for (int i = 0; i < 100; i++) {
E[i]--;
s.insert(E[i]);
if (i > 0) s.insert((ll)65535*(ll)E[i-1]+(ll)E[i]);
if (i > 1) {
ll u = E[i-2];
u = u * (ll)65535 + (ll)E[i-1];
u = u * (ll)65535 + (ll)E[i];
s.insert(u);
}
if (i > 2 && (i <= 40 || i >= 90 || i % 2 == 0 || i % 3 == 0 || i % 5 == 0 || i % 7 == 0 || i % 11 == 0)) {
ll u = E[i-3];
u = u * (ll)65535 + (ll)E[i-2];
u = u * (ll)65535 + (ll)E[i-1];
u = u * (ll)65535 + (ll)E[i];
s.insert(u);
}
}
for (set<ll> :: iterator it = s.begin(); it != s.end(); it++) v.push_back(*it);
int maxim = -1, maxiv = -1, koji = 0;
for (int i = 0; i < 56; i++) {
int kolm = 0, kolv = 0;
for (int j = 0; j < v.size(); j++) {
if (m[i].find(v[j]) != m[i].end()) {
if (v[j] > (ll)65535*(ll)65535*(ll)65534) kolv++;
else kolm++;
}
//if (j > 1 && m[i][(long long)65535*(long long)65535*(long long)v[j-2]+(long long)65535*(long long)v[j-1]+(long long)v[j]]) kol++;
}
if (kolm+kolv > maxim+maxiv || (kolm+kolv+5 > maxim+maxiv && kolv > maxiv)) {
//if (kolm+kolv >= maxim+maxiv+2 || kolv >= maxiv) {
maxim = kolm;
maxiv = kolv;
koji = i;
//}
}
}
int pravi = language(koji);
for (int i = 0; i < v.size(); i++) {
m[pravi][v[i]]++;
//if (i > 1) m[pravi][(long long)65535*(long long)65535*(long long)v[i-2]+(long long)65535*(long long)v[i-1]+(long long)v[i]]++;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |