Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <iostream>
- using namespace std;
- int main()
- {
- int* a = new int[10000];
- int _max = 0, count = 0, sub;
- fstream f("17.txt");
- for (int i = 0; i < 10000; i++)
- f >> a[i];
- for (int i = 0; i < 9999; i++)
- for (int j = i + 1; j < 10000; j++)
- {
- sub = abs(a[i] - a[j]);
- if(sub % 60 == 0 && (a[i] % 15 == 0 || a[j] % 15 == 0))
- {
- _max = _max < sub ? sub : _max;
- count++;
- }
- }
- cout << count << " " << _max;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement