답안 #232601

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
232601 2020-05-17T14:03:12 Z crossing0ver Languages (IOI10_languages) C++17
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#include "grader.h"
#include "lang.h"
using namespace std;
bool s[56][65536];
int A[56];
vector<int> G;
int vis[65536];
const int MOD = 1E9 + 7;
set<pair<int,int> > H[56];
set<pair<int,pair<int,int> > F[56];
void excerpt(int E[]) {
	int ca = 1;
	for (int i = 0; i <= 55; i++) {
	for (int j = 0; j < 100; j++) {
		G.push_back(E[j]);
		if (s[i][E[j]] && !vis[E[j]])  {
		if (j == 0)  A[i] += 1, vis[E[j]] = 1;
		else 
			A[i]++, vis[E[j]] = 1;
		if (j != 99 && H[i].find({E[j],E[j+1]}) != H[i].end())
		A[i] += 10;
		if (j < 98 &&  F[j].find({E[j],{E[j+1],E[j+2]} }) != F[j].end() ) ;
			A[i] += 100;
	}
		}
		for (int g:G) vis[g] = 0;
		G.clear(); 
	}
	for (int i = 0; i <= 55; i++)
		if (A[i] > A[ca]) ca = i;
	memset (A,0,sizeof A);
	int d = language(ca);
	for (int i = 0; i < 100; i++) {
		s[d][E[i]]|=1;
		if (i != 99)
		H[d].insert({E[i],E[i+1]});
		if (i < 98) F[d].insert({E[i],{E[i+1],E[i+2]} });
	}
		
}

Compilation message

lang.cpp:11:34: error: template argument 1 is invalid
 set<pair<int,pair<int,int> > F[56];
                                  ^
lang.cpp:11:34: error: template argument 2 is invalid
lang.cpp:11:34: error: template argument 3 is invalid
lang.cpp: In function 'void excerpt(int*)':
lang.cpp:23:18: error: 'F' was not declared in this scope
   if (j < 98 &&  F[j].find({E[j],{E[j+1],E[j+2]} }) != F[j].end() ) ;
                  ^
lang.cpp:23:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   if (j < 98 &&  F[j].find({E[j],{E[j+1],E[j+2]} }) != F[j].end() ) ;
   ^~
lang.cpp:24:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
    A[i] += 100;
    ^
lang.cpp:38:15: error: 'F' was not declared in this scope
   if (i < 98) F[d].insert({E[i],{E[i+1],E[i+2]} });
               ^