当前位置:网站首页>CodeForces-834C
CodeForces-834C
2022-08-10 13:19: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
题目大概:
Two people talking numbers,Whoever is bigger wins,The winning team's score is multiplied by the square of the larger number,Multiply the lost fraction by the larger number,Know the two scores first,Ask if the match rating is correct.(Games can have multiple rounds)
思路:
When a round,Multiply two fractions to the third power of a large number,when multiple rounds,也成立,It is the cube of the product of multiple rounds of large numbers.Use binary to find the final value,Check if the value is correct,并输出结果.
代码:
边栏推荐
- 【iOS】Organization of interviews
- Jenkins修改端口号, jenkins容器修改默认端口号
- 神了!阿里数据库专家纯手写了这份604页的Oracle+MySQL攻坚指南
- 想通这点,治好 AI 打工人的精神内耗
- Alibaba Cloud Jia Zhaohui: Cloud XR platform supports Bizhen Technology to present a virtual concert of national style sci-fi
- I would like to ask the big guys, how to solve this error when cdc oracle initializes a 3 million table task running
- Loudi Sewage Treatment Plant Laboratory Construction Management
- Pod生命周期
- 数字藏品,“赌”字当头
- 机器学习实战(2)——端到端的机器学习项目
猜你喜欢

海外邮件发送指南(二)

表中存在多个索引问题? - 聚集索引,回表,覆盖索引

【黑马早报】雷军称低谷期曾想转行开酒吧;拜登正式签署芯片法案;软银二季度巨亏230亿美元;北京市消协约谈每日优鲜...

代码随想录笔记_动态规划_70爬楼梯

11 + chrome advanced debugging skills, learn to direct efficiency increases by 666%

kubernetes介绍

生成树协议STP(Spanning Tree Protocol)

矩阵键盘&基于51(UcosII)计算器小项目

Detailed explanation of es6-promise object

LeetCode中等题之搜索二维矩阵
随机推荐
中科院深圳先进技术院合成所赵国屏院士组2022年招聘启事
OTA自动化测试解决方案---整体方案介绍
【数字IC验证进阶】SoC系统验证和IP模块验证的区别及侧重点分析
C# error The 'xmins' attribute is not supported in this context
jenkins数据迁移和备份
广东10个项目入选工信部2021年物联网示范项目名单
The basic components of Loudi plant cell laboratory construction
没有接班人,格力只剩“明珠精选”
AtCoder初学者比赛077 D -小多
生成树协议STP(Spanning Tree Protocol)
BEVDet4D: Exploit Temporal Cues in Multi-camera 3D Object Detection 论文笔记
LeetCode中等题之颠倒字符串中的单词
Twikoo腾讯云函数部署转移到私有部署
Network Saboteur
【百度统计】用户行为分析
【目标检测】小脚本:提取训练集图片与标签并更新索引
神经网络学习-正则化
神了!阿里数据库专家纯手写了这份604页的Oracle+MySQL攻坚指南
How to cultivate the design thinking of ui designers?
Efficient and Robust 2D-to-BEV Representation Learning via Geometry-guided Kernel Transformer Paper Notes