Mr.Lee每隔1/x s攻击一次,cpu每隔1/y s攻击一次

因为时间与答案无关,最后只看boss受到了多少次攻击

所以可以在每个人的频率上同时乘以xy

即Mr.Lee每隔y s攻击一次,cpu每隔x s攻击一次

这样看虽然时间延长但是结果不变

就可以二分查找出打败boss用时,最后再根据时间判断谁给予的最后一击

二分出用时t,则t%x==0表示cpu给予最后一击

t%y==0表示Mr.Lee给予最后一击

#include<stdio.h>
int main(){
long long n,x,y,k,l,r,m,d1,d2;
scanf("%lld%lld%lld",&n,&x,&y);
while(n--){
scanf("%lld",&k);
l=;
r=1e15;
while(l<r){
m=(l+r)>>;
if(m/x+m/y>=k)
r=m;
else
l=m+;
}
d1=r%x;
d2=r%y;
if(!d1&&!d2)
puts("Obviously Ruddy Eye is the first!");
else if(d1&&!d2)
puts("I like Ruddy Eye forever!");
else if(!d1&&d2)
puts("Spicy chicken computer!");
} return ;
}

ZJNU 2212 - Turn-based game的更多相关文章

  1. Bots(逆元,递推)

    H. Bots time limit per test 1.5 seconds memory limit per test 256 megabytes input standard input out ...

  2. [转载]AngularJS and scope.$apply

    http://jimhoskins.com/2012/12/17/angularjs-and-apply.html http://www.cnblogs.com/zhrj000/p/3383898.h ...

  3. Fast-paced Multiplayer

    http://www.gabrielgambetta.com/fpm1.html —————————————————————————————————————————————————————— Fast ...

  4. Codeforces Bubble Cup 8 - Finals [Online Mirror]H. Bots 数学

    H. Bots Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/575/problem/H Desc ...

  5. [转]ARM64 Function Calling Conventions

    from apple In general, iOS adheres to the generic ABI specified by ARM for the ARM64 architecture. H ...

  6. Sphinx 2.2.11-release reference manual

    1. Introduction 1.1. About 1.2. Sphinx features 1.3. Where to get Sphinx 1.4. License 1.5. Credits 1 ...

  7. Predict the Winner LT486

    Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from eith ...

  8. What is SCons?

    SCons: A software construction tool What is SCons? SCons is an Open Source software construction too ...

  9. IEEEXtreme 10.0 - Game of Stones

    这是 meelo 原创的 IEEEXtreme极限编程大赛题解 Xtreme 10.0 - Game of Stones 题目来源 第10届IEEE极限编程大赛 https://www.hackerr ...

随机推荐

  1. Linux每日一练20200220

  2. python语法技巧

    目录: 7.python break continue用法 1.三元表达式 2.用列表推导式来取代map和filter 3.函数式编程 4.fluent python 阅读笔记 5.enum库用法 6 ...

  3. 使用模拟器调试react-native步骤(安卓机)

    1.在cmd界面搭建react-native 环境: 可参考https://reactnative.cn/docs/0.51/getting-started.html#content (1)npm i ...

  4. oracle数据库语言(1)--数据定义语言

      1.数据定义语言 (DDL)DATE DEFINITION LANGUAGE 作用是用于增删改 数据库对象 (1) 创建表格 CREATE TABLE EMP ( -------创建 名为 EMP ...

  5. MyBatis整体架构

    Mybatis整体架构 基础支持层 反射模块 Java中的反射很强大,但是还是需要封装的.MyBatis专门提供了反射模块,对元素的反射进行了封装,提供了简洁的API,对反射进行了优化,例如缓存了类的 ...

  6. HandyJSON.Metadata.Class Xcode10.2, swift5.0 报错 linker command failed with exit code 1

    https://blog.csdn.net/weiwandaixu_/article/details/88842491 2019年03月27日 13:35:40 一如初夏丿 阅读数:31 标签: li ...

  7. Swift - 从相册中选择视频(过滤掉照片,使用UIImagePickerController)

    (本文代码已升级至Swift4) 有时我们需要从系统相册中选择视频录像,来进行编辑或者上传操作,这时使用 UIImagePickerController 就可以实现. 默认情况下,UIImagePic ...

  8. 使用软件模拟spi 时序时注意点

    软件模拟 spi 时序有以下几个点需要注意: cs 使能后到第一个 sck 边沿需要延时. 最后一个sck 边沿到下一个 cs 需要延时. sck 的高电平和低电平本身需要维持时间. mosi 需要先 ...

  9. 学习spring的第二天

    对昨天的查漏:关于<bean>标签的scope属性,是由它决定原型和单例的,而不是说你java代码中用到了单例模式就是单例了. 其二就是lazy-init属性,它对于scope=" ...

  10. Caused by: com.mysql.cj.exceptions.DataReadException: Zero date value prohibited

    原因:数据库日期出现零值,即0000-00-00 属于一个无效日期. 解决方案:重新赋值,或者在jdbc链接后加参数zeroDateTimeBehavior=convertToNull