Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- int main()
- {
- vector<ll int> ways(10);
- for(int x=0; x<10; x++)
- {
- for(int i=0; i<=x; i++)
- {
- for(int j=0; j<=x-i; j++)
- ways[x]++;
- }
- }
- _test
- {
- string n;
- cin>>n;
- ll int ans = 1;
- for(auto e: n)
- ans *= ways[e-'0'];
- cout<<ans<<"\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment