아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Jelly Flavours

면접 대비

시간 제한1초메모리 제한1024 MB

요약
각 맛마다 두 상점의 가격이 주어지고 A 상점에는 x달러, B 상점에는 y달러를 쓸 수 있을 때, 살 수 있는 서로 다른 맛의 최대 개수를 구한다.
난이도

보통10점 중 5점

유형
그리디, 정렬, 배열, 완전 탐색
정답자
아직 제출이 없습니다

문제

Amy is a big fan of jelly, and wishes to buy some for dessert. There are a total of nn flavours of jelly, numbered 00 to n−1n-1. Store A sells jelly of flavour ii for a\[i]a\[i] dollars a piece, whereas Store B sells it for b\[i]b\[i] dollars a piece. Amy can spend up to xx dollars in Store A and up to yy dollars in Store B.

Help Amy find the maximum number of unique flavours of jelly she can purchase.

제한

  • 1≤n≤20001 \leq n \leq 2000
  • 0≤x,y≤10;0000 \leq x, y \leq 10\\;000
  • 0≤a\[i],b\[i]≤10;0000 \leq a\[i], b\[i] \leq 10\\;000 (for all 0≤i≤n−10 \leq i \leq n-1)

예제

이 문제는 공개된 예제가 없습니다.