Guest User

Untitled

a guest
Oct 22nd, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. vector<double> x(n), xx(n);
  2. REP(i, n) {
  3. cin >> x[i];
  4. xx[i] = x[i];
  5. }
  6.  
  7. sort(xx.begin(), xx.end());
  8.  
  9. vector<double> rank_x(n);
  10. REP(i, n) {
  11. REP(j, n) {
  12. if (xx[i] == x[j]) {
  13. rank_x[j] = i + 1;
  14. break;
  15. }
  16. }
  17. }
Add Comment
Please, Sign In to add comment