Submission #632355

# Submission time Handle Problem Language Result Execution time Memory
632355 2022-08-19T21:44:39 Z ggoh Languages (IOI10_languages) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "grader.h"
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
int V[56][65536];
map<lint,int>Y[56];
void excerpt(int *E)
{
  int l=0,maxi=-1;
  vector<lint>P;
  for(int k=0;k<10;k++)
  {
    for(int i=0;i+k<100;i++)
    {
      lint h=0;
      for(int j=0;j<=k;j++)
      {
        h=h*65537+E[i+j];
      }
      P.push_back(h);
    }
  }
  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][i])kind++;
    }
    if(kind>maxi)
    {
      maxi=kind;
      l=j;
    }
  }

  int L=language(l);
  for(int k=0;k<10;k++)
  {
    for(int i=0;i+k<100;i++)
    {
      lint h=0;
      for(int j=0;j<=k;j++)
      {
        h=h*65537+E[i+j];
      }
      Y[j][h]++;
    }
  }
}

Compilation message

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:24:18: error: 'std::vector<long long int>::iterator' has no member named 'P'
   24 |   sort(P.begin().P.end());
      |                  ^
lang.cpp:50:9: error: 'j' was not declared in this scope
   50 |       Y[j][h]++;
      |         ^
lang.cpp:40:7: warning: unused variable 'L' [-Wunused-variable]
   40 |   int L=language(l);
      |       ^