제출 #1258103

#제출 시각아이디문제언어결과실행 시간메모리
1258103mkkkkkkkk축제 (IOI25_festival)C++20
컴파일 에러
0 ms0 KiB
#include "festival.h" #include <bits/stdc++.h> using namespace std; vector<int> max_coupons(int A, vector<int> P, vector<int> T) { vector<pair<int,int>> vec,vec2; for(int i=0;i<P.size();i++) { if(T[i]==2) { vec.push_back({P[i],i}); } else vec2.push_back({P[i],i}); } sort(vec.begin(),vec.end()); sort(vec2.begin(),vec2.end()); for(int i=0;i<vec2.size();i++) { if(A>=vec2[i].first) { a-=vec2[i].first; res.push_back(vec2[i].second); } } return res; }

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

festival.cpp: In function 'std::vector<int> max_coupons(int, std::vector<int>, std::vector<int>)':
festival.cpp:24:13: error: 'a' was not declared in this scope
   24 |             a-=vec2[i].first;
      |             ^
festival.cpp:25:13: error: 'res' was not declared in this scope
   25 |             res.push_back(vec2[i].second);
      |             ^~~
festival.cpp:28:12: error: 'res' was not declared in this scope
   28 |     return res;
      |            ^~~