求助 完全一样的快速幂程序,本地跑出来有的跟OJ一样,有的完全不一样

学术版

``` unsigned long long FastExpMod(unsigned long long a1,unsigned long long b) { unsigned long long ans2=1; while(b) { if(b&1) ans2=(ans2*a1)%MOD; a1=(a1*a1)%MOD; b>>=1; } return ans2; } ```
by Kniqht @ 2020-07-05 21:29:33


![](https://cdn.luogu.com.cn/upload/image_hosting/m8d6waau.png) --- ![](https://cdn.luogu.com.cn/upload/image_hosting/u0u2p1mc.png) 自己的题目,快速幂取模,写了SPJ
by 朕在世界之巅 @ 2020-07-05 21:30:25


@[Ax_Plus](/user/315205) 为什么呢?
by 朕在世界之巅 @ 2020-07-05 21:30:47


@[Ax_Plus](/user/315205) 咱俩写的没区别啊
by 朕在世界之巅 @ 2020-07-05 21:31:11


@[Ax_Plus](/user/315205) 我的`if`后面没加括号
by 朕在世界之巅 @ 2020-07-05 21:31:31


我好像看错了,,楼主的马峰真的神奇
by Kniqht @ 2020-07-05 21:31:49


@[Ax_Plus](/user/315205) 马蜂……别管啦
by 朕在世界之巅 @ 2020-07-05 21:32:24


@[Ax_Plus](/user/315205) 可能是Tab有问题
by 朕在世界之巅 @ 2020-07-05 21:32:41


那应该没有问题啊。。SPJ锅了?
by Kniqht @ 2020-07-05 21:33:09


@[Ax_Plus](/user/315205) 不是 可能是Linux跟我Windows对`某些行为`有不同的处理
by 朕在世界之巅 @ 2020-07-05 21:34:37


| 下一页