洛谷P1514 引水入城 原题链接 一道好题...细节真多 第一次提交90分,然后就GG了,不知从何改起 其实比较简单吧... 首先,一个点的水流向最后一排,一定可以形成一个区间. 不行的话肯定GG 所以先大力dfs出每个点的区间. dfs之后可以先check一下 无解就暴力乱搞 有解时贪心,最开始右端点为0,每次选择可以与右端点相连接的区间中右端点最右的(语文不好),加入进答案并且更新右端点直到覆盖全区间. 我什么时候才能1A一道noip题... // It is made by XZZ #i…
Cow Bowling Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14210 Accepted: 9432 Description The cows don't use actual bowling balls when they go bowling. They each take a number (in the range 0..99), though, and line up in a standard…
http://poj.org/problem?id=3186 Description FJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving vast amounts of milk. FJ sells one treat per day and wants to maximize the money he receives over a given period time…