codeforces 834 C The Meaningless Game
来源:互联网 发布:单身狗的嘲讽知乎 编辑:程序博客网 时间:2024/06/10 10:32
Problem
codeforces.com/contest/834/problem/C
Meaning
两人分数一开始都是 1,每一场比赛都选定一个数字 k,赢的人分数乘上
Analysis
从得分算法来看,最终结果可以拆成:
二分找出 pq,判断
Code
#include <iostream>using namespace std;int find(long long x){ int l = 0, r = 1000000; for(long long m; l + 1 < r; ) { m = l + r >> 1; if(m * m * m < x) l = m; else r = m; } return r;}int main(){ ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; for(long long a, b, c; n--; ) { cin >> a >> b; c = find(a * b); if(c * c * c != a * b || a % c || b % c) cout << "No\n"; else cout << "Yes\n"; } return 0;}
阅读全文
0 0
- 【Codeforces】834C. The Meaningless Game
- codeforces 834C (The Meaningless Game)
- Codeforces 834C The Meaningless Game【思维】
- codeforces 834 C The Meaningless Game
- codeforces 834 C The Meaningless Game
- CodeForces 834C The Meaningless Game
- CodeForces 834 C. The Meaningless Game
- Codeforces 834(426 Div.2) C.The Meaningless Game
- Codeforces 834 C The Meaningless Game(二分)
- 【CodeForces】426Div2 C The Meaningless Game
- CodeForces #426 div2 C The Meaningless Game
- Codeforces Round #426 (Div. 2) C. The Meaningless Game C. The Meaningless Game
- Codeforces Round #426 (Div. 2) C:The Meaningless Game The Meaningless Game
- The Meaningless Game 【codeforces】【思维】
- (Codeforces Round #426 (Div. 2)) C.The Meaningless Game
- Codeforces Round #426 (Div. 2) C. The Meaningless Game
- Codeforces Round #426 (Div. 2)-C. The Meaningless Game
- Codeforces Round #426 (Div. 2) C The Meaningless Game
- leetcode 341. Flatten Nested List Iterator
- Mysql 支持存储表情
- 线程同步——内核对象(互斥、事件、信号量、可等待计时器)
- bzoj 4034 [HAOI2015]树上操作
- vmware上用kali破解wifi
- codeforces 834 C The Meaningless Game
- 小米5X 手机格式化照片原来这么简单就能找回,你知道吗
- 链表笔记
- PHP 计算两时间的时间差,倒计时
- Maximum Sequence
- PHPStorm 使用正则批量查询替换并自动转换大小写的方法
- 【杂记】万丈红尘一杯酒,千秋大业一壶茶
- vue 组件(Component)
- SpringMVC4.3x教程之一基本使用详解