제출 #1321430

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

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

festival.cpp: In function 'std::vector<int> max_coupons(int, std::vector<int>, std::vector<int>)':
festival.cpp:9:21: error: conversion from 'vector<int>' to non-scalar type 'vector<long long int>' requested
    9 |       vector<ll>v = P, h = T;
      |                     ^
festival.cpp:9:28: error: conversion from 'vector<int>' to non-scalar type 'vector<long long int>' requested
    9 |       vector<ll>v = P, h = T;
      |                            ^
festival.cpp:25:14: error: could not convert 'ans' from 'vector<long long int>' to 'vector<int>'
   25 |       return ans;
      |              ^~~
      |              |
      |              vector<long long int>