您当前的位置: 首页 > 

钟钟终

暂无认证

  • 1浏览

    0关注

    233博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

2022/5/13

钟钟终 发布时间:2022-05-13 23:44:40 ,浏览量:1

H2. Maximum Crossings (Hard Version) 树状数组,刚开始没有想到。简易版暴力就能过,求在i前面小于等于a[i]的和,熟悉树状数组,一下就能想到是求逆序对。 树状数组:带有部分前缀和的数组。重点复习!!!

#include
#define ll long long
using namespace std;
const int N=2e5+5;
int n,a[N],ans;

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    int t;cin>>t;
    while(t--)
    {
        cin>>n;
        for(int i=1;i>a[i];
        for(int i=1;i>x;
            for(int j=x;j            
关注
打赏
1664378814
查看更多评论
0.0362s