首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    模拟赛 2018 Benelux Algorithm Programming Contest (BAPC 18)(部分题)

    After the festive opening of your new store, the Boutique store for Alternative Paramedicine and Cwakhsahlvereigh, to your disappointment you find out that you are not mak- ing as many sales as you had hoped. To remedy this, you decide to run a special offer: you will mark some subset of the n items for sale in your store as participating in the offer, and if people buy exactly two of these items, and the cost of these items is strictly more than X euros, you will give them a free complimentary unicorn horn! Since you recently found out all your unicorn horns are really narwahl tusks, you decide to rig the offer by picking the participating items in such a way that no one can earn a horn anyway. To make sure no one becomes suspicious, you want to mark as many items as possible as participating in the offer. Input • On the first line two integers, 1 ≤ n ≤ 10 5 , the number of items for sale in your store, and 1 ≤ X ≤ 10 9 , the minimum cost specified in the statement. • On the second line n positive integers, each at most 10 9 . These are the prices of the items in the store. Output Print the maximum number of items you can mark as part of your special offer, without anyone actually being able to receive a horn. Sample Input 1 Sample Output 1 5 6 1 2 3 4 5 3 Sample Input 2 Sample Output 2 5 10 4 8 1 9 7 2 Sample Input 3 Sample Output 3 4 10 1 3 1 7 4 4 Problem A: A Prize No One Can Win Sample Input 4 Sample Output 4 1 5 6 1

    04

    扫码

    添加站长 进交流群

    领取专属 10元无门槛券

    手把手带您无忧上云

    扫码加入开发者社群

    相关资讯

    热门标签

    活动推荐

      运营活动

      活动名称
      广告关闭
      领券