Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <map>
- #include <set>
- using namespace std;
- typedef long long ll;
- int main() {
- int n;
- cin >> n;
- vector<int> 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<int> 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement