제출 #406420

#제출 시각아이디문제언어결과실행 시간메모리
406420victoriadJelly Flavours (IOI20_jelly)C++14
컴파일 에러
0 ms0 KiB
#include "jelly.h"
#include <vector>
using namespace std;

int find_maximum_unique(int x, int y, std::vector<int> a, std::vector<int> b) {
	int n = a.size();
	if(y==0){
		sort(a.begin(),a.end());
		int r=0;
		for(int i=0;i<n;i++){
			if(a[i]<=x){
				r++;
				x-=a[i];
			}
			else{
				break;
			}
		}
		return r;

	}
	return n;
}

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

jelly.cpp: In function 'int find_maximum_unique(int, int, std::vector<int>, std::vector<int>)':
jelly.cpp:8:3: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |   sort(a.begin(),a.end());
      |   ^~~~
      |   short