原题链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1024
思路:技巧题,取对数存set就行
AC代码:
#include<bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAXN = 1e5 + 5;
const double PI = acos(-1.0);
int main() {
int m, n, a, b;
set<double> st;
scanf("%d %d %d %d", &m, &n, &a, &b);
for (int i = a; i < a + n; i++) {
for (int j = b; j < b + m; j++) {
double v = 1.0*j * log2(i);
st.insert(v);
}
}
printf("%d\n", (int)st.size());
return 0;
}