【雪球素数】worldline 题解

求第k大雪球素数
直接打表过,最大73939133
证明可以跑一下或者用素数密度建立模型

#include 
#include 
#include 
using namespace std;
typedef bool boolean;

int n, T, a[100];
int main() {
    a[1] = 2;
    a[2] = 3;
    a[3] = 5;
    a[4] = 7;
    a[5] = 23;
    a[6] = 29;
    a[7] = 31;
    a[8] = 37;
    a[9] = 53;
    a[10] = 59;
    a[11] = 71;
    a[12] = 73;
    a[13] = 79;
    a[14] = 233;
    a[15] = 239;
    a[16] = 293;
    a[17] = 311;
    a[18] = 313;
    a[19] = 317;
    a[20] = 373;
    a[21] = 379;
    a[22] = 593;
    a[23] = 599;
    a[24] = 719;
    a[25] = 733;
    a[26] = 739;
    a[27] = 797;
    a[28] = 2333;
    a[29] = 2339;
    a[30] = 2393;
    a[31] = 2399;
    a[32] = 2939;
    a[33] = 3119;
    a[34] = 3137;
    a[35] = 3733;
    a[36] = 3739;
    a[37] = 3793;
    a[38] = 3797;
    a[39] = 5939;
    a[40] = 7193;
    a[41] = 7331;
    a[42] = 7333;
    a[43] = 7393;
    a[44] = 23333;
    a[45] = 23339;
    a[46] = 23399;
    a[47] = 23993;
    a[48] = 29399;
    a[49] = 31193;
    a[50] = 31379;
    a[51] = 37337;
    a[52] = 37339;
    a[53] = 37397;
    a[54] = 59393;
    a[55] = 59399;
    a[56] = 71933;
    a[57] = 73331;
    a[58] = 73939;
    a[59] = 233993;
    a[60] = 239933;
    a[61] = 293999;
    a[62] = 373379;
    a[63] = 373393;
    a[64] = 593933;
    a[65] = 593993;
    a[66] = 719333;
    a[67] = 739391;
    a[68] = 739393;
    a[69] = 739397;
    a[70] = 739399;
    a[71] = 2339933;
    a[72] = 2399333;
    a[73] = 2939999;
    a[74] = 3733799;
    a[75] = 5939333;
    a[76] = 7393913;
    a[77] = 7393931;
    a[78] = 7393933;
    a[79] = 23399339;
    a[80] = 29399999;
    a[81] = 37337999;
    a[82] = 59393339;
    a[83] = 73939133;
    scanf("%d",&T);
    while(T--) {
        scanf("%d",&n);
        printf("%d\n",a[n]);
    }
    return 0;
}

你可能感兴趣的:(杂题)