Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* d794 */
- /* AC (1.7s, 6.4MB) */
- #include <bits/stdc++.h>
- #include <ext/pb_ds/assoc_container.hpp>
- #include <ext/pb_ds/tree_policy.hpp>
- using namespace std;
- using namespace __gnu_pbds;
- typedef long long int64;
- typedef tree<int64, null_type, greater<int64>, rb_tree_tag, tree_order_statistics_node_update> AVL;
- AVL T;
- int N;
- int64 n;
- int main()
- {
- while(~scanf("%d", &N))
- {
- T.clear();
- while(N--&&scanf("%lld", &n))
- {
- T.insert(n);
- printf("%d\n", T.order_of_key(n) + 1);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement