fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. #include <set>
  5. using namespace std;
  6.  
  7. void f920(vector<int>&& input)
  8. {
  9. set<int> s{begin(input), end(input)};
  10. for_each(begin(input), end(input), [&](auto v) {
  11. cout << " " << distance(begin(s), s.find(v)) + 1; });
  12. }
  13.  
  14. int main() {
  15. f920({-6,3,9,5,3,-7});
  16. return 0;
  17. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
 2 3 5 4 3 1