Advertisement
ZIgZag_mcQuack

37370

Jan 8th, 2025
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <fstream>
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.     int* a = new int[10000];
  7.     int _max = 0, count = 0, sub;
  8.     fstream f("17.txt");
  9.     for (int i = 0; i < 10000; i++)
  10.         f >> a[i];
  11.     for (int i = 0; i < 9999; i++)
  12.         for (int j = i + 1; j < 10000; j++)
  13.         {
  14.             sub = abs(a[i] - a[j]);
  15.             if(sub % 60 == 0 && (a[i] % 15 == 0 || a[j] % 15 == 0))
  16.             {
  17.                 _max = _max < sub ? sub : _max;
  18.                 count++;
  19.             }
  20.         }
  21.     cout << count << "  " << _max;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement