# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
632349 | ggoh | 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 "grader.h"
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
int V[56][65536];
set<lint>W[56];
set<lint>X[56];
set<ulint>Y[56];
set<ulint>Z[56];
void excerpt(int *E)
{
int l=0,maxi=0;
vector<ulint>Q;
for(int i=0;i<96;i++)
{
Q.push_back(1llu*E[i]*(1e9+7)+1llu*E[i+1]*(1e9+9)+1llu*E[i+2]*998244353+1llu*E[i+3]*10007+E[i+4]);
}
for(int j=0;j<56;j++)
{
int kind=0;
for(auto &i:Q)
{
if(Z[j].find(i)!=Z[j].end())kind++;
}
if(kind>maxi)
{
maxi=kind;
l=j;
}
}
if(maxi==0){
vector<ulint>P;
for(int i=0;i<97;i++)
{
P.push_back(1llu*E[i]*(1llu<<48)+1llu*E[i+1]*(1llu<<32)+1llu*E[i+2]*(1llu<<16)+E[i+3]);
}
sort(P.begin(),P.end());
P.erase(unique(P.begin(),P.end()),P.end());
for(int j=0;j<56;j++)
{
int kind=0;
for(auto &i:P)
{
if(Y[j].find(i)!=Y[j].end())kind++;
}
if(kind>maxi)
{
maxi=kind;
l=j;
}
}
if(maxi==0){
vector<lint>U;
for(int i=0;i<98;i++)
{
U.push_back(1ll*E[i]*(1ll<<32)+1ll*E[i+1]*65536+E[i+2]);
}
sort(U.begin(),U.end());
U.erase(unique(U.begin(),U.end()),U.end());
for(int j=0;j<56;j++)
{
int kind=0;
for(auto &i:U)
{
if(X[j].find(i)!=X[j].end())kind++;
}
if(kind>maxi)
{
maxi=kind;
l=j;
}
}
if(maxi==0){
vector<lint>T;
for(int i=0;i<99;i++)
{
T.push_back(1ll*E[i]*65536+E[i+1]);
}
sort(T.begin(),T.end());
T.erase(unique(T.begin(),T.end()),T.end());
for(int j=0;j<56;j++)
{
int kind=0;
for(auto &i:T)
{
if(W[j].find(i)!=W[j].end())kind++;
}
if(kind>maxi)
{
maxi=kind;
l=j;
}
}
if(maxi==0)
{
vector<int>S;
for(int i=0;i<100;i++)S.push_back(E[i]);
sort(S.begin(),S.end());
S.erase(unique(S.begin(),S.end()),S.end());
maxi=-1;
for(int j=0;j<56;j++)
{
int kind=0;
for(auto &i:S)
{
if(V[j][i])kind++;
}
if(kind>maxi)
{
maxi=kind;
l=j;
}
}
}
}
}
}
int L=language(l);
for(int i=0;i<100;i++)
{
V[L][E[i]]++;
}
for(int i=0;i<99;i++)
{
W[L].insert(1ll*E[i]*65536+E[i+1]);
}
for(int i=0;i<98;i++)
{
X[L].insert(1ll*E[i]*(1ll<<32)+1ll*E[i+1]*65536+E[i+2]);
}
for(int i=0;i<97;i++)
{
Y[L].insert(1llu*E[i]*(1llu<<48)+1llu*E[i+1]*(1llu<<32)+1llu*E[i+2]*(1llu<<16)+E[i+3]);
}
for(int i=0;i<96;i++)
{
Z[L].insert(llu*E[i]*(1e9+7)+1llu*E[i+1]*(1e9+9)+1llu*E[i+2]*998244353+1llu*E[i+3]*10007+E[i+4]);
}
}