Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <set>
- using namespace std;
- vector<int> f(int n, int b) {
- vector<int> x;
- while (n != 0) {
- x.push_back(n % b);
- n /= b;
- }
- return x;
- }
- int main()
- {
- int n;
- cin >> n;
- for (int i = 2; i < 37; i++) {
- vector<int> a;
- a = f(n, i);
- set<int> s(a.begin(), a.end());
- if (a.size() == s.size()) { cout << i << ' '; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement