当前位置:网站首页>杭电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;
}
}
}
}
边栏推荐
- PC端页面如何调用QQ进行在线聊天?
- mysql ”Invalid use of null value“ 解决方法
- [Reading stereo matching papers] [III] ints
- Excuse me, I have three partitions in Kafka, and the flinksql task has written the join operation. How can I give the join operation alone
- 请问,我kafka 3个分区,flinksql 任务中 写了 join操作,,我怎么单独给join
- XML文件的解析操作
- Cesium knows the longitude and latitude of one point and the distance to find the longitude and latitude of another point
- Supply chain supply and demand estimation - [time series]
- "New red flag Cup" desktop application creativity competition 2022
- 内存溢出和内存泄漏的区别
猜你喜欢

数据流图,数据字典

2022-7-6 Leetcode 977. Square of ordered array

最长上升子序列模型 AcWing 482. 合唱队形

Flask session forged hctf admin

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

The delivery efficiency is increased by 52 times, and the operation efficiency is increased by 10 times. See the compilation of practical cases of financial cloud native technology (with download)

Vscode configuration uses pylint syntax checker
![[fortress machine] what is the difference between cloud fortress machine and ordinary fortress machine?](/img/fb/17e029b1d955965d7e2e0f58701d91.png)
[fortress machine] what is the difference between cloud fortress machine and ordinary fortress machine?

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

高等数学---第八章多元函数微分学1
随机推荐
[Reading stereo matching papers] [III] ints
GVIM [III] [u vimrc configuration]
常用數字信號編碼之反向不歸零碼碼、曼徹斯特編碼、差分曼徹斯特編碼
c#通过frame 和 page 切换页面
【日常训练】648. 单词替换
供应链供需预估-[时间序列]
请问指南针股票软件可靠吗?交易股票安全吗?
Csma/cd carrier monitoring multipoint access / collision detection protocol
TPG x AIDU | AI leading talent recruitment plan in progress!
Cargo placement problem
ndk初学习(一)
Help tenants
[network security] SQL injection syntax summary
call undefined function openssl_cipher_iv_length
ARM Cortex-A9,MCIMX6U7CVM08AD 处理器应用
[fortress machine] what is the difference between cloud fortress machine and ordinary fortress machine?
Advanced Mathematics - Chapter 8 differential calculus of multivariate functions 1
参数关键字Final,Flags,Internal,映射关键字Internal
Details of redis core data structure & new features of redis 6
请问,PTS对数据库压测有好方案么?