随笔分类 -  7-4-算法-贪心

摘要:You are given an array a1,a2,…,ana1,a2,…,an and an integer kk. You are asked to divide this array into kk non-empty consecutive subarrays. Every eleme 阅读全文
posted @ 2019-06-30 16:03 yzm10 阅读(454) 评论(0) 推荐(0)
摘要:贝壳找房函数最值 35.12% 1000ms 262144K 贝壳找房的攻城狮最近在研究一次函数 f(x) = ax + bf(x)=ax+b。 现在有 nn 个一次函数,f_i(x) = a_ix+b_i,\ i = \{1 \mathellipsis n\}fi​(x)=ai​x+bi​, i= 阅读全文
posted @ 2019-06-01 22:49 yzm10 阅读(542) 评论(0) 推荐(0)
摘要:D-money 链接:https://www.nowcoder.com/acm/contest/140/D来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 131072K,其他语言262144K 64bit IO Format: %lld 时间限制:C/C++ 1秒,其他 阅读全文
posted @ 2018-07-24 21:22 yzm10 阅读(264) 评论(0) 推荐(0)
摘要:Longest Ordered Subsequence A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric sequence ( a1, a2, ... 阅读全文
posted @ 2017-08-15 21:46 yzm10 阅读(152) 评论(0) 推荐(0)
摘要:Arctic Network The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication 阅读全文
posted @ 2017-08-03 14:58 yzm10 阅读(201) 评论(0) 推荐(1)
摘要:Cleaning Shifts Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one 阅读全文
posted @ 2017-07-30 22:46 yzm10 阅读(157) 评论(0) 推荐(0)
摘要:Protecting the Flowers Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7812 Accepted: 3151 Description Farmer John went to cut some wood an 阅读全文
posted @ 2017-07-30 16:48 yzm10 阅读(195) 评论(0) 推荐(0)
摘要:Fence Repair Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,0 阅读全文
posted @ 2017-07-23 12:05 yzm10 阅读(286) 评论(0) 推荐(0)
摘要:Stall Reservations Oh those picky N (1 <= N <= 50,000) cows! They are so picky that each one will only be milked over some precise time interval A..B 阅读全文
posted @ 2017-07-20 16:41 yzm10 阅读(315) 评论(0) 推荐(0)
摘要:HDU2037 今年暑假不AC 贪心算法 大意: 每次测试数据输入一个n,然后输入n对的电视节目播放时间:开始时间及结束时间, 求这个人能看的最多的完整的节目数。 解题思路: 对于这道解题,是对每个节目的结束时间排序,目的是使剩余时间留下,再判断还能看几个节目。对节目时间的排序结束后,依次判断,这次 阅读全文
posted @ 2017-06-14 22:03 yzm10 阅读(185) 评论(0) 推荐(0)