제출 #39650

#제출 시각아이디문제언어결과실행 시간메모리
39650smu201111192Languages (IOI10_languages)C++14
컴파일 에러
0 ms0 KiB
#include <stdlib.h> #include <stdio.h> #include <set> #include <vector> #include <map> using namespace std; #include "grader.h" #include "lang.h" const int MAXN = 56; #define SZ 100 #define N 100 set<vector<int> > mp[MAXN]; long long f[5] = {0,-100,-100000,-10000000,-1000000000}; long long penalty(int *E,int idx,int cnt){ if(mp[idx].size() == 0)return 1e18; //1개씩 ,2개씩 , 3개씩, 4개씩 long long sum = 0; for(int i=0;i<SZ;i++){ vector<int> temp; for(int j=0;j<cnt;j++){ if(i+j >= SZ) break; temp.push_back(E[i+j]); } if(mp[idx].find(temp) != mp[idx].end()){ sum += f[cnt]; } } return sum; } void add(int *E,int idx,int cnt){ for(int i=0;i<SZ;i++){ vector<int> temp; for(int j=0;j<cnt;j++){ if(i+j >= SZ) break; temp.push_back(E[i+j]); } mp[idx].insert(temp); } } void excerpt(int *E) { vector<pair<long long,long long> > vc; for(int i=0;i<MAXN;i++){ long long p = 0; for(int k = 1;k<=2;k++){ p += penalty(E,i,k); } vc.push_back(make_pair(p,i)); } sort(vc.begin(),vc.end()); long long go = vc[0].second; int ans = language(go); for(int k=1;k<=2;k++){ add(E,ans,k); } }

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

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:50:5: error: 'sort' was not declared in this scope
     sort(vc.begin(),vc.end());
     ^~~~
lang.cpp:50:5: note: suggested alternative: 'qsort'
     sort(vc.begin(),vc.end());
     ^~~~
     qsort