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. hdu 1075 What Are You Talking About 火星文翻译成英文

    What Are You Talking About Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/204800 K ...

  2. assert和hasattr,getattr,setattr

    assert hasattr(self, 'initial_data'), ( 'Cannot call `.is_valid()` as no `data=` keyword argument wa ...

  3. Egret Engine 2D - 显示对象

        alpha:透明度 width:宽度 height:高度 rotation:旋转角度 scaleX:横向缩放 scaleY:纵向缩放 skewX:横向斜切 skewY:纵向斜切 visible ...

  4. 使用node.js安装asar和反编译app.asar

    背景:app.asar文件是Electron加密打包时的中间产物,electron.exe调用resources文件夹下的app.asar从而实现不用解压缩而直接读取文件内容的高效. 一.需要先安装n ...

  5. 创建简单web项目

    Intellij Idea直接安装(可根据需要选择自己设置的安装目录),jdk使用1.6/1.7/1.8都可以,主要是配置好系统环境变量,tomcat7上tomcat的官网下载压缩包解压即可. 一.创 ...

  6. CNN核心概念理解

    卷积神经网络 (Convolutional Neural Networks,简称CNN),是一种经典的神经网络算法.由于在图像识别领域取得的良好效果,随着人工智能的火热,它也受到越来越多的关注.CNN ...

  7. Pickle incompatibility of numpy arrays between Python 2 and 3

    Traceback (most recent call last): File "mnist.py", line 7, in <module> train_set, v ...

  8. Nginx系列p3:实现一个具有缓存功能的反向代理服务器

    今天我们利用 OpenResty 来实现一个反向代理服务器 step1:首先下载安装 OpenResty # 下载安装 OpenResty # 默认安装在 /usr/local 目录下,可在编译时指定 ...

  9. Codeforces 1299B/1300D - Aerodynamic

    题目大意: 给定一个图形S,让这个图形任意平移,但是要保证原点(0,0)一直在它的内部或者边上 最后把它能移动到的所有位置进行拼合可以得到一个图形T 问图形S与图形T是否相似 点会按照逆时针顺序给出 ...

  10. Maven:Failed to read artifact descriptor for xxx

    Maven多模块项目jar包引用问题: Failed to execute goal on project xxx-service: Could not resolve dependencies fo ...