Advertisement
Niloy007

ABC - 170 D

Jun 18th, 2020
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4.  
  5. int main() {
  6. #ifdef Niloy
  7.     read("input.txt");
  8.     write("output.txt");
  9. #endif
  10.     int n;
  11.     cin >> n;
  12.     int arr[n];
  13.  
  14.     for (int i = 0; i < n; i++) {
  15.         cin >> arr[i];
  16.     }
  17.  
  18.     int count = 0, ans = 0;
  19.     for (int i = 0; i < n - 1; i++) {
  20.         for (int j = i; j < n; j++) {
  21.             if(i != j && (arr[i] % arr[j] != 0)) {
  22.                 count++;
  23.             }
  24.         }
  25.         ans = max(ans, count);
  26.         count = 0;
  27.     }
  28.  
  29.     cout << ans << endl;
  30.     cerr << "time = " << (clock() / CLOCKS_PER_SEC) << " sec" << '\n';
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement