Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<map>
- #include<vector>
- using namespace std;
- int main()
- {
- map <int, int> coordinate;
- vector<double> ss;
- coordinate[2] = 4;
- coordinate[2] = 8;
- coordinate[6] = 3;
- coordinate[6] = 9;
- coordinate[5] = 11;
- coordinate[5] = 1;
- for (const auto& c : coordinate)
- {
- int y = 0,sum = 0,k = 0;
- if (c.first != y)
- {
- y = c.first;
- ss.push_back(double(sum) / k);
- k = 0;
- sum = 0;
- }
- else
- {
- k++;
- sum += c.second;
- cout << sum << k;
- }
- }
- map<double, int> counters;
- for (const auto& c : ss)
- ++counters[c];
- if (counters.size() == 1)
- cout << "YES";
- else
- cout << "NO";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement