摘要: 月饼是中国人在中秋佳节时吃的一种传统食品,不同地区有许多不同风味的月饼。现给定所有种类月饼的库存量、总售价、以及市场的最大需求量,请你计算可以获得的最大收益是多少。 注意:销售时允许取出一部分库存。样例给出的情形是这样的:假如我们有 3 种月饼,其库存量分别为 18、15、10 万吨,总售价分别为 阅读全文
posted @ 2019-02-19 01:56 shengge777 阅读(95) 评论(0) 推荐(0) 编辑
摘要: There are nn emotes in very popular digital collectible card game (the game is pretty famous so we won't say its name). The ii-th emote increases the 阅读全文
posted @ 2019-02-19 01:54 shengge777 阅读(368) 评论(0) 推荐(0) 编辑
摘要: You are given array a1,a2,…,an. Find the subsegment al,al+1,…,ar with maximum arithmetic mean 1r−l+1∑i=lrai (in floating-point numbers, i.e. without a 阅读全文
posted @ 2019-02-19 01:51 shengge777 阅读(407) 评论(0) 推荐(0) 编辑
摘要: 一棵二叉搜索树可被递归地定义为具有下列性质的二叉树:对于任一结点, 其左子树中所有结点的键值小于该结点的键值; 其右子树中所有结点的键值大于等于该结点的键值; 其左右子树都是二叉搜索树。 所谓二叉搜索树的“镜像”,即将所有结点的左右子树对换位置后所得到的树。 给定一个整数键值序列,现请你编写程序,判 阅读全文
posted @ 2019-02-19 01:45 shengge777 阅读(146) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #define ok 1 #define overflow 0 #define error -1 typedef int ElemType; typedef int Status; typedef struct OLNode { int i,j; ElemType e; struct OL... 阅读全文
posted @ 2018-11-08 20:13 shengge777 阅读(691) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std; int cmp(int x,int y) { return x>y; } int main() { int n,m; int sum1=0,sum2=0; int a[20],b[20]; maps;... 阅读全文
posted @ 2018-08-13 19:28 shengge777 阅读(86) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include using namespace std; mapvis; int main() { int n,m,a[100001]={0},j,temp=0,i,k,pre[100001]={0}; cin>>n; int sum=0; for(i=1;i>a[i]; ... 阅读全文
posted @ 2018-08-13 19:24 shengge777 阅读(76) 评论(0) 推荐(0) 编辑
摘要: A shipment of Nlogs, the main export product from Nlogonia, is in the harbour, in containers, readyto be shipped. All containers have the same dimensi 阅读全文
posted @ 2018-08-13 19:14 shengge777 阅读(86) 评论(0) 推荐(0) 编辑
摘要: Ann and Borya have n piles with candies and n is even number. There are ai candies in pile with number i. Ann likes numbers which are square of some i 阅读全文
posted @ 2018-08-13 19:08 shengge777 阅读(88) 评论(0) 推荐(0) 编辑
摘要: Pavel had two positive integers a and b. He found their sum s and greatest common divisor g, and forgot a and b after that. Help him to restore the or 阅读全文
posted @ 2018-08-13 18:52 shengge777 阅读(114) 评论(0) 推荐(0) 编辑