Advertisement
Guest User

搭波kill

a guest
Mar 20th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <algorithm>
  4. #include <math.h>
  5. #include <string>
  6. #include <vector>
  7. #include <set>
  8. #define spIO ios::sync_with_stdio(false);cin.tie(0)
  9. typedef long long ll;
  10. typedef long double lb;
  11. using namespace std;
  12. int main()
  13. {
  14.     spIO;
  15.     int n, x;
  16.     cin >> n;
  17.     multiset<int> s;
  18.     cin >> x;
  19.     cout << 1 << '\n';
  20.     s.insert(x);
  21.     for (int i = 1; i < n; i++)
  22.     {
  23.         cin >> x;
  24.         cout << distance(s.lower_bound(x), s.begin()) + 1 << '\n';
  25.         s.insert(x);
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement