`
isiqi
  • 浏览: 16649107 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

HDUOJ 2011冬季训练——全程测试

阅读更多

1002 Ropes

Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 53Accepted Submission(s): 41

Problem Description
When climbing a section or “pitch”, the lead climber ascends first, taking a rope with them that they anchor to the rock for protection to ascend. Once at the top of a pitch, the lead climber has the second climber attach to the rope, so they can ascend with the safety of the rope. Once the second climber reaches the top of the pitch, the third attaches, and so on until all the climbers have ascended.
For example, for a 10 meter pitch and 50 meter rope, at most 6 climbers could ascend, with the last climber attaching to the end of the rope. To ascend safely, there must be at least 2 climbers and the rope must be at least as long as the pitch.
This process is repeated on each pitch of the climb, until the top is reached. Then to descend, the climbing rope is hung at its midpoint from an anchor (each half must reach the ground).
The climbers then each rappel from this rope. The rope is retrieved from the anchor by pulling one side of the rope, slipping it though the anchor and allowing it to fall to the ground.
To descend safely, the rope must be at least twice as long as the sum of the lengths of the pitches.
For example, a 60 meter rope is required to rappel from a 30 meter climb, no matter how many climbers are involved.
Climbing ropes come in 50, 60 and 70 meter lengths. It is best to take the shortest rope needed for a given climb because this saves weight. You are to determine the maximum number of climbers that can use each type of rope on a given climb.
Input
The input consists of a number of cases. Each case specifies a climb on a line, as a sequence of pitch lengths as in:
N P1P2... PN
Here N is the positive number of pitches, with 1 ≤ N ≤ 100, and Pkis the positive integer length (in meters) of each pitch, with 1 ≤ Pk≤ 100. The last line (indicating the end of input) is a single 0.
Output
Three numbers for each climb separated by a space, indicating the maximum number of climbers that could use the 50, 60, or 70 meter rope lengths, respectively. State 0 if the given rope length is not suitable for that climb.
Sample Input
1 25 2 10 20 0
Sample Output
3 3 3 0 4 4

1005 Page Count

Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 256Accepted Submission(s): 64


Problem Description
When you execute a word processor's print command, you are normally prompted to specify the pages you want printed. You might, for example, enter:

10-15,25-28,8-4,13-20,9,8-8
The expression you enter is a list of print ranges, separated by commas.

Each print range is either a single positive integer, or two positive integers separated by a hyphen. In the latter case we call the first integer low and the second one high. A print range for which low > high is simply ignored. A print range that specifies page numbers exceeding the number of pages is processed so that only the pages available in the document are printed. Pages are numbered starting from 1.

Some of the print ranges may overlap. Pages which are common to two or more print ranges will be printed only once. (In the example given, pages 13, 14 and 15 are common to two print ranges.)

Input
The input will contain data for a number of problem instances. For each problem instance there will be two lines of input. The first line will contain a single positive integer: the number of pages in the document. The second line will contain a list of print ranges, as defined by the rules stated above. End of input will be indicated by 0 for the number of pages. The number of pages in any book is at most 1000. The list of print ranges will be not be longer than 1000 characters.

Output
For each problem instance, the output will be a single number, displayed at the beginning of a new line. It will be the number of pages printed by the print command.

Sample Input
30 10-15,25-28,8-4,13-20,9,8-8 19 10-15,25-28,8-4,13-20,9,8-8 0

Sample Output
17 12

1007 Railroad

Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 115Accepted Submission(s): 26


Problem Description
A train yard is a complex series of railroad tracks for storing, sorting, or loading/unloading railroad cars. In this problem, the railroad tracks are much simpler, and we are only interested in combining two trains into one.



Figure 1: Merging railroad tracks.

The two trains each contain some railroad cars. Each railroad car contains a single type of products identified by a positive integer up to 1,000,000. The two trains come in from the right on separate tracks, as in the diagram above. To combine the two trains, we may choose to take the railroad car at the front of either train and attach it to the back of the train being formed on the left. Of course, if we have already moved all the railroad cars from one train, then all remaining cars from the other train will be moved to the left one at a time. All railroad cars must be moved to the left eventually. Depending on which train on the right is selected at each step, we will obtain different arrangements for the departing train on the left. For example, we may obtain the order 1,1,1,2,2,2 by always choosing the top train until all of its cars have been moved. We may also obtain the order 2,1,2,1,2,1 by alternately choosing railroad cars from the two trains.

To facilitate further processing at the other train yards later on in the trip (and also at the destination), the supervisor at the train yard has been given an ordering of the products desired for the departing train. In this problem, you must decide whether it is possible to obtain the desired ordering, given the orders of the products for the two trains arriving at the train yard.

Input
The input consists of a number of cases. The first line contains two positive integers N1N2which are the number of railroad cars in each train. There are at least 1 and at most 1000 railroad cars in each train. The second line contains N1positive integers (up to 1,000,000) identifying the products on the first train from front of the train to the back of the train. The third line contains N2positive integers identifying the products on the second train (same format as above). Finally, the fourth line contains N1+N2positive integers giving the desired order for the departing train (same format as above).

The end of input is indicated by N1= N2= 0.

Output
For each case, print on a line possible if it ispossibleto produce the desired order, ornot possibleif not.

Sample Input
3 3 1 2 1 2 1 1 1 2 1 1 2 1 3 3 1 2 1 2 1 2 1 1 1 2 2 2 0 0

Sample Output
possible not possible

1008 Post Office

Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 102Accepted Submission(s): 28


Problem Description
Other than postcards, the post office department of some country recognizes three classes of mailable items: letters, packets, and parcels. The three dimensions of a mailable item are called length, height and thickness, with length being the largest and thickness the smallest of the three dimensions.

A letter's length must be at least 125mm but not more than 290mm, its height at least 90mm but not more than 155mm, and its thickness at least 0.25mm but not more than 7mm. (The unit millimeter is abbreviated by mm.)

All three of a packet's dimensions must be greater than or equal to the corresponding minimum dimension for a letter, and at least one of its dimensions must exceed the corresponding maximum for a letter. Furthermore, a packet's length must be no more than 380mm, its height no more than 300mm, and its thickness no more than 50mm.

All three of a parcel's dimensions must be greater than or equal to the corresponding minimum dimension for a letter, and at least one of its dimensions must exceed the corresponding maximum for a packet. Furthermore, the parcel's combined length and girth may not exceed 2100mm. (The girth is the full perimeter measured around the parcel, perpendicular to the length.)

Input
The input will contain data for a number of problem instances. For each problem instance, the input will consist of the three dimensions (measured in mm) of an item, in any order. The length and width will be positive integers. The thickness will be either a positive integer or a positive floating point number. The input will be terminated by a line containing three zeros.

Output
For each problem instance, your program will classify the item asletter,packet,parcelornot mailable. This verdict will be displayed at the beginning of a new line, in lower case letters.

Sample Input
100 120 100 0.5 100 200 100 10 200 200 75 100 0 0 0

Sample Output
not mailable letter packet parcel
分享到:
评论

相关推荐

    2019HDUOJ暑期多校(第三场数据与标程).zip

    标题中的“2019HDUOJ暑期多校(第三场数据与标程)”指的是2019年夏季,杭州电子科技大学(HDU)在线判题系统(OJ)举办的一场多校联合编程竞赛的第三场比赛。在这样的比赛中,参赛队伍需要解决一系列编程题目,通常...

    HDUOJ离线版(目前最新的版本)

    离线版的HDUOJ为那些无法频繁接入互联网或者需要在无网络环境下进行编程训练的用户提供了一个方便的选择。这个资源包含了该平台的最新版本,确保用户能够获得最新的题目和测试数据。 离线版的主要功能包括: 1. **...

    HDUOJ分类(杭电ACM OJ分类)

    杭电acm在线测试的分类,不是很全,分享给大家

    hduoj poj 的题目分类

    本压缩包文件"hdouoj poj 的题目分类"是针对两个著名的OJ平台——POJ(Programming Online Judge)和HDUOJ(杭州电子科技大学在线评测系统)的题目进行的整理和分类,旨在帮助编程学习者更有效地进行专项训练和提升...

    HDOJ.zip_hduoj100题

    【HDOJ.zip_hduoj100题】是一个压缩包文件,包含了HDUOJ(杭州电子科技大学在线评测系统)的约100道编程练习题目及其源代码。这个资源对于想要提升编程技能,尤其是对算法和数据结构有深入学习需求的程序员来说,是...

    杭电OJ使用说明书 HDOJ使用说明书

    2. 测试结果:系统返回评测结果,包括运行时间、内存消耗以及是否通过所有测试用例。 **六、代码调试** 1. 错误反馈:若代码未通过评测,系统会给出错误信息,如编译错误、运行错误或输出不符合预期等。 2. 复制...

    hduoj解题报告

    hduoj专用解题报告,适合初学者入门,可用!@!!

    杭电ACM-HDUOJ 1001 SUM problem

    ### 杭电ACM-HDUOJ 1001 SUM problem #### 题目背景与概述 杭电ACM-HDUOJ 1001 SUM problem 是一道非常基础且适合编程初学者练习的题目。根据描述,这道题目是“A+B PROBLEM”的一种变形,主要考察的是循环结构和...

    杭电OJ单词爬取翻译爬虫

    杭电HDUOJ爬虫脚本,采用Selenium测试框架编写,爬取完后会自动调用百度api翻译

    HDUSpider.py

    HDUOJ代码备份爬虫,采用Selenium测试框架爬取HDUOJ已通过题目信息并下载到本地打包

    Python优秀项目 基于Flask+MySql+Vue前后端分离的杭电(HDUOJ)刷题实时排行榜源码+部署文档+数据资料

    Python优秀项目 基于Flask+MySql+Vue前后端分离的杭电(HDUOJ)刷题实时排行榜源码+部署文档+数据资料 1、代码压缩包内容 代码的项目文件 部署文档文件 2、代码运行版本 python3.7或者3.7以上的版本;若运行有误,...

    杭电的几道ACM水题

    最后,利用样例数据测试代码,确保正确性。 5. 提升技巧:在解决水题的基础上,可以挑战更复杂的题目,涉及动态规划、图论、最短路径等高级算法。同时,参与模拟赛和讨论,与他人交流解题思路,可以迅速提高编程和...

    HDU 递归题详解大全(含代码)

    不容易系列之(3)—— LELE的RPG难题 3 Children’s Queue 3 献给杭电五十周年校庆的礼物 3 钥匙计数之二 3 钥匙计数之一 3 母牛的故事 3 超级楼梯 3 不容易系列之二 3 一只小蜜蜂... 3 阿牛的EOF牛肉串 3 神、上帝...

    contests-all-in-one:BZOJ,POJ,LeetCode,USACO,HDUOJ,LA的比赛解决方案

    BZOJ,POJ,LeetCode,USACO,HDUOJ,LA的比赛解决方案 有话要说 嗨,我是Ex10si0n。 该存储库用于记录我的OJ AC代码。 关于我 OIer,Develpoer。 希望这个仓库可以帮助那些通过Probelm ID找到LeetCode或其他OJ解决...

    欧几里德算法

    例如,【部分内容】中给出的HDUOJ 1452——Happy 2004题目,要求计算2004^X的所有正整数因子之和S对29取模的结果。最直观的方法是通过循环尝试除法,但这会导致O(n^0.5)的时间复杂度,对于大整数是不可接受的。 要...

    pku hdu zoj题目分类

    在IT领域,特别是编程竞赛和算法训练中,Online Judge(简称OJ)系统是一个重要的学习和测试平台。这些系统提供了一系列的编程题目,帮助程序员提升解决问题的能力和算法水平。本资料包聚焦于三大OJ平台——PKU...

    几百道JDUOJ题目的答案

    而那些来自浙江大学ACM集训队的题目则难度较大,这一点从侧面展示了浙大ACM集训队对编程竞赛的重视程度以及训练题目的质量。众所周知,浙江大学的计算机科学与技术在全国范围内享有盛誉,其ACM集训队更是培养了许多...

    hdu-page-11-answer.rar_hdu_hdu oj第十一页_page_搜题_杭电oj

    4. 测试调试:利用样例测试用例进行初步验证,再逐步完善代码,确保满足所有情况。 5. 代码优化:在保证正确性的前提下,尝试减少时间或空间复杂度,提高算法效率。 五、解答资源的价值 "HDU Page 11 Answer"提供的...

    leetcode和oj-ACM:算法和编码练习。试题来自POJ、HDUOJ和Leetcode

    leetcode 和 oj ACM Practice for algorithm and coding. The exam questions come from POJ, HDU OJ and Leetcode. 母函数 数学 排序

    140道杭电OJ答案

    【杭电OJ答案】是针对杭州电子科技大学(HDU)在线评测系统(Online Judge,简称OJ)上的编程题目提供的解题代码集合。这个压缩包包含了解答140道题目的C/C++代码,这些题目主要是面向算法和编程技巧的。...

Global site tag (gtag.js) - Google Analytics