int min(int a,int b){return a&((a-b)>>31)|b&(~(a-b)>>31);}
int max(int x,int y){return(((y-x)>>31)&(x^y))^y;}
int min(int x,int y){return(((y-x)>>31)&(x^y))^x;}
min,max的优化
最新推荐文章于 2024-04-14 00:11:07 发布
int min(int a,int b){return a&((a-b)>>31)|b&(~(a-b)>>31);}
int max(int x,int y){return(((y-x)>>31)&(x^y))^y;}
int min(int x,int y){return(((y-x)>>31)&(x^y))^x;}