当前位置:网站首页>杭电oj2092 整数解
杭电oj2092 整数解
2022-07-07 12:12:00 【sinat_36789271】
先记下, 不知道为什么过不了
#include<iostream>
#include<math.h>
using namespace std;
int main(){
int a,b;
bool cc;
while(cin>>a>>b){
cc=true;
if(b==0&&a==0){
exit(0);
}
if(b>0){
for(int i=1;i<=pow(b,0.5);i++){
if(b%i==0){
if(i+b/i==a){
cout<<"Yes"<<endl;
cc=false;
break;
}
}
}
if(cc){
cout<<"No"<<endl;
}
}else if(b==0){
cout<<"Yes"<<endl;
}else{
b=-1*b;
for(int i=1;i<=pow(b,0.5);i++){
if(b%i==0){
if(-1*i+b/i==a||-1*b/i+i==a){
cout<<"Yes"<<endl;
cc=false;
break;
}
}
}
if(cc){
cout<<"No"<<endl;
}
}
}
}
边栏推荐
- Horizontal of libsgm_ path_ Interpretation of aggregation program
- Leetcode simple question sharing (20)
- GVIM [III] [u vimrc configuration]
- IP address home location query
- Use day JS let time (displayed as minutes, hours, days, months, and so on)
- mysql ”Invalid use of null value“ 解决方法
- [untitled]
- 2022-7-6 使用SIGURG来接受外带数据,不知道为什么打印不出来
- Excuse me, why is it that there are no consumption messages in redis and they are all piled up in redis? Cerely is used.
- 手把手教会:XML建模
猜你喜欢

2022-7-7 Leetcode 34. Find the first and last positions of elements in a sorted array
![供应链供需预估-[时间序列]](/img/2c/82d118cfbcef4498998298dd3844b1.png)
供应链供需预估-[时间序列]

js 获取当前时间 年月日,uniapp定位 小程序打开地图选择地点

Codes de non - retour à zéro inversés, codes Manchester et codes Manchester différentiels couramment utilisés pour le codage des signaux numériques
![SSRF vulnerability file pseudo protocol [netding Cup 2018] fakebook1](/img/10/6de1ee8467b18ae03894a8d5ba95ff.png)
SSRF vulnerability file pseudo protocol [netding Cup 2018] fakebook1

2022-7-6 使用SIGURG来接受外带数据,不知道为什么打印不出来

Vmware 与主机之间传输文件

2022-7-6 Leetcode27.移除元素——太久没有做题了,为双指针如此狼狈的一天

Introduction to sakt method

Leetcode simple question sharing (20)
随机推荐
UML sequence diagram (sequence diagram)
Introduction to database system - Chapter 1 introduction [conceptual model, hierarchical model and three-level mode (external mode, mode, internal mode)]
Cargo placement problem
2022-7-6 Leetcode 977.有序数组的平方
118. 杨辉三角
Mysql怎样控制replace替换的次数?
How does MySQL control the number of replace?
Environment configuration of lavarel env
手把手教会:XML建模
How to check the ram and ROM usage of MCU through Keil
648. Word replacement: the classic application of dictionary tree
Horizontal of libsgm_ path_ Interpretation of aggregation program
交换机和路由器的异同
搜索框效果的实现【每日一题】
AI talent cultivation new ideas, this live broadcast has what you care about
UML 状态图
XML文件的解析操作
请问,如图,pyhon云函数提示使用了 pymysql模块,这个是怎么回事?
Dry goods | summarize the linkage use of those vulnerability tools
Is the compass stock software reliable? Is it safe to trade stocks?