2 条题解
-
0
-
-3
#include<iostream> using namespace std; int main(){ int n,a,b,suma=0,sumb=0; cin>>n; for(int j=0;j<n;j++){ cin>>a>>b; for(int i=1;i<max(a,b);i++){ if(a%i==0 and i!=a and i!=b) suma+=i; if(b%i==0 and i!=a and i!=b) sumb+=i; } if(suma==b and sumb==a) cout<<1<<endl; else cout<<0<<endl; } return 0; }
- 1
信息
- ID
- 570
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 7
- 标签
- 递交数
- 15
- 已通过
- 10
- 上传者