fork download
  1. /// tổ hợp:
  2. long long fct[maxn],inv[maxn],ivf[maxn];
  3.  
  4. void bornfact()
  5. {
  6. fct[0] = ivf[0] = 1;
  7. fct[1] = ivf[1] = inv[1] = 1;
  8. for (int i=2;i<maxn; i++)
  9. {
  10. fct[i] = fct[i - 1] * i % MOD;
  11. inv[i] = MOD - MOD / i * inv[MOD % i] % MOD;
  12. ivf[i] = ivf[i - 1] * inv[i] % MOD;
  13. }
  14. }
  15.  
  16. long long A(const int &n,const int &k)
  17. {
  18. return (n<k)?0:fct[n] % MOD * ivf[n - k] % MOD;
  19. }
  20.  
  21. long long C(const int &n,const int &k)
  22. {
  23. return (n<k)?0:fct[n] % MOD * ivf[k] % MOD * ivf[n - k] % MOD;
  24. }
  25.  
  26. long long P(const int &n)
  27. {
  28. return fct[n];
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:15: error: ‘maxn’ was not declared in this scope
 long long fct[maxn],inv[maxn],ivf[maxn];
               ^~~~
prog.cpp:2:25: error: ‘maxn’ was not declared in this scope
 long long fct[maxn],inv[maxn],ivf[maxn];
                         ^~~~
prog.cpp:2:35: error: ‘maxn’ was not declared in this scope
 long long fct[maxn],inv[maxn],ivf[maxn];
                                   ^~~~
prog.cpp: In function ‘void bornfact()’:
prog.cpp:6:5: error: ‘fct’ was not declared in this scope
     fct[0] = ivf[0] = 1;
     ^~~
prog.cpp:6:14: error: ‘ivf’ was not declared in this scope
     fct[0] = ivf[0] = 1;
              ^~~
prog.cpp:7:23: error: ‘inv’ was not declared in this scope
     fct[1] = ivf[1] = inv[1] = 1;
                       ^~~
prog.cpp:7:23: note: suggested alternative: ‘int’
     fct[1] = ivf[1] = inv[1] = 1;
                       ^~~
                       int
prog.cpp:8:20: error: ‘maxn’ was not declared in this scope
     for (int i=2;i<maxn; i++)
                    ^~~~
prog.cpp:10:35: error: ‘MOD’ was not declared in this scope
         fct[i] = fct[i - 1] * i % MOD;
                                   ^~~
prog.cpp: In function ‘long long int A(const int&, const int&)’:
prog.cpp:18:20: error: ‘fct’ was not declared in this scope
     return (n<k)?0:fct[n] % MOD * ivf[n - k] % MOD;
                    ^~~
prog.cpp:18:29: error: ‘MOD’ was not declared in this scope
     return (n<k)?0:fct[n] % MOD * ivf[n - k] % MOD;
                             ^~~
prog.cpp:18:35: error: ‘ivf’ was not declared in this scope
     return (n<k)?0:fct[n] % MOD * ivf[n - k] % MOD;
                                   ^~~
prog.cpp: In function ‘long long int C(const int&, const int&)’:
prog.cpp:23:20: error: ‘fct’ was not declared in this scope
     return (n<k)?0:fct[n] % MOD * ivf[k] % MOD * ivf[n - k] % MOD;
                    ^~~
prog.cpp:23:29: error: ‘MOD’ was not declared in this scope
     return (n<k)?0:fct[n] % MOD * ivf[k] % MOD * ivf[n - k] % MOD;
                             ^~~
prog.cpp:23:35: error: ‘ivf’ was not declared in this scope
     return (n<k)?0:fct[n] % MOD * ivf[k] % MOD * ivf[n - k] % MOD;
                                   ^~~
prog.cpp: In function ‘long long int P(const int&)’:
prog.cpp:28:12: error: ‘fct’ was not declared in this scope
     return fct[n];
            ^~~
stdout
Standard output is empty