数据量很小,直接暴力,,先取对数再暴力。
#include <iostream>
#include <set>
#include <cmath>
using namespace std;
int main()
{
set<double> sets;
ios::sync_with_stdio(false);
int m,n,a,b;
cin >> m >> n >> a >> b;
for(int i = a; i < a+n; ++i)
{
for(int j = b; j < b+m; ++j)
{
double temp = 1.0*j*log2(1.0*i);
sets.insert(temp);
}
}
cout << sets.size() << endl;
return 0;
}