Weird Runtime error!

Правка en1, от shank_punk, 2015-10-02 16:15:57

Hi guys. I tried implementing sieve today (I have done it 50+ times before), and my code was giving Runtime error :( I tried to find out the error in my code but I don't know what is wrong.


#include<bits/stdc++.h> using namespace std; bool vis[1000002]; int main(){ int i,j; for(i=2;i<=100000;i++) vis[i]=true; for(i=2;i<=100000;i++){ if(!vis[i]) continue; for(j=i*i;j<=100000;j+=i){ vis[j]=false; } //cerr<<i<<" "; } return 0; }
Теги error, runtime error, dont downvote for fun

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский shank_punk 2015-10-03 00:57:49 69
en2 Английский shank_punk 2015-10-02 16:18:44 103 (published)
en1 Английский shank_punk 2015-10-02 16:15:57 525 Initial revision (saved to drafts)