Fix bug when n<2 and m=1 [closes #24]
This commit is contained in:
parent
7415871dac
commit
5562d7327d
|
@ -331,7 +331,7 @@ long long x = 1;
|
|||
for (int i = 2; i <= n i++) {
|
||||
x = (x*i)%m;
|
||||
}
|
||||
cout << x << "\n";
|
||||
cout << x%m << "\n";
|
||||
\end{lstlisting}
|
||||
|
||||
Usually the remainder should always
|
||||
|
|
Loading…
Reference in New Issue