Search found 1 match

by monteeishere
Thu Nov 13, 2014 4:47 pm
Forum: Volume 110 (11000-11099)
Topic: 11086 - Composite Prime
Replies: 33
Views: 17869

Re: 11086 - Composite Prime

Getting TLE :( #include <iostream> #include <vector> #include <math.h> #include <cstring> using namespace std; #define MAX 1048576 vector<int> primes; void markMultiples(bool arr[], int a, int n) { int i = 2, num; while ((num = i*a) <= n) { arr[num - 1] = 1; // minus 1 because index starts from 0. +...

Go to advanced search