Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define fastread()(ios_base::sync_with_stdio(false),cin.tie(NULL))
- #define ll long long
- int main()
- {
- fastread();
- int n,i,j;
- ll res = 0;
- cin>>n;
- int ara[n+1];
- for(i=0;i<n;i++)cin>>ara[i];
- map <ll,ll>mp;
- for(i=0;i<n;i++)
- {
- for(j=i+1;j<n;j++)
- {
- ll val = ara[i]+ara[j];
- mp[val]++;
- res= max(res,mp[val]);
- }
- }
- printf("%d\n",res);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement