您的位置:首页 > 其它

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

2017-05-16 20:58 225 查看
数据量很小,直接暴力,,先取对数再暴力。

#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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: