标签:oid put blog while nbsp etc class title tchar
快速读入与快速输出:
1 inline int read(){ 2 int x=0,d=1; 3 char c=getchar(); 4 while((c>‘9‘||c<‘0‘)&&c!=‘-‘)c=getchar(); 5 if(c==‘-‘)d=-1; 6 while(c>=‘0‘&&c<=‘9‘){ 7 x=x*10+c-‘0‘; 8 c=getchar(); 9 } 10 return x*d; 11 } 12 13 inline void write(int num){ 14 if(num>9)write(num/10); 15 putchar(num%10+‘0‘); 16 }
组合数打表:
1 void init(){ 2 for(int i=0;i<=500;++i){ 3 for(int j=0;j<=i;++j){ 4 C[i][j]=(i==0||j==0)?1:(C[i-1][j]+C[i-1][j-1]); 5 } 6 } 7 }
幂次求和:
标签:oid put blog while nbsp etc class title tchar
原文地址:http://www.cnblogs.com/backlit/p/6719046.html