1389: 【中级组】点餐方案
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:52
Solved:22
Description
小明游玩迪斯尼乐园,中午选择了一家餐厅,菜单中 staple 公示了n种主食的价格,drinks 中公示了m种饮料的价格。小明计划选择一份主食和一款饮料,且花费不超过 x 元。请返回小明共有多少种购买方案。
staple 数组及 drinks 数组中的数据都是正整数。、
示例 1:
输入:n=3,m=2,x=15;
staple = [10,15,8], drinks = [5,8];
输出:2
解释:小明 2 种购买方案,所选主食与所选饮料在数组中对应的下标分别是:
第 1 种方案:staple[0] + drinks[0] = 10 + 5 = 15;
第 2 种方案:staple[2] + drinks[0] = 8 + 5 = 13;
示例 2:
输入:n=3, m=3, x=15
staple = [10,13,12], m=3,drinks = [5,5,2] ;
输出:5
staple 数组及 drinks 数组中的数据都是正整数。、
示例 1:
输入:n=3,m=2,x=15;
staple = [10,15,8], drinks = [5,8];
输出:2
解释:小明 2 种购买方案,所选主食与所选饮料在数组中对应的下标分别是:
第 1 种方案:staple[0] + drinks[0] = 10 + 5 = 15;
第 2 种方案:staple[2] + drinks[0] = 8 + 5 = 13;
示例 2:
输入:n=3, m=3, x=15
staple = [10,13,12], m=3,drinks = [5,5,2] ;
输出:5
Input
输入共三行,第一行为 n与 m 以及 x 。第二行为 staple 数组。第二行为 drinks 数组。数据之间用空格分隔。
Output
输出小明共有多少种购买方案。
Sample Input Copy
3 3 15
10 13 12
5 5 2
Sample Output Copy
5
HINT
提示:
1 <= staple及drinks数组长度 <= 100
1<= staple[i],drinks[i] <= 100
1 <= x <= 1000
1 <= staple及drinks数组长度 <= 100
1<= staple[i],drinks[i] <= 100
1 <= x <= 1000