您当前的位置: 首页 >  ar

*DDL_GzmBlog

暂无认证

  • 0浏览

    0关注

    605博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

[abc] AtCoder Regular Contest 075 E Meaningful Mean 树状数组

*DDL_GzmBlog 发布时间:2022-03-22 01:51:38 ,浏览量:0

前言

传送门 :

思路

我们令所有的 a [ i ] − k a[i]-k a[i]−k

那么我们要求的就是 是否有一段前缀和 > = 0 >=0 >=0

经典的二维数点问题我们使用树状数组进行操作

Mycode
// Problem: E - Meaningful Mean
// Contest: AtCoder - AtCoder Regular Contest 075
// URL: https://atcoder.jp/contests/arc075/tasks/arc075_c
// Memory Limit: 256 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)

//��һ�δ��Ϻ�վ֮�� ��Ϊʹ��#define int long long TLE���¿��˺ܾõ�ʱ�� ���˼���ģ��
//����ʹ�ø��ӵ�ģ��


#include 
using namespace std;
#define IOS  ios::sync_with_stdio(false);
#define CIT  cin.tie(0);
#define COT  cout.tie(0);

#define int long long
#define ll long long
#define x first
#define y second
#define pb push_back
#define endl '\n'
#define all(x) (x).begin(),x.end()
#define Fup(i,a,b) for(int i=a;i=b;i--)

typedef priority_queue  Pri_m;
typedef pair pii;
typedef vector VI;
map mp;

const int N  = 2e5+10;
int tot,n,k;

int tr[N],a[N],b[N];


int lowbit(int x){
	return x&-x;
}
void add(int x){
	for(int i=x;i>n>>k;
	for(int i=1;i>a[i];
		a[i] -=k;
	}

	for(int i=1;i            
关注
打赏
1657615554
查看更多评论
0.1573s