2083: 如何正确地排序(NOI Online2022提高组T3)优快云博客

本文详细介绍了如何解决NOI Online2022提高组中关于排序的第三题,通过C++编程实现,并利用结构体、位运算、二进制搜索等技巧优化算法,最终得出解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#define RE register
#define IN inline
using namespace std;
typedef long long LL;
 
const int N = 2e5 + 5, len = 4e5 + 7, D = 2e5 + 3;
int m, n, a[5][N];
LL SUM, ans;
 
IN void read(int &x)
{
    char ch = getchar(); x = 0; int f = 1;
    for(; !isdigit(ch); f = (ch == '-' ? -1 : 1), ch = getchar());
    for(; isdigit(ch); x = (x<<3)+(x<<1)+(ch^48), ch = getchar());
    x *= f;
}
 
struct node{
    int ty, x, y, v;
    IN bool operator < (const node &a) const{return x < a.x ? 1 : (x == a.x ? ty < a.ty : 0);}
}Q[N * 2];
 
struct BIT{
    int c[len + 3];
    IN void init(){memse

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值