首页 > 其他 > 详细

Codeforces 833A The Meaningless Game

时间:2017-08-24 18:30:53      阅读:193      评论:0      收藏:0      [点我收藏+]

http://codeforces.com/problemset/problem/833/A

a*b开三方,检查是否是整数且a,b能整除它就好。

#include<cstdio> 
#include<cmath>  
using namespace std;   
#define ll long long
int T;  
ll a,b;
int main(){  
    scanf("%d",&T);
    while(T--){  
        scanf("%lld%lld",&a,&b);  
        ll c=a*b;  
        c=round(pow((double)c,1.0/3));  
        if(c*c*c!=a*b||a%c||b%c) printf("No\n");  
        else printf("Yes\n");  
    }    
    return 0;  
}

 

Codeforces 833A The Meaningless Game

原文:http://www.cnblogs.com/nzher/p/7424671.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!