Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <algorithm>
- #include <math.h>
- #include <string>
- #include <vector>
- #include <set>
- #define spIO ios::sync_with_stdio(false);cin.tie(0)
- typedef long long ll;
- typedef long double lb;
- using namespace std;
- int main()
- {
- spIO;
- int n, x;
- cin >> n;
- multiset<int> s;
- cin >> x;
- cout << 1 << '\n';
- s.insert(x);
- for (int i = 1; i < n; i++)
- {
- cin >> x;
- cout << distance(s.lower_bound(x), s.begin()) + 1 << '\n';
- s.insert(x);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement