Gifts

2019 CCPC Harbin 哈尔滨 E 题 Exchanging Gifts 题解

2019 CCPC Harbin E. Exchanging Gifts 题意 已知序列 \(g\),将序列 \(g\) 以某种方式乱序后的结果为序列 \(h\),定义序列 \(g\) 的开心值为:在相同下标情况下,序列 \(g\) 对应下标的值和序列 \(h\) 对应下标的值不相同的下标的个数的最 ......
题解 Exchanging Harbin Gifts 2019

[LeetCode] 2558. Take Gifts From the Richest Pile

You are given an integer array gifts denoting the number of gifts in various piles. Every second, you do the following: Choose the pile with the maxim ......
LeetCode Richest Gifts 2558 From

B. Buying gifts[贪心]

Problem - 1801B - Codeforces 题意是需要给两个人买礼物,有n个商店,每个商店只能给一个人买,而且每个商店给两个人买的礼物的价钱也可能不同,问给两人买的礼物的最大价格之差最小是多少。 我们考虑这种情况。如果当前给b买的礼物最大值为x,那么那些商店里给b礼物价格小于等于x的我 ......
Buying gifts
共3篇  :1/1页 首页上一页1下一页尾页