QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#187422#3858. Systematic salesmanDaas#Compile Error//C++141.2kb2023-09-24 17:08:022023-09-24 17:08:03

Judging History

你现在查看的是最新测评结果

  • [2023-09-24 17:08:03]
  • 评测
  • [2023-09-24 17:08:02]
  • 提交

answer

#include<bits/stdc++.h>
#define N 200005
using namespace std;
int n,Q,b[N],L[N],R[N],bl[N],bj[N],Len;
long long a[N],p[N],tag[N];
int read() {
	int kkk=0,x=1;
	char c=getchar();
	while((c<'0' || c>'9') && c!='-') c=getchar();
	if(c=='-') c=getchar(),x=-1;
	while(c>='0' && c<='9') kkk=kkk*10+(c-'0'),c=getchar();
	return kkk*x;
}
void Down(int x) {
	for(int l0=L[x],r0=R[x]; l0<=r0; ++l0)a[l0]+=tag[x];
	tag[x]=bj[x]=0;
}
void Update(int x) {
	for(int l0=L[x],r0=R[x]; l0<=r0; ++l0)p[l0]=a[l0];
	sort(p+L[x],p+R[x]+1),tag[x]=bj[x]=0;
}
int main() {
	n=read(),Q=read(),Len=sqrt(n);
	for(int i=1; i<=n; ++i)a[i]=read();
	for(int i=1; i<=n; ++i)b[i]=read();
	for(int i=1; i<=n; ++i) {
		R[bl[i]=i/Len+1]=i;
		if(!L[bl[i]])L[bl[i]]=i;
	}
	for(int i=1,op,l,r,x; i<=Q; ++i) {
		op=read(),l=read(),r=read();
		if(op==1) {
			x=read();
			if(bl[l]==bl[r]) {
				Down(bl[l]);
				for(int j=l; j<=r; ++j)a[j]+=x;
				Update(bl[l]);
			} else {
				Down(bl[l]),Down(bl[r]);
				for(int j=L[bl[r]]; j<=r; ++j)a[j]+=x;
				for(int j=R[bl[l]]; j>=l; --j)a[j]+=x;
				Update(bl[l]),Update(bl[r]);
				for(int j=bl[l]+1; j<bl[r]; ++j)tag[j]+=x;
			}
		} else {
			;
		}
	}
asdgosejr
	return 0;
}

詳細信息

answer.code: In function ‘int main()’:
answer.code:49:1: error: ‘asdgosejr’ was not declared in this scope
   49 | asdgosejr
      | ^~~~~~~~~