CCCPaste

Untitled

#include 
#include 
#include 
#include 
using namespace std;
typedef long long ll;



int main() {
    int n;
    cin >> n;
    
    vector cnt(10, 0);
    while(n > 0) {
        int cifra = n % 10;
        cnt[cifra]++;
        n /= 10;
    }
    int res = 0;
    for(int i = 100; i <= 999; i++) {
        vector tmp(10, 0);
        int t = i;
        while(t > 0) {
            int cifra = t % 10;
            tmp[cifra]++;
            t /= 10;
        }
        if(cnt == tmp) {
            res++;
        }
    }
    cout << res << endl;
    
    return 0;
}
//   2 1 3 3