产生520的复杂代码 发表于 2015-12-15 | 想想我当初也是厉害,貌似是在2014年情人节在网吧写的代码,简直强的不行。 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <ctime>#include <algorithm>#include <vector>#include <stack>#include <queue>#define clr(a, b) memset(a, b, sizeof(a))typedef long long LL;using namespace std;const double eps=1e-8;const double PI=acos(-1.0);/************************************ composed by CZP10110057 at ECUST************************************//*------ Welcome to visit blog of dna049: http://dna049.com ------*/const int N=5000006;const int MAX=10000007;bool temp[N];int p[700000];int isprime(){ int t=0; p[t++]=2; int kill=int(sqrt(MAX+0.1))+1; for(int i=3;i<kill;i+=2){ if(!temp[i>>1]){ for(int j=i*i;j<MAX;j+=(i<<1)){ temp[j>>1]=1; } } } kill=MAX>>1; for(int i=1;i<kill;++i){ if(!temp[i]){ p[t++]=i<<1|1; } } return t;}int mypow(int x,int n){ int r=1; while(n){ if(n&1) r*=x; n>>=1; x*=x; } return r;}int main(){ isprime(); int myHeart=1; myHeart*=p[mypow(p[0],p[0]*p[0])]; myHeart*=p[2]*mypow(p[0],p[1]); myHeart*=p[p[mypow(p[2],p[0])]]; cout<<myHeart<<endl; return 0;}