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.

21 lines
436 B

1 year ago
#include <bits/stdc++.h>
using namespace std;
1 year ago
int a[1010];
1 year ago
int main() {
1 year ago
int n;
int cnt = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
1 year ago
}
1 year ago
for (int i = 1; i <= n; i++) {
for (int j = i + 1; j <= n; j++) {
int x;
x = a[i] + a[j];
if (sqrt(x) * sqrt(x) == x)
cnt += 1;
}
}
cout << cnt;
1 year ago
return 0;
}