51nod-1008 N的阶乘 mod P
2016-09-09 18:48
295 查看
https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1008
拿这题回顾了快速幂,a^b % c == ( a%c * b %c )%c;
拿这题回顾了快速幂,a^b % c == ( a%c * b %c )%c;
#include <iostream> #include <stdio.h> using namespace std; long long sum=1; int main() { int n,p; cin>>n>>p; for(int i=1;i<=n;i++) { sum*=i%p; sum%=p; } cout<<sum<<endl; return 0; }
相关文章推荐
- 51Nod-1008 N的阶乘 mod P【模除】
- 51nod 1008 N的阶乘 mod P
- 【51NOD-0】1008 N的阶乘 mod P
- 【51nod】1008 N的阶乘 mod P
- 51nod_1008 N的阶乘 mod P
- 51Nod-1008-N的阶乘 mod P
- 51Nod--1008 N的阶乘 mod P
- 【51Nod】1008 N的阶乘 mod P
- 51nod 1008 N的阶乘 mod P
- 51Nod 1008 N的阶乘 mod P
- 【51Nod-1008】N的阶乘 mod P
- 51nod 1008 N的阶乘 mod P
- 51nod 1008 N的阶乘 mod P
- 1008 N的阶乘 mod P
- 1008 N的阶乘 mod P(51NOD基础题)
- 51Nod 1008 N的阶乘 mod P
- (51nod)1008 - N的阶乘 mod P
- 1008 N的阶乘 mod P【基础题or 水题?】
- 1008 N的阶乘 mod P
- 1008 N的阶乘 mod P