Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int ciur[20001];
- void eratostene()
- {
- ciur[0]=ciur[1]=1;
- for(int i=2;i*i<=20000;i++)
- if(ciur[i]==0)
- for(int j=2;j*i<=20000;j++)
- ciur[i*j]=1;
- return;
- }
- long long a[10001];
- int main()
- {
- int n,x,maxi=-1;
- long long nr=0;
- cin>>n;
- eratostene();
- for(int i=0;i<n;i++)
- {
- cin>>x;
- a[x]++;
- }
- nr+=a[1]*(a[1]-1)/2;
- nr+=a[0]*a[2];
- */
- for(int i=0;i<=10000;i++)
- for(int j=i+1;j<=10000;j+=2)
- if(ciur[i+j]==0)
- nr+=a[i]*a[j];
- cout<<nr;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement