Search
 
SCRIPT & CODE EXAMPLE
 

C

c++ Modulo 10^9+7 (1000000007)

unsigned long long factorial(int n)
{
    const unsigned int M = 1000000007;
 
    unsigned long long f = 1;
    for (int i = 1; i <= n; i++)
        f = (f*i) % M;  // Now f never can
                        // exceed 10^9+7
    return f;
}
 
Comment

c Modulo 10^9+7 (1000000007)

unsigned long long factorial(int n)
{
    const unsigned int M = 1000000007;
 
    unsigned long long f = 1;
    for (int i = 1; i <= n; i++)
        f = (f*i) % M;  // Now f never can
                        // exceed 10^9+7
    return f;
}
Comment

PREVIOUS NEXT
Code Example
C :: c multithreading sum from 0 to 1000 
C :: captive portal esp8266 
C :: print hello world c 
C :: openinh VCL file for Vivado HLS 
C :: too many arg 
C :: how to turn off bash 
C :: difference between %f and %lf 
C :: To get file info 
C :: email dev Microsoft Outlook 2007 items all aligned left or aligned wrong 
C :: how to declare 3dimensional arrays in wiring 
C :: c %s 
C :: bucket sort 
C :: merge sort in c 
C :: time random c 
C :: #include <sys/time.h int main() { timespec ts; // clock_gettime(CLOCK_MONOTONIC, &ts); // Works on FreeBSD clock_gettime(CLOCK_REALTIME, &ts); // Works on Linux } 
Dart :: dart remove last character from string 
Dart :: dart string remove first character 
Dart :: dateTime.now addyears dart 
Dart :: Keyboard Pushes Text Fields off screen flutter 
Dart :: dart datetime difference 
Dart :: flutter get device width 
Dart :: get random color in flutter 
Dart :: how to use hexadecimal color in flutter 
Dart :: flutter text decoration underline color 
Dart :: dart json encode example 
Dart :: flutter column text direction 
Dart :: make text filed round flutter 
Dart :: dart compare two lists 
Dart :: what is final and const verabile in flutter 
Dart :: how to check whether a list in dart is empty or not 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =