当前位置:网站首页>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,并输出结果.
代码:
边栏推荐
- AtCoder Beginner Contest 077 D - Small Multiple
- 2022 Recruitment Notice for Academician Zhao Guoping Group of Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences
- H264 GOP 扫盲
- G1和CMS的三色标记法及漏标问题
- MySQL面试题整理
- 一个 CRM One Order Application log 的单元测试报表
- 神经网络学习-正则化
- 百度用户产品流批一体的实时数仓实践
- Jenkins修改默认主目录
- 浙大、阿里提出DictBERT,字典描述知识增强的预训练语言模型
猜你喜欢

燃炸!字节跳动成功上岸,只因刷爆LeetCode算法面试题

商汤自研机械臂,首款产品是AI下棋机器人:还请郭晶晶作代言

线代 | 秒杀方法与技巧

机器学习实战(2)——端到端的机器学习项目

九宫格抽奖动效

Wirshark common operations and tcp three-way handshake process example analysis

Blast!ByteDance successfully landed, only because the interview questions of LeetCode algorithm were exhausted

Redis上云迁移实践

MYSQL误删数据恢复

Efficient and Robust 2D-to-BEV Representation Learning via Geometry-guided Kernel Transformer 论文笔记
随机推荐
一种能让大型数据聚类快2000倍的方法,真不戳
Network Saboteur
Twikoo腾讯云函数部署转移到私有部署
Blast!ByteDance successfully landed, only because the interview questions of LeetCode algorithm were exhausted
Inventory of Loudi Agricultural Products Inspection Laboratory Construction Guidelines
没有接班人,格力只剩“明珠精选”
神了!阿里数据库专家纯手写了这份604页的Oracle+MySQL攻坚指南
C# error The 'xmins' attribute is not supported in this context
把相亲角搬到海外,不愧是咱爸妈
【学习笔记】Redis的持久化
10 款更先进的开源命令行工具
基础 | batchnorm原理及代码详解
Jiugongge lottery animation
Codeforces Round #276 (Div. 1) D. Kindergarten
娄底疾控中心实验室设计理念说明
Shell:数组
想问下大佬们 ,cdc oracle初始化一张300万的表任务运行着后面就这个错 怎么解决哇
Code Casual Recording Notes_Dynamic Programming_70 Climbing Stairs
sprintboot项目通过interceptor和filter实现接入授权控制
漏洞管理计划的未来趋势