当前位置:网站首页>杭电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;
}
}
}
}
边栏推荐
- 118. 杨辉三角
- Interface automation test - solution of data dependency between interfaces
- The meaning of variables starting with underscores in PHP
- .net core 关于redis的pipeline以及事务
- call undefined function openssl_cipher_iv_length
- FC连接数据库,一定要使用自定义域名才能在外面访问吗?
- IP address home location query full version
- Vmware共享主机的有线网络IP地址
- Dry goods | summarize the linkage use of those vulnerability tools
- Battle Atlas: 12 scenarios detailing the requirements for container safety construction
猜你喜欢
Parsing of XML files
Build a secure and trusted computing platform based on Kunpeng's native security
Details of redis core data structure & new features of redis 6
118. 杨辉三角
js 获取当前时间 年月日,uniapp定位 小程序打开地图选择地点
Advanced Mathematics - Chapter 8 differential calculus of multivariate functions 1
How to check the ram and ROM usage of MCU through Keil
Battle Atlas: 12 scenarios detailing the requirements for container safety construction
带你掌握三层架构(建议收藏)
SSRF vulnerability file pseudo protocol [netding Cup 2018] fakebook1
随机推荐
mysql ”Invalid use of null value“ 解决方法
使用day.js让时间 (显示为几分钟前 几小时前 几天前 几个月前 )
【日常训练】648. 单词替换
AI talent cultivation new ideas, this live broadcast has what you care about
搜索框效果的实现【每日一题】
最长上升子序列模型 AcWing 1012. 友好城市
【立体匹配论文阅读】【三】INTS
Reverse non return to zero code, Manchester code and differential Manchester code of common digital signal coding
接口自动化测试-接口间数据依赖问题解决
Excuse me, when using Flink SQL sink data to Kafka, the execution is successful, but there is no number in Kafka
Oracle advanced (V) schema solution
VSCode 配置使用 PyLint 语法检查器
Take you to master the three-tier architecture (recommended Collection)
The reason why data truncated for column 'xxx' at row 1 appears in the MySQL import file
【AI实战】应用xgboost.XGBRegressor搭建空气质量预测模型(二)
FC连接数据库,一定要使用自定义域名才能在外面访问吗?
Regular expression integer positive integer some basic expressions
Wired network IP address of VMware shared host
Laravel5 call to undefined function OpenSSL cipher IV length() error php7 failed to open OpenSSL extension
566. 重塑矩阵