제출 #1315912

#제출 시각아이디문제언어결과실행 시간메모리
1315912ezzzay축제 (IOI25_festival)C++20
컴파일 에러
0 ms0 KiB
#include "festival.h" #include<bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define ff first #define ss second std::vector<int> max_coupons(int A, std::vector<int> P, std::vector<int> T) { vector<pair<int,int>>vc; int N=P.size(); for(int i=0;i<N;i++){ vc.pb({P[i],i}); } sort(vc.begin(),vc.end()); for(auto p:vc){ if(p.ff<=A){ A-=p.ff; v.pb(p.ss); } } return v; }

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

festival.cpp: In function 'std::vector<long long int> max_coupons(long long int, std::vector<long long int>, std::vector<long long int>)':
festival.cpp:18:13: error: 'v' was not declared in this scope
   18 |             v.pb(p.ss);
      |             ^
festival.cpp:21:12: error: 'v' was not declared in this scope
   21 |     return v;
      |            ^