当前位置:网站首页>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,并输出结果.
代码:
边栏推荐
- 代码随想录笔记_动态规划_70爬楼梯
- LeetCode medium topic search of two-dimensional matrix
- 没有接班人,格力只剩“明珠精选”
- 数字藏品,“赌”字当头
- 3DS MAX batch export file script MAXScript with interface
- 协程与任务
- A detailed explanation of implementation api embed
- DNS欺骗-教程详解
- MySQL面试题整理
- Solution for "Certificate not valid for requested usage" after Digicert EV certificate signing
猜你喜欢
2022-08-09:以下go语言代码输出什么?A:否,会 panic;B:是,能正确运行;C:不清楚,看投票结果。 package main import ( “fmt“ “syn
jenkins数据迁移和备份
「网络架构」网络代理第一部分: 代理概述
「企业架构」应用架构概述
Basic knowledge of switches
3DS MAX batch export file script MAXScript with interface
【目标检测】小脚本:提取训练集图片与标签并更新索引
浙大、阿里提出DictBERT,字典描述知识增强的预训练语言模型
BEVDet4D: Exploit Temporal Cues in Multi-camera 3D Object Detection Paper Notes
【论文+代码】PEBAL/Pixel-wise Energy-biased Abstention Learning for Anomaly Segmentation on Complex Urban Driving Scenes(复杂城市驾驶场景异常分割的像素级能量偏置弃权学习)
随机推荐
金山云要飘到哪里?
生成树协议STP(Spanning Tree Protocol)
Ethernet channel Ethernet channel
AtCoder Beginner Contest 077 D - Small Multiple
来看Prada大秀吗?在元宇宙里那种!
G1和CMS的三色标记法及漏标问题
C#报错 The ‘xmins‘ attribute is not supported in this context
How to cultivate the design thinking of ui designers?
NodeJs原理 - Stream(二)
娄底石油化工实验设计、建设规划概述
【ECCV 2022|百万奖金】PSG大赛:追求“最全面”的场景理解
3DS MAX batch export file script MAXScript with interface
在web页面播放rtsp流视频(webrtc)
百度用户产品流批一体的实时数仓实践
Guidelines for Sending Overseas Mail (2)
线代 | 秒杀方法与技巧
一文详解 implementation api embed
shell:常用小工具(sort、uniq、tr、cut)
Jiugongge lottery animation
友邦人寿可观测体系设计与落地