제출 #867618

#제출 시각아이디문제언어결과실행 시간메모리
867618MatjazLanguages (IOI10_languages)C++14
컴파일 에러
0 ms0 KiB
#include <stdlib.h> #include <stdio.h> #include <set> #include <vector> using namespace std; #include "grader.h" #include "lang.h" #define SZ 100 //vector<int> count()[56]; //set<pair<int,int> > S[56]; //set<pair<int,pair<int,int> > > S[56]; set<pair<pair<int,int>,pair<int,int> > > S[56]; int L = 56; int total = 0; int win = 0; int winsingle = 0; int totalsingle = 0; void excerpt(int *E) { total += 1; set<pair<pair<int,int>,pair<int,int> > > sample; for (int i=0;i<97;i++) sample.insert(make_pair(make_pair(E[i], E[i+1]), make_pair(E[i+2], E[i+3]))); int best_score = 0; int best_guess = 0; int best_count = 0; vector<int> scores(L); for (int i=0;i<L;i++){ set<pair<pair<int,int>,pair<int,int> > > intersect; set_intersection(sample.begin(), sample.end(), S[i].begin(), S[i].end(), std::inserter(intersect, intersect.begin())); int score = intersect.size(); scores[i] = score; if (best_score == score) best_count++; if (best_score < score){ best_score = score; best_guess = i; best_count = 1; } } int target = language(best_guess); if (target == best_guess) win++; if (best_count == 1) totalsingle++; if (target == best_guess && best_count == 1) winsingle++; /*printf("%0.2lf%%\n",100.0*win/total); if (target == best_guess) printf("WIN\n"); else printf("FAIL\n"); printf("Sample letters: %ld\n", sample.size()); printf("Best count: %d\n", best_count); if (totalsingle > 0) printf("Win single: %0.2lf%%\n",100.0*winsingle/totalsingle); printf("Win multiple: %0.2lf%%\n",100.0*(win - winsingle)/(total -totalsingle)); for (int i=0;i<L;i++) printf("%d ", scores[i]); printf("\n\n");*/ S[target].insert(sample.begin(), sample.end()); }

컴파일 시 표준 에러 (stderr) 메시지

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:40:9: error: 'set_intersection' was not declared in this scope
   40 |         set_intersection(sample.begin(), sample.end(), S[i].begin(), S[i].end(),
      |         ^~~~~~~~~~~~~~~~