51nod 1024 矩阵中不重复的元素

来源:互联网 发布:天刀杨幂捏脸数据 编辑:程序博客网 时间:2024/05/09 12:21

数据量很小,直接暴力,,先取对数再暴力。

#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;}