A: Supermarkettime limit:2000msMemory limit:65536kBSubmissions:330Accepted:15题目描述A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the moment the sale begins. Each product takes precisely one unit of time for being sold. A selling schedule is an ordered subset of products Sell ≤ Prod such that the selling of each product x∈Sell, according to the ordering of Sell, completes before the deadline dx or just when dx expires. The profit of the selling schedule is Profit(Sell)=Σx∈Sellpx. An optimal selling schedule is a schedule with a maximum profit.For example, consider the products Prod={a,b,c,d} with (pa,da)=(50,2), (pb,db)=(10,1), (pc,dc)=(20,2), and (pd,dd)=(30,1). The possible selling schedules are listed in table 1. For instance, the schedule Sell={d,a} shows that the selling of product d starts at time 0 and ends at time 1, while the selling of product a starts at time 1 and ends at time 2. Each of these products is sold by its deadline. Sell is the optimal schedule and its profit is 80.Write a program that reads sets of products from an input text file and computesthe profit of an optimal selling schedule for each set of products.输入A set of products starts with an integer 0 <= n <= 10000, which is the number of products in the set, and continues with n pairs pi di of integers, 1 <= pi <= 10000 and 1 <= di <= 10000, that designate the profit and the selling deadline of the i-th product. White spaces can occur freely in input. Input data terminate with an end of file and are guaranteed correct.输出For each set of products, the program prints on the standard output the profit of an optimal selling schedule for the set. Each result is printed from the beginning of a separate line.样例输入4 50 2 10 1 20 2 30 17 20 1 2 1 10 3 100 2 8 25 20 50 10样例输出80185Global No.提示The sample input contains two product sets. The first set encodes the products from table 1. The second set is for 7 products. The profit of an optimal schedule for these products is 185.B: u Calculate etime limit:1000msMemory limit:10000kBSubmissions:219Accepted:87题目描述A simple mathematical formula for e ise=Σ0<=i<=n1/i!where n is allowed to go to infinity. This can actually yield very accurate approximations of e using relatively small values of n.输入No input输出Output the approximations of e generated by the above formula for the values of n from 0 to 9. The beginning of your output should appear similar to that shown below. 样例输入no input样例输出n e- -----------0 11 2234...Global No.C: Misspellingtime limit:1000msMemory limit:65536kBSubmissions:215Accepted:87题目描述Misspelling is an art form that students seem to excel at. Write a program that removes the nth character from an input string.输入The first line of input contains a single integer N, (1 ≤ N ≤ 1000) which is the number of datasets that follow.Each dataset consists of a single line of input containing M, a space, and a single word made up of uppercase letters only. M will be less than or equal to the length of the word. The length of the word is guaranteed to be less than or equal to 80. 输出For each dataset, you should generate one line of output with the following values: The dataset number as a decimal integer (start counting at one), a space, and the misspelled word. The misspelled word is the input word with the indicated character deleted.样例输入44 MISSPELL1 PROGRAMMING7 CONTEST3 BALLOON样例输出1 MISPELL2 ROGRAMMING3 CONTES4 BALOONGlobal No.D: 文件结构“图”time limit:1000msMemory limit:65536kBSubmissions:56Accepted:8题目描述在计算机上看到文件系统的结构通常很有用。
Microsoft Windows上面的"explorer"程序就是这样的一个例子。
但是在有图形界面之前,没有图形化的表示方法的,那时候最好的方式是把目录和文件的结构显示成一个"图"的样子,而且使用缩排的形式来表示目录的结构。
比如:ROOT| dir1| | file1| | file2| | file3| dir2| dir3| | file1file1file2这个图说明:ROOT目录包括两个文件和三个子目录。
第一个子目录包含3个文件,第二个子目录是空的,第三个子目录包含一个文件。
输入你的任务是写一个程序读取一些测试数据。
每组测试数据表示一个计算机的文件结构。
每组测试数据以'*'结尾,而所有合理的输入数据以'#'结尾。
一组测试数据包括一些文件和目录的名字(虽然在输入中我们没有给出,但是我们总假设ROOT目录是最外层的目录)。
在输入中,以']'表示一个目录的内容的结束。
目录名字的第一个字母是'd',文件名字的第一个字母是'f'。
文件名可能有扩展名也可能没有(比如和fmyfile)。
文件和目录的名字中都不包括空格。
输出在显示一个目录中内容的时候,先显示其中的子目录(如果有的话),然后再显示文件(如果有的话)。
文件要求按照名字的字母表的顺序显示(目录不用按照名字的字母表顺序显示,只需要按照目录出现的先后显示)。
对每一组测试数据,我们要先输出"DATA SET x:",这里x是测试数据的编号(从1开始)。
在两组测试数据之间要输出一个空行来隔开。
你需要注意的是,我们使用一个'|'和5个空格来表示出缩排的层次。
样例输入file1file2dir3dir2file1file2]]file4dir1]file3*file2file1*#样例输出DATA SET 1:ROOT| dir3| | dir2| | file1| | file2| dir1file1file2file3file4DATA SET 2:ROOTfile1file2Global No.提示一个目录和它的子目录处于不同的层次一个目录和它的里面的文件处于同一层次E: 文本对齐time limit:5000msMemory limit:Submissions:24Accepted:1题目描述HTML支持四种文本对齐方式:左对齐、右对齐、居中和两边对齐。