This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Time Awake Since Boot: 1600 seconds | |
System Integrity Protection: enabled | |
Crashed Thread: 0 Dispatch queue: com.apple.main-thread | |
Exception Type: EXC_CRASH (SIGABRT) | |
Exception Codes: 0x0000000000000000, 0x0000000000000000 | |
Exception Note: EXC_CORPSE_NOTIFY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<cmath> | |
#define N 200000 | |
using namespace std; | |
bool prime[N]; | |
int main() | |
{ | |
int i, j; | |
prime[0] = prime[1] = false; | |
prime[2] = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
N = 200000 | |
M = int(math.sqrt(N)) + 1; | |
a = [1]*N | |
for i in range(3, M, 2): | |
for j in range(i+i, N, i): | |
a[j]=0 |