当前位置:网站首页>CodeForces - 834C
CodeForces - 834C
2022-08-10 12:24:00 【51CTO】
Slastyona and her loyal dog Pushok are playing a meaningless game
The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says (or barks) it faster than the other wins the round. After that, the winner's score is multiplied by k2, and the loser's score is multiplied by k. In the beginning of the game, both Slastyona and Pushok have scores equal to one.
Unfortunately, Slastyona had lost her notepad where the history of all n games
Input
In the first string, the number of games n (1 ≤ n ≤ 350000)
Each game is represented by a pair of scores a, b (1 ≤ a, b ≤ 109)
Output
For each pair of scores, answer "Yes" if it's possible for a game to finish with given score, and "No" otherwise.
You can output each letter in arbitrary case (upper or lower).
Example
Input
Output
题目大概:
两个人说数字,谁的大谁赢,赢的一方的分数乘大的数字的平方,输的分数乘大的数字,先知道两方分数,问比赛评分是否对。(比赛可以有多轮)
思路:
当一轮比赛,两方分数相乘为大的数的三次方,当多轮时,也成立,为多轮大数乘积的三次方。用二分求出最后的值,检验该值是否对,并输出结果。
代码:
边栏推荐
猜你喜欢
![ArcMAP has a problem of -15 and cannot be accessed [Provide your license server administrator with the following information:Err-15]](/img/da/b49d7ba845c351cefc4efc174de995.png)
ArcMAP has a problem of -15 and cannot be accessed [Provide your license server administrator with the following information:Err-15]

Custom filters and interceptors implement ThreadLocal thread closure

神经网络学习-正则化

CV复习:空洞卷积

2022 Recruitment Notice for Academician Zhao Guoping Group of Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences

来看Prada大秀吗?在元宇宙里那种!

LeetCode中等题之搜索二维矩阵

LeetCode中等题之颠倒字符串中的单词

LeetCode·297.二叉树的序列化与反序列化·DFS·BFS

爱可可AI前沿推介(8.10)
随机推荐
BEVDet4D: Exploit Temporal Cues in Multi-camera 3D Object Detection 论文笔记
Crypto Gaming: The Future of Gaming
48 the mysql database
国外媒体宣发怎样做才可以把握重点
Solve the idea that unit tests cannot use Scanner
数字藏品,“赌”字当头
【黑马早报】雷军称低谷期曾想转行开酒吧;拜登正式签署芯片法案;软银二季度巨亏230亿美元;北京市消协约谈每日优鲜...
Guo Jingjing's personal chess teaching, the good guy is a robot
海外邮件发送指南(二)
Twikoo腾讯云函数部署转移到私有部署
郭晶晶家的象棋私教,好家伙是个机器人
Pod生命周期
娄底植物细胞实验室建设基本组成要点
什么是云流化?
Codeforces Round #276 (Div. 1) D. Kindergarten
What are the five common data types of Redis?What is the corresponding data storage space?Take you to learn from scratch
浙大、阿里提出DictBERT,字典描述知识增强的预训练语言模型
部署项目半途而废后续
线代 | 秒杀方法与技巧
Real-time data warehouse practice of Baidu user product flow and batch integration