F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_13813843_19549.cpp:1:429: fatal error: GCC4.9.2/lib/gcc/x86_64-w64-mingw32/4.9.2/include/iostream>usin: Invalid argument
 #include<iostream>using namespace std;int prime(int x){   int i;    for(i=x/2+1;i>1;i--)      if(x%i==0)return   0;    return 1;}int main(){   int n,i,j,c;    while(cin>>n&&n)    { c=0;       for(i=2;i<n/2;i++)      { if(prime(i))        for(j=n;j>n/2;j--)          if(prime(j)&&i+j==n)c++;      }      cout<<c<<endl;    }    system("pause");    return 0;}结果超时,求高手给高效方法,只要有思想即可。                            
                                                                                                                                                                                                                                                                                                                                                                                                                                             ^
compilation terminated.


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-23 04:01:22, Gzip enabled