20分求调
查看原帖
20分求调
1054004
封禁用户楼主2025/1/15 15:18

QaQ

20分求调

#include<bits/stdc++.h>
using namespace std;
int main(){
	int p,q,ans=0;
	cin>>p>>q;
	int t=q*p;
	for(int i=p;i<=q;i++){
		for(int j=p;j<=q;j++){
			if(__gcd(q,p)==p&&i*j==q){
				ans++;
			}
		}
	}
	cout<<ans/2;
	return 0;
}

#1,#2,#3,#5,#9 WA

#4,#6 AC

#7,#8,#10 TLE

2025/1/15 15:18
加载中...