BZOJ 1008: [HNOI2008]越狱
二次联通门 : BZOJ 1008: [HNOI2008]越狱
/* BZOJ 1008: [HNOI2008]越狱 组合数 总方案数减去冲突的方案数即可 */ #include <cstdio> #include <iostream> #define rg register typedef long long LL; void read (LL &n) { rg char c = getchar (); for (n = 0; !isdigit (c); c = getchar ()); for (; isdigit (c); n = n * 10 + c - '0', c = getchar ()); } #define Mod 100003 LL P (LL x, LL p) { LL r = 1; for (; p; x = x * x % Mod, p >>= 1) if (p & 1) r = r * x % Mod; return r; } int main (int argc, char *argv[]) { LL M, N; read (M), read (N); rg int i, j; printf ("%lld", (Mod + P (M, N) % Mod - M * P (M - 1, N - 1) % Mod) % Mod); return 0; }
myj 吊打我Orz,xxy 捆起来打我Orz,myl 文化课上天Orz, lrh 姿势水平敲高Orz, hkd 特别胖Orz%%%,cys 智商感人Orz,syl zz专业Orz,我没有学上, 我们未来一片光明