博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
谷歌在线测试题
阅读量:4582 次
发布时间:2019-06-09

本文共 6657 字,大约阅读时间需要 22 分钟。

Problem A. Bad HorseConfused? Read the quick-start guide.Small input 112 points    Solve A-small-1You may try multiple times, with penalties for wrong submissions.Small input 221 points    You must solve small input 1 first.You may try multiple times, with penalties for wrong submissions.ProblemAs the leader of the Evil League of Evil, Bad Horse has a lot of problems to deal with. Most recently, there have been far too many arguments and far too much backstabbing in the League, so much so that Bad Horse has decided to split the league into two departments in order to separate troublesome members. Being the Thoroughbred of Sin, Bad Horse isn't about to spend his valuable time figuring out how to split the League members by himself. That what he's got you -- his loyal henchman -- for.InputThe first line of the input gives the number of test cases, T. T test cases follow. Each test case starts with a positive integer M on a line by itself -- the number of troublesome pairs of League members. The next M lines each contain a pair of names, separated by a single space.OutputFor each test case, output one line containing "Case #x: y", where x is the case number (starting from 1) and y is either "Yes" or "No", depending on whether the League members mentioned in the input can be split into two groups with neither of the groups containing a troublesome pair.Limits1 ≤ T ≤ 100.Each member name will consist of only letters and the underscore character.Names are case-sensitive.No pair will appear more than once in the same test case.Each pair will contain two distinct League members.Small dataset1 ≤ M ≤ 10.Large dataset1 ≤ M ≤ 100.SampleInput      Output  21Dead_Bowie Fake_Thomas_Jefferson3Dead_Bowie Fake_Thomas_JeffersonFake_Thomas_Jefferson Fury_LeikaFury_Leika Dead_Bowie    Case #1: YesCase #2: NoProblem B. Captain HammerConfused? Read the quick-start guide.Small input22 points    Solve B-smallYou may try multiple times, with penalties for wrong submissions.ProblemThe Hamjet is a true marvel of aircraft engineering. It is a jet airplane with a single engine so powerful that it burns all of its fuel instantly during takeoff. The Hamjet doesn't have any wings because who needs them when the fuselage is made of a special Wonderflonium isotope that makes it impervious to harm.Piloting the Hamjet is a not a job for your typical, meek-bodied superhero. That's why the Hamjet belongs to Captain Hammer, who is himself impervious to harm. The G-forces that the pilot endures when taking a trip in the Hamjet are legen-dary.The Hamjet takes off at an angle of θ degrees up and a speed of V meters per second. Vis a fixed value that is determined by the awesome power of the Hamjet engine and the capacity of its fuel tank. The destination is D meters away. Your job is to program the Hamjet's computer to calculate θ given V and D.Fortunately, the Hamjet's Wondeflonium hull is impervious to air friction. Even more fortunately, the Hamjet doesn't fly too far or too high, so you can assume that the Earth is flat, and that the acceleration due to gravity is a constant 9.8 m/s2 down.InputThe first line of the input gives the number of test cases, T. T lines follow. Each line will contain two positive integers -- V and D.OutputFor each test case, output one line containing "Case #x: θ", where x is the case number (starting from 1) and θ is in degrees up from the the horizontal. If there are several possible answers, output the smallest positive one.An answer will be considered correct if it is within 10-6 of the exact answer, in absolute or relative error. See the FAQ for an explanation of what that means, and what formats of floating-point numbers we accept.Limits1 ≤ T ≤ 4500;1 ≤ V ≤ 300;1 ≤ D ≤ 10000;It is guaranteed that each test case will be solvable.SampleInput      Output  398 98098 490299 1234    Case #1: 45.0000000Case #2: 15.0000000Case #3: 3.8870928 Problem C. MoistConfused? Read the quick-start guide.Small input 14 points    Solve C-small-1You may try multiple times, with penalties for wrong submissions.Small input 26 points    You must solve small input 1 first.You may try multiple times, with penalties for wrong submissions.ProblemMoist has a hobby -- collecting figure skating trading cards. His card collection has been growing, and it is now too large to keep in one disorganized pile. Moist needs to sort the cards in alphabetical order, so that he can find the cards that he wants on short notice whenever it is necessary.The problem is -- Moist can't actually pick up the cards because they keep sliding out his hands, and the sweat causes permanent damage. Some of the cards are rather expensive, mind you. To facilitate the sorting, Moist has convinced Dr. Horrible to build him a sorting robot. However, in his rather horrible style, Dr. Horrible has decided to make the sorting robot charge Moist a fee of $1 whenever it has to move a trading card during the sorting process.Moist has figured out that the robot's sorting mechanism is very primitive. It scans the deck of cards from top to bottom. Whenever it finds a card that is lexicographically smaller than the previous card, it moves that card to its correct place in the stack above. This operation costs $1, and the robot resumes scanning down towards the bottom of the deck, moving cards one by one until the entire deck is sorted in lexicographical order from top to bottom.As wet luck would have it, Moist is almost broke, but keeping his trading cards in order is the only remaining joy in his miserable life. He needs to know how much it would cost him to use the robot to sort his deck of cards.InputThe first line of the input gives the number of test cases, T. T test cases follow. Each one starts with a line containing a single integer, N. The next N lines each contain the name of a figure skater, in order from the top of the deck to the bottom.OutputFor each test case, output one line containing "Case #x: y", where x is the case number (starting from 1) and y is the number of dollars it would cost Moist to use the robot to sort his deck of trading cards.Limits1 ≤ T ≤ 100.Each name will consist of only letters and the space character.Each name will contain at most 100 characters.No name with start or end with a space.No name will appear more than once in the same test case.Lexicographically, the space character comes first, then come the upper case letters, then the lower case letters.Small dataset1 ≤ N ≤ 10.Large dataset1 ≤ N ≤ 100.SampleInput      Output  22Oksana BaiulMichelle Kwan3Elvis StojkoEvgeni PlushenkoKristi Yamaguchi   Case #1: 1Case #2: 0

 

转载于:https://www.cnblogs.com/fickleness/p/3343181.html

你可能感兴趣的文章
c++仿函数 functor
查看>>
JAVA加密算法系列-AesEBC
查看>>
dojo chart详解
查看>>
使用OGG添加唯一标识字段到目标表
查看>>
JavaScript:值类型 引用类型
查看>>
JavaScript:Function/Object/prototype/__proto__
查看>>
JSP自定义tag
查看>>
Response对象
查看>>
schtasks命令遇见ERROR: The request is not supported.
查看>>
【python】学习笔记10-装饰器
查看>>
Linux 系统下 centOS 7 ipconfig 提示没有安装
查看>>
php多态设计
查看>>
git常用操作
查看>>
锋利的jq第三天
查看>>
CSS控制文本内容固定行行显示,超出部分“...”
查看>>
FormsAuthentication使用指南
查看>>
解压缩文件
查看>>
Maven打包附加配置文件
查看>>
面经二
查看>>
使用css实现特殊标志或图形
查看>>