文章目录

  • 题目描述
  • 输入描述:
  • 输出描述:
  • 输入
  • 输出
  • AC的C++代码

题目描述

Plate spinning is a circus act where a person spins various objects(usually plates and bowls) on poles without them falling off. It involves spinning an object and then returning back to the object in order to add additional speed to prevent it from falling off the pole.
In this problem you will simulate plate spinning where the plates are placed in a circular arrangement (much like the picture to the right). You must determine whether Chester the Clown will be able to maintain the plates spinning or whether one or more plates will end up falling off poles.

The Problem:
Given the number of poles/plates in a circular arrangement and the speed up to which Chester the Clown spins the plates (in degrees per second), determine if he can maintain the act or if plates will fall. For this problem, we will assume that plates degrade (slow down) at a constant rate of 5-degrees-per-second per second and that Chester can move from one pole to any other pole in 0.5 seconds. In addition, assume that Chester can spin up a plate with zero time cost.
A plate falls off when its rate is zero. However, if Chester arrives at a plate exactly at the same time the rate reaches zero, Chester will spin the plate and prevents it from falling, i.e., the rate must reach zero before Chester arrives for the plate to fall.

输入描述:

The first line of the input will be a single positive integer, a, representing the number of acts to evaluate. Each of the following a lines will represent a single act and will contain two positive integers, n and p, separated by a single space, where n represents the number of poles (1 ≤ n ≤ 15) and p represents the speed up to which Chester spins a plate (0 < p ≤ 100) in degrees per second. At the very beginning of each act, all plates are initially spinning at this speed, and he is currently at a plate in the circle (he can choose which plate to start at in order to maximize his chance of success).

输出描述:

For each circus act, output a header “Circus Act i:” on a line by itself where i is the number of the act (starting with 1). Then, on the next line, output “Chester can do it!” if Chester can maintain the act, or output “Chester will fail!” if one or more plates will fall. Leave a blank line after the output for each test case.

输入

3
2 10
5 7
2 12

输出

Circus Act 1:
Chester can do it!

Circus Act 2:
Chester will fail!

Circus Act 3:
Chester can do it!

AC的C++代码

#include <iostream>
using namespace std;int main()
{int T;cin>>T;for(int i=1;i<=T;i++){int n,p;cin>>n>>p;cout<<"Circus Act "<<i<<":"<<endl;if(n==1||0.5*5*n<=p)cout<<"Chester can do it!"<<endl<<endl;elsecout<<"Chester will fail!"<<endl<<endl;}}

牛客 2021年度训练联盟热身训练赛第二场 G题Plate Spinning相关推荐

  1. 2021年度训练联盟热身训练赛第三场赛后补题

    2021年度训练联盟热身训练赛第三场赛后补题 A Circuit Math [题目分析] [代码展示] B Diagonal Cut [题目分析] [代码展示] C Gerrymandering [题 ...

  2. 2021年度训练联盟热身训练赛第三场(待补)

    文章目录 前言 一.Circuit Math(后缀表达式---栈&&fgets) 二.Diagonal Cut(gcd最大公因数,数论) 三.expected primary-expr ...

  3. 2021年度训练联盟热身训练赛第四场 H - Rock Paper Scissors(字符串匹配,FFT)

    整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 2021年度训练联盟热身训练赛第四场 H - Rock Paper Scissors(字符串匹配,FF ...

  4. 2021年度训练联盟热身训练赛第五场

    2021年度训练联盟热身训练赛第五场 链接:https://ac.nowcoder.com/acm/contest/13926 A Binary Seating #include<bits/st ...

  5. 2021年度训练联盟热身训练赛第八场

    目录 2021年度训练联盟热身训练赛第八场 A-Fire on Field 题意 思路 代码 B-Gene Tree 题意 思路 代码 I-Thread Knots 题意 思路 代码 J-Triang ...

  6. 2021年度训练联盟热身训练赛第五场F题Group Project

    题意: 有n个人,其中有m组,两两互斥,现在要分成两个班,但最终求的确是最多有多少对不互斥的. 题目: 链接:https://ac.nowcoder.com/acm/contest/16741/F 来 ...

  7. 2021年度训练联盟热身训练赛第五场 H题In-place Sorting+贪心构造

    题意: 给你n个小于101810^{18}1018的大数,问在可以再不改变序列位置,之改变数值中某数位的'9'变为'6'或将'6'变为'9',求的最终序列由小到大,且字典序最小. 题目: 链接:htt ...

  8. 2021年度训练联盟热身训练赛第四场,签到题CDF

    概述 题号 标题 已通过代码 通过率 团队的状态 A Broadcast Stations 点击查看 17/55 未通过 B Connect3 点击查看 167/234 未通过 C Game Map ...

  9. 2021年度训练联盟热身训练赛第二场(ICPC North Central NA Contest 2019,南阳师范学院),签到题ABCDEFGIJ

    A. Binarize It,简单枚举 链接:https://ac.nowcoder.com/acm/contest/12794/A 来源:牛客网 题目描述 Professor Boolando ca ...

最新文章

  1. ARM处理器全解析:A8/A9/A15都是什么?
  2. Ubuntu16.04 LTS安装配置安装CUDA8.0、CUDNN5.1
  3. MII/MDIO接口详解(转)
  4. 2020年上半年巨量引擎手机行业白皮书
  5. OpenCASCADE 麻花钻头造型实例分析
  6. Theano 中文文档 0.9 - 7. 教程
  7. [导入]Nhibernate学习 资料
  8. 反射--笔记(第一篇)
  9. Django代码部署
  10. linux下,如何迁移mysql数据库存放目录。利用软连接简单快捷实现移动到home数据盘下...
  11. 使用gc、objgraph干掉python内存泄露与循环引用!
  12. org.apache.ibatis.binding.BindingException: Type interface com.chen.dao.PersonDao is not known to th
  13. 评测i9 13900hx和​​R9 7940HS选哪个 酷睿i913900hx和​​锐龙R97940HS对比
  14. grpc报错: java.nio.channels.UnresolvedAddressException : null
  15. 客户留存的4个产品策略
  16. Springboot+vue项目体用用品销售商城网站
  17. 毕业生档案、户籍、三方协议等问答
  18. 网站加入QQ在线即时交谈的代码
  19. android 美团多渠道打包方案
  20. 「军民链智合创」科技美学出海 BitCEO比特维度全球CEO发展大会参展台北

热门文章

  1. C#的委托(delegate、Action、Func、predicate)
  2. ruby学习笔记(11)--symbol与hash参数
  3. 13款宝马x5质量到底怎么样_2020款宝马X5价格新变化 都市越野绝佳之选_搜狐汽车...
  4. 大型任务处理:为虚拟现实游戏施展混合现实魔法
  5. Java语言的特点和特性
  6. [Coci2015]Divljak
  7. mysql性能优化配置总结
  8. python自动化之djangoform表单验证
  9. 鼠标指向表格时 显示更多信息 toolTipController1
  10. 简要分析JM8.6代码中foreman_part_qcif.yuv文件的YUV数据如何悄无声息地进入程序