# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
512754 | lovro_nidogon1 | Languages (IOI10_languages) | C++14 | 0 ms | 0 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 "lang.h"
#include "grader.h"
using namespace std;
short freq[56][70001], nocur[56], cfreq[70001];
const short cum = 2;
set<pair<short, short> > ses[56];
set<pair<short, pair<short, short> > > sussy[56];
void excerpt(short *e) {
short exp = 0;
short sd = 0;
for(short i = 0; i < 56; i++) {
short csd = 0;
for(short j = 0; j < 100; j++) csd += freq[i][e[j]];
for(short j = 0; j < 99; j++) csd += (ses[i].find({e[j], e[j + 1]}) != ses[i].end());
for(short j = i%2; j < 98; j+=cum) csd += (sussy[i].find({e[j], {e[j + 1], e[j + 2]}}) != sussy[i].end());
if(csd > sd) sd = csd, exp = i;
}
short ca = language(exp);
for(short i = 0; i < 100; i++) freq[ca][e[i]] = 1;
for(short i = 0; i < 99; i++) ses[ca].insert({e[i], e[i + 1]});
for(short i = exp%2; i < 98; i+=cum) sussy[ca].insert({e[i], {e[i + 1], e[i + 2]}});
nocur[ca]++;
}