【正文】
s schedule with three spaceseparated integers: T1, T2, and S.SAMPLE INPUT (file ):3 0 40 2 33 4 20 0 1INPUT DETAILS:FJ has three cows, and the barn needs to be cleaned from second 0 to second 4. The first cow is willing to work during seconds 0, 1, and 2 for a total salary of 3, etc.OUTPUT FORMAT:Line 1: a single integer that is either the minimum total salary to get the barn cleaned or else 1 if it is impossible to clean the barn.SAMPLE OUTPUT (file ):5OUTPUT DETAILS:Farmer John can hire the first two cows.()CEOI 2004 tripsTripsDescriptionIn the forthing holiday season, a lot of people would like to go for an unforgettable travel. To mostly enjoy their journey, everyone wants to go with a group of friends. A travel agency offers several trips. A travel agency offers group trips, but for each trip, the size of the group is limited: the minimum and maximum number of persons are given. Every group can choose only one trip. Moreover, each trip can be chosen by only one group. The travel agency has asked you for help. They would like to organize as many trips as possible. Your task is to match groups of people and trips in such a way, that the maximum number of trips can be organized.TaskWrite a program TRIPS, that:reads the description of the groups and the trips from the standard input matches the groups and trips in such a way, that the maximum number of arranged trips is reached writes the result to standard output. If there are several possible solutions, your program should output anyone of them.CharacteristicsAvailable memory: 64MbMaximum running time: 3sInput fileThe first line of input file contains two integers: n and m separated by single space, 1=n=400000, 1=m=400000。s cows, pampered since birth, have reached new heights of fastidiousness. They now require their barn to be immaculate. Farmer John, the most obliging of farmers, has no choice but hire some of the cows to clean the barn.Farmer John has N (1 = N = 10,000) cows who are willing to do some cleaning. Because dust falls continuously, the cows require that the farm be continuously cleaned during the workday, which runs from second number M to second number E during the day (0 = M = E = 86,399). Note that the total number of seconds during which cleaning is to take place is EM+1. During any given second M..E, at least one cow must be cleaning.Each cow has submitted a job application indicating her willingness to work during a certain interval T1..T2 (where M = T1 = T2 = E) for a certain salary of S (where 0 = S = 500,000). Note that a cow who indicated the interval 10..20 would work for 11 seconds, not 10. Farmer John must either accept or reject each individual application。()Europe Southeastern 2007 Problem DLoan SchedulingThe North Pole Beach Bank has to decide upon a set App of mortgage applications. Each application a ∈App has an acceptance deadline da , ie. the required loan must be paid at a time ta , 0≤ta≤da . If the application is accepted the Bank gets a profit pa . Time is measured in integral units starting from the conventional time origin 0, when the Bank decides upon all the App applications. Moreover, the Bank can pay a maximum number of L loans at any given time. The Bank policy if focussed solely on profit: it accepts a subset S ∈App of applications that maximizes the profit . The problem is to pute the maximum profit the Bank can get from the given set App of mortgage applications.For example, consider that L = 1 , App = {a, b, c, d} , (pa, da) = (4, 2) , (pb, db) = (1, 0) , (pc, dc) = (2, 0) , and (pd, dd) = (3, 1) . The table below shows all possible sets of accepted mortgage applications and the scheduling of the loan payments. The highest profit is 9 and corresponds to the set {c, d, a} . The loan requested by the application c is paid at time 0, the loan corresponding to d is paid at time 1, and, finally, the loan of a is paid at time 2.Time Sets of accepted applications and loan scheduling0 a b c d b c b B c c d d a b c 1 a d d d a a a d d d d 2 a A a a a a a Profit 4 4 4 1 2 3 3 4 5 5 5 6 6 7 7 7 7 8 9 Write a program that reads sets of data from the standard input.InputEach data set corresponds to a set of mortgage applications and starts with two integers: 0≤N≤10000 that shows the number of applications in the set, and 0≤L≤100 which shows the maximum number of loans the Bank can pay at any given time. Follow N pairs of integers pi否則得0 分。【樣例輸入】43 55 13 24 6【樣例輸出】38【評分標準】每一個測試點單獨評分,對于每一個測試點:如果掛綴長度L 與答案一致,且最小重量和W 也正確,則得10 分。第一行包含一個整數(shù)L,表示可以找到的最長穩(wěn)定掛綴長度。接下來N 行,每行兩個整數(shù)(Ci , Wi),分別表示第i 個珠綴的承受能力與重量。小Q 希望她的掛綴盡量長,你能幫她計算出最長可能的穩(wěn)定掛綴么?當然,如果有多個可選解,小Q 希望總重量最小的。老板還告訴小Q,他一共擁有N 個珠綴(假設(shè)每一個珠綴都很漂亮,小Q 都很喜歡),每個珠綴都有其各自的重量與承受能力。我們可以簡單的認為從上往下數(shù)的第i 個綴珠是將它的連接環(huán)套在其上方(也就是第i1 個)綴珠的掛鉤之上(第一個除外)。掛墜的構(gòu)成,是由若干粒綴珠相互連接而成。 remember, however, that once a president, always a president.OutputThe output from the program will specify the period of time when the most presidents were alive, followed by the names in alphabetical order. If there are multiple intervals, the intervals will be listed in chronological order, separated by a blank line. Sample Input3Nixon 19690120 19940422Ford 19740120GWBush 20010120Sample Output1969120 to 1994422FordNixon1974120 to 2003117FordGWBush(問題2中曾提到)2004年廣東省大學生程序競賽試題 Problem BBerth Allocation(Input File: : )Singapore port is one of the busiest ports in the world. In 1994, Singapore maintained its position as the world’s busiest port in terms of shipping tonnage of ship arrivals. In that year, there were 101,107 ship arrivals with shipping tonnage of million gross tons. One of the planning problems encountered at the post is to decide whether a given set of ships can be bert