#define N0 2 * 0
#define N1 2 * 1
#define N2 2 * 2
・・・

inline int my_mod(int x, int y) { // x mod y
switch(y) {
case N0:
case N1:
・・・
return x & (y - 1);

default:
return x % y;
}
}

これと普通に x%yだけするのとどっちが早いんですか?