Submission #632338

# Submission time Handle Problem Language Result Execution time Memory
632338 2022-08-19T21:17:28 Z ggoh Languages (IOI10_languages) C++14
95 / 100
5154 ms 21704 KB
#include<bits/stdc++.h>
#include "grader.h"
using namespace std;
typedef long long lint;
int V[56][65536];
set<lint>W[56];
set<lint>X[56];
void excerpt(int *E)
{
  int l=0,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]);
  }
  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]);
  }
  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]);
    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]);
  }
}
# Verdict Execution time Memory Grader output
1 Correct 5075 ms 21704 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 5154 ms 21636 KB Output is partially correct - 86.89%