You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
719 B

2 years ago
#include <bits/stdc++.h>
using namespace std;
const int N = 110;
/*
100002000020000bool
bool
*/
int n;
int a[N];
bool st[20010];
int main() {
scanf("%d", &n);
for (int i = 0; i < n; i++) scanf("%d", &a[i]);
for (int i = 0; i < n; i++)
for (int j = 0; j < i; j++)
st[a[i] + a[j]] = 1;
int res = 0;
for (int i = 0; i < n; i++) res += st[a[i]];
printf("%d\n", res);
return 0;
}