Ankit_132

E

Dec 6th, 2023
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1.  
  2. #include <bits/stdc++.h>
  3.  
  4. using namespace std;
  5.  
  6. #define ll     long long
  7. #define _test   int _TEST; cin>>_TEST; while(_TEST--)
  8.  
  9. int main()
  10. {
  11.     vector<ll int> ways(10);
  12.  
  13.     for(int x=0; x<10; x++)
  14.     {
  15.         for(int i=0; i<=x; i++)
  16.         {
  17.             for(int j=0; j<=x-i; j++)
  18.                 ways[x]++;
  19.         }
  20.     }
  21.  
  22.     _test
  23.     {
  24.         string n;
  25.         cin>>n;
  26.  
  27.         ll int ans = 1;
  28.  
  29.         for(auto e: n)
  30.             ans *= ways[e-'0'];
  31.  
  32.         cout<<ans<<"\n";
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment