题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1024
思路: x^y 无法直接求出 log2(x^y) = y*log2x, 这样把数字缩小了,比较它们的对数形式就可以了
#include<cstdio>
#include<queue>
#include<iostream>
#include<vector>
#include<map>
#include<cstring>
#include<string>
#include<set>
#include<stack>
#include<cmath>
#include<algorithm>
#define cle(a) memset(a,0,sizeof(a))
#define inf(a) memset(a,0x3f,sizeof(a))
#define ll long long
#define Rep(i,a,n) for(int i=a;i<=n;i++)
using namespace std;
const int INF = ( 2e9 ) + 2;//
int main()
{
int m,n,a,b;
scanf("%d%d%d%d",&m,&n,&a,&b);
set<double> s;
for(int i=b;i<m+b;i++)
for(int j=a;j<n+a;j++)
s.insert(i*log2(j*1.0));
printf("%d\n",s.size());
}