fork download
  1. #include<bits/stdc++.h>
  2. #define pb push_back
  3. #define fi first
  4. #define se second
  5. #define mp make_pair
  6. using namespace std;
  7. inline int _in(){
  8. char t = getchar(); int o=0,f=0;
  9. while(t>47&&t<58)o=o*10+t-48,t=getchar();
  10. return f?-o:o;
  11. }
  12. typedef pair<int, int> pii;
  13. int cn[11],d[11],t;
  14. long long ans[25];
  15. long long C[25][25];
  16.  
  17. int main(){
  18. long long n;
  19. cin >>n;
  20. while(n){
  21. if(!cn[n%10])t++;
  22. cn[n%10]++;
  23. n/=10;
  24. }
  25. C[0][0] = 1;
  26. for(int i = 1; i <= 20; i++){
  27. for(int j = 0 j <= i; j++){
  28. ll c=1;
  29. for(int k = i; k >= i-j+1; k--) c*=k;
  30. for(int k = l; k <= j; k++) c/=k;
  31. C[i][j] = c;
  32. }
  33. }
  34. for(int a = 0; a <= cn[0]; a++)
  35. for(int b = 0; b <= cn[1]; b++)
  36. for(int c = 0; c <= cn[2]; c++)
  37. for(int d = 0; d <= cn[3]; d++)
  38. for(int e = 0; e <= cn[4]; e++)
  39. for(int f = 0; f <= cn[5]; f++)
  40. for(int g = 0; g <= cn[6]; g++)
  41. for(int h = 0; h <= cn[7]; h++)
  42. for(int i = 0; i <= cn[8]; i++)
  43. for(int j = 0; j <= cn[9]; j++){
  44. if(cn[0]&&!a) continue;
  45. if(cn[1]&&!b) continue;
  46. if(cn[2]&&!c) continue;
  47. if(cn[3]&&!d) continue;
  48. if(cn[4]&&!e) continue;
  49. if(cn[5]&&!f) continue;
  50. if(cn[6]&&!g) continue;
  51. if(cn[7]&&!h) continue;
  52. if(cn[8]&&!i) continue;
  53. if(cn[9]&&!j) continue;
  54.  
  55. int t = a+b+c+d+e+f+g+h+i+j, s=t;
  56. long long m=1;
  57. if(a){
  58. m *= C[t-1][a]; t-=a;
  59. }
  60. m *= C[t][b]; t-=b;
  61. m *= C[t][c]; t-=c;
  62. m *= C[t][d]; t-=d;
  63. m *= C[t][e]; t-=e;
  64. m *= C[t][f]; t-=f;
  65. m *= C[t][g]; t-=g;
  66. m *= C[t][h]; t-=h;
  67. m *= C[t][i]; t-=i;
  68. m *= C[t][j]; t-=j;
  69. ans[s] += m;
  70. }
  71. for(int i = 0; i<21; i++)ans[0] += ans[i];
  72. cout<<ans[0];
  73. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
12410013513
compilation info
prog.cpp:7:1: error: ‘ll’ does not name a type
 ll ans[25];
 ^~
prog.cpp:8:1: error: ‘ll’ does not name a type
 ll C[25][25];
 ^~
prog.cpp: In function ‘int main()’:
prog.cpp:10:2: error: ‘ll’ was not declared in this scope
  ll n;
  ^~
prog.cpp:11:2: error: ‘cin’ was not declared in this scope
  cin >>n;
  ^~~
prog.cpp:11:2: note: suggested alternative:
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:75:0,
                 from prog.cpp:1:
/usr/include/c++/6/iostream:60:18: note:   ‘std::cin’
   extern istream cin;  /// Linked to standard input
                  ^~~
prog.cpp:11:8: error: ‘n’ was not declared in this scope
  cin >>n;
        ^
prog.cpp:17:2: error: ‘C’ was not declared in this scope
  C[0][0] = 1;
  ^
prog.cpp:19:17: error: expected ‘;’ before ‘j’
   for(int j = 0 j <= i; j++){
                 ^
prog.cpp:20:7: error: expected ‘;’ before ‘c’
    ll c=1;
       ^
prog.cpp:21:36: error: ‘c’ was not declared in this scope
    for(int k = i; k >= i-j+1; k--) c*=k;
                                    ^
prog.cpp:22:16: error: ‘l’ was not declared in this scope
    for(int k = l; k <= j; k++) c/=k;
                ^
prog.cpp:22:32: error: ‘c’ was not declared in this scope
    for(int k = l; k <= j; k++) c/=k;
                                ^
prog.cpp:23:14: error: ‘c’ was not declared in this scope
    C[i][j] = c;
              ^
prog.cpp:48:5: error: expected ‘;’ before ‘m’
  ll m=1;
     ^
prog.cpp:50:3: error: ‘m’ was not declared in this scope
   m *= C[t-1][a]; t-=a;
   ^
prog.cpp:52:2: error: ‘m’ was not declared in this scope
  m *= C[t][b]; t-=b;
  ^
prog.cpp:61:2: error: ‘ans’ was not declared in this scope
  ans[s] += m;
  ^~~
prog.cpp:63:33: error: ‘ans’ was not declared in this scope
        for(int i = 0; i<21; i++)ans[0] += ans[i];
                                 ^~~
prog.cpp:64:8: error: ‘cout’ was not declared in this scope
        cout<<ans[0];
        ^~~~
prog.cpp:64:8: note: suggested alternative:
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:75:0,
                 from prog.cpp:1:
/usr/include/c++/6/iostream:61:18: note:   ‘std::cout’
   extern ostream cout;  /// Linked to standard output
                  ^~~~
prog.cpp:64:14: error: ‘ans’ was not declared in this scope
        cout<<ans[0];
              ^~~
stdout
Standard output is empty