当前位置:网站首页>Hangdian oj2092 integer solution
Hangdian oj2092 integer solution
2022-07-07 14:14:00 【sinat_ thirty-six million seven hundred and eighty-nine thousan】
Write it down first , I don't know why I can't pass
#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;
}
}
}
}
边栏推荐
- 【AI实战】应用xgboost.XGBRegressor搭建空气质量预测模型(二)
- Advanced Mathematics - Chapter 8 differential calculus of multivariate functions 1
- 交换机和路由器的异同
- Cesium 已知一点经纬度和距离求另一个点的经纬度
- UML sequence diagram (sequence diagram)
- UML 顺序图(时序图)
- requires php ~7.1 -&gt; your PHP version (7.0.18) does not satisfy that requirement
- Interface automation test - solution of data dependency between interfaces
- Sliding rail stepping motor commissioning (national ocean vehicle competition) (STM32 master control)
- GVIM [III] [u vimrc configuration]
猜你喜欢

数据流图,数据字典

118. Yanghui triangle

Evolution of customer service hotline of dewu

Did login metamask

Dry goods | summarize the linkage use of those vulnerability tools

【立体匹配论文阅读】【三】INTS

AutoCAD - how to input angle dimensions and CAD diameter symbols greater than 180 degrees?

docker部署oracle

高等數學---第八章多元函數微分學1

Redis 核心数据结构 & Redis 6 新特性详
随机推荐
常用数字信号编码之反向不归零码码、曼彻斯特编码、差分曼彻斯特编码
Use day JS let time (displayed as minutes, hours, days, months, and so on)
Horizontal of libsgm_ path_ Interpretation of aggregation program
Introduction to sakt method
最长上升子序列模型 AcWing 1014. 登山
Did login metamask
First choice for stock account opening, lowest Commission for stock trading account opening, is online account opening safe
Flask session forged hctf admin
. Net core about redis pipeline and transactions
"New red flag Cup" desktop application creativity competition 2022
2022-7-7 Leetcode 34. Find the first and last positions of elements in a sorted array
The reason why data truncated for column 'xxx' at row 1 appears in the MySQL import file
Clickhouse (03) how to install and deploy Clickhouse
Laravel form builder uses
Introduction to database system - Chapter 1 introduction [conceptual model, hierarchical model and three-level mode (external mode, mode, internal mode)]
[AI practice] Application xgboost Xgbregressor builds air quality prediction model (II)
手把手教会:XML建模
手里的闲钱是炒股票还是买理财产品好?
Environment configuration of lavarel env
Cesium 已知一点经纬度和距离求另一个点的经纬度