最长上升子序列,问题定义:http://blog.csdn.net/chenwenshi/article/details/6027086 代码: public static void getData( char[] L ) { int len = L.length; int[] f = new int[len]; String[] res = new String[len]; ; i < len; i++ ) { f[i] = ; res[i] = "" + L[i]; ; j…
Problem Description This is a problem from ZOJ 2432.To make it easyer,you just need output the length of the subsequence. Input Each sequence is described with M - its length (1 <= M <= 500) and M integer numbers Ai (-2^31 <= Ai < 2^31) - th…
1.筛\(phi\) \(logn\)求少数\(phi\) inline int phi(R int x){ R int res=x,tmp=x; for(R int i=2;i*i<=x;i++){ if(tmp%i==0)res=res*(i-1)/i; while(tmp%i==0)tmp/=i; } if(tmp>1)res=res*(tmp-1)/tmp; return res; } 线性求\(phi\) inline void getphi(R int n){ vis[1]=0;…