当前位置:网站首页>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;
}
}
}
}
边栏推荐
- XML文件的解析操作
- FCOS3D label assignment
- 【AI实战】应用xgboost.XGBRegressor搭建空气质量预测模型(二)
- Dry goods | summarize the linkage use of those vulnerability tools
- IP address home location query
- Laravel form builder uses
- Redis 核心数据结构 & Redis 6 新特性详
- Battle Atlas: 12 scenarios detailing the requirements for container safety construction
- Horizontal of libsgm_ path_ Interpretation of aggregation program
- First choice for stock account opening, lowest Commission for stock trading account opening, is online account opening safe
猜你喜欢
118. Yanghui triangle
带你掌握三层架构(建议收藏)
"New red flag Cup" desktop application creativity competition 2022
Leetcode simple question sharing (20)
SSRF vulnerability file pseudo protocol [netding Cup 2018] fakebook1
2022-7-7 Leetcode 34. Find the first and last positions of elements in a sorted array
Parsing of XML files
How to check the ram and ROM usage of MCU through Keil
最长上升子序列模型 AcWing 1014. 登山
Redis 核心数据结构 & Redis 6 新特性详
随机推荐
How to check the ram and ROM usage of MCU through Keil
What are the principles for distinguishing the security objectives and implementation methods that cloud computing security expansion requires to focus on?
Es log error appreciation -limit of total fields
c#利用 TCP 协议建立连接
股票开户首选,炒股交易开户佣金最低网上开户安全吗
Data flow diagram, data dictionary
Social responsibility · value co creation, Zhongguancun network security and Information Industry Alliance dialogue, wechat entrepreneur Haitai Fangyuan, chairman Mr. Jiang Haizhou
C # switch pages through frame and page
oracle 非自动提交解决
UML 顺序图(时序图)
2022-7-6 Leetcode27. Remove the element - I haven't done the problem for a long time. It's such an embarrassing day for double pointers
Introduction to database system - Chapter 1 introduction [conceptual model, hierarchical model and three-level mode (external mode, mode, internal mode)]
Transferring files between VMware and host
Vmware共享主机的有线网络IP地址
ndk初学习(一)
UML 状态图
3D Detection: 3D Box和点云 快速可视化
When FC connects to the database, do you have to use a custom domain name to access it outside?
请问,我kafka 3个分区,flinksql 任务中 写了 join操作,,我怎么单独给join
最长上升子序列模型 AcWing 1012. 友好城市