답안 #406420

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
406420 2021-05-17T14:56:25 Z victoriad Jelly Flavours (IOI20_jelly) C++14
컴파일 오류
0 ms 0 KB
#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;
}

Compilation message

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