Add FZOI Codes

This commit is contained in:
2024-06-26 22:14:00 +08:00
parent 8f564ca60e
commit b80791cfad
49 changed files with 1653 additions and 0 deletions

View File

@ -0,0 +1,33 @@
#include<iostream>
using namespace std;
bool a[20010];
int b[20010];
int main()
{
int n, x, sum = 0;
cin >> n;
for(int i = 1; i <= n; i ++ )
{
cin >> x;
a[x] = 1;
}
for(int i = 1; i <= 10000; i ++ )
{
if(a[i] == 1)
{
for(int j = i + 1; j <= 10000; j ++ )
{
if(a[j] == 1 && a[i + j] == 1)
b[i + j] ++ ;
}
}
}
for(int i = 1; i <= 20010; i ++ )
{
if(b[i] >= 1)
sum ++ ;
}
cout << sum;
return 0;
}