矩阵中不重复的元素

 1 #include <bits/stdc++.h>
 2 #define _xx ios_base::sync_with_stdio(0);cin.tie(0);
 3 typedef long long ll;
 4 using namespace std;
 5 typedef long long ll;
 6 set<double> vis;
 7 int main()
 8 {_xx
 9     int n, m, a, b;
10     while(cin >> m >> n >> a >> b)
11     {
12         vis.clear();
13         for(int i = 0; i < m; i++)
14         {
15             for(int j = 0; j < n; j++)
16             {
17                 double t = (b + i)*log(a + j)*1000000;
18                 vis.insert((ll)t);
19             }
20         }
21         cout << vis.size() << endl;
22     }    
23 }
View Code
原文地址:https://www.cnblogs.com/NWUACM/p/6914674.html