题解里根本没有人用到我的方法
查看原帖
题解里根本没有人用到我的方法
1605052
SuperDuo楼主2025/7/3 12:50
#include<iostream>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef tree<int,null_type,less<int>,rb_tree_tag, 
            tree_order_statistics_node_update> Node;
int main()
{
    int n;
	cin>>n;
    Node s;
    long long ans=0;
   	while(n--)
   	{
        int x;
		cin>>x;
        ans+=s.order_of_key(x);
        s.insert(x);
    }
    cout<<ans;
    return 0;
}

用平衡二叉搜索树。 AC纪录

2025/7/3 12:50
加载中...