ICode9

精准搜索请尝试: 精确搜索
  • 神坑!该用double用成int就会出错!-1070 Mooncake (25 分)2021-02-07 09:57:21

    1070 Mooncake (25 分) Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now given the inventory amounts a

  • PAT B1020 月饼 解题记录2020-03-06 21:02:23

    很简单的贪心算法,不过一开始做的时候还是有好多情况没有考虑到 思路很简单,读取输入,然后计算各种月饼单价,按单价对月饼进行排序,优先选择单价高对月饼。 下面说说一开始犯的几个错误。(我是用java写的) 1:一开始提交,全是答案错误,于是检查题目,发现要求保留两位小数。于是使用Deci

  • Alice's mooncake shop2020-03-03 18:00:37

    题目大意: 一个月饼店开m个小时(24小时营业),只在整点做月饼,做月饼的能力非常强。现在只需要考虑成本的问题。给m个cost值,cost[i]表示第i个小时做1个月饼的代价。 再给n个时间,从2000年1月1日0时开始计算。表示订单的截止时间。当然为了节约成本,可以提前趁成本不高的时候做月饼。但是月

  • PTA乙级 (1020 月饼 (25分))2020-02-03 19:54:53

    1020 月饼 (25分) https://pintia.cn/problem-sets/994805260223102976/problems/994805301562163200 #include <iostream> #include <cstdio> #include <cstring> #include <string> #include <cmath> #include <algorithm> #include <

  • 贪心2019-11-10 09:03:40

      贪心: #include <cstdion> #include <algorithm> using namespace std; struct mooncake{ double store; //库存量 double sell; //总售价 double price; //单价 }cake[1010]; bool cmp(mooncake a,mooncake b){ //按单价从高到低排序 return a.pri

  • A1070 Mooncake (25 分)2019-11-09 12:01:36

    一、参考代码 #include<cstdio> #include<algorithm> #include<iostream> using namespace std; struct P{ double need;//库存 double value;//总价 double s_mon;//单价 }; bool cmp(P a, P b){ return a.s_mon > b.s_mon; } int main(){ i

  • PAT B1020 月饼2019-09-25 13:00:07

    #include<iostream>#include<algorithm>using namespace std;struct mooncake{ double store; double sell; double price;} cake[1010];bool cmp(mooncake a,mooncake b){ return a.price>b.price;}int main(){ int n; double D; cin>>n>>D; for(

  • 1070 Mooncake (25 分)2019-09-05 16:38:43

    1070 Mooncake (25 分) Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now given the inventory amounts a

  • 【1070】Mooncake (25 分)2019-08-17 19:07:04

    #include<iostream> #include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include<algorithm> #include<map> #include<vector> #include<queue> using namespace std; //key:策略-总是选择单价最

  • 1070 Mooncake (25 分) 贪心2019-08-05 16:07:38

    Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region’s culture. Now given the inventory amounts and the prices of all ki

  • 1070 Mooncake (25 分) 贪⼼算法2019-07-28 11:41:15

    1070 Mooncake (25 分) Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now given the inventory amounts a

  • PAT_A1070#Mooncake2019-07-22 20:00:42

    Source: PAT A1070 Mooncake (25 分) Description: Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now

  • 1020 月饼 (25 分)2019-04-21 19:40:08

    月饼是中国人在中秋佳节时吃的一种传统食品,不同地区有许多不同风味的月饼。现给定所有种类月饼的库存量、总售价、以及市场的最大需求量,请你计算可以获得的最大收益是多少。 注意:销售时允许取出一部分库存。样例给出的情形是这样的:假如我们有 3 种月饼,其库存量分别为 18、15、10 万

  • 1070 Mooncake (25 分)2019-02-25 21:54:54

    1070 Mooncake (25 分) Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now given the inventory amount

  • A10702019-02-16 19:00:09

    给出总价和需求量,求最大收益。 思路:求单价最高的,排序。 1 #include<cstdio> 2 #include<algorithm> 3 using namespace std; 4 struct mooncake{ 5 double store;//存货 6 double sell;//总价 7 double price;//单价 8 }cake[1010]; 9 bool cmp(mooncake

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有