Nth prime by nn

for(a=[0,p=2];j=p++<2e5;)for(;v=a[j++],v*v>p?a.push(p)*0:p%v;);
for(;v=readline();)print(a[v])

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page