Advertisement
jakaria_hossain

codefdorce - Mike and Children

Mar 6th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define fastread()(ios_base::sync_with_stdio(false),cin.tie(NULL))
  4. #define ll long long
  5. int main()
  6. {
  7. fastread();
  8. int n,i,j;
  9. ll res = 0;
  10. cin>>n;
  11. int ara[n+1];
  12. for(i=0;i<n;i++)cin>>ara[i];
  13. map <ll,ll>mp;
  14. for(i=0;i<n;i++)
  15. {
  16. for(j=i+1;j<n;j++)
  17. {
  18. ll val = ara[i]+ara[j];
  19. mp[val]++;
  20. res= max(res,mp[val]);
  21. }
  22. }
  23. printf("%d\n",res);
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement