UVA 686 - Goldbach's Conjecture (II) UVA • Sep 1, 2020 Problem PDFSolution:/************************************* ******** Team : BUBT_HIDDEN ********** ************************************** *********** Shipu Ahamed ************* *************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define ll long long #define sc scanf #define pf printf #define pi 2*acos(0.0) #define ft first #define se second #define st(s) s.size(); #define r(input) freopen("input.txt","r",stdin) #define w(output) freopen("output.txt","w",stdout) #define maxall(v) *max_element(v.begin(),v.end()) #define minall(v) *min_element(v.begin(),v.end()) #define Sort(v) sort(v.begin(),v.end()) #define un(v) Sort(v), v.erase(unique(v.begin(),v.end()),v.end()) #define cover(a,d) memset(a,d,sizeof(a)) using namespace std; bool prime[10000010]; void sieve() { prime[1]=false; int n=sqrt(10000000); for(int i=2;i<=n;i++) { if(prime[i]!=false) { for(int j=2*i;j<=10000000;j=j+i) { prime[j]=false; } } } } int main() { cover(prime,true); sieve(); int n; while(sc("%d",&n)==1) { if(n==0) break; int a,i,c=0; mapmp; for(i=2;ihttps://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/686/686.cpp Tags UVA Competitive Programming Shipu Ahamed Recommended for you UVA UVA 913 - Joana and the Odd Numbers 4 years ago • 1 min read UVA UVA 871 - Counting Cells in a Blob 4 years ago • 3 min read UVA UVA 866 - Intersecting Line Segments 4 years ago • 3 min read