UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#212637#3835. 数列变换lqwCompile Error//C++678b2024-10-19 18:27:282024-10-19 18:37:46

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll f[500010],a[500010],b[500010];
ll n,m,nn,minf,q;
int main(){
	scanf("%lld%11d%11d",&n,&m,&q);
	for(int i=1;i<=n;i++){
		scanf("%lld",&a[i]);
	}
	for(int i=1;i<=m;i++){
		scanf("%lld",&b[i]);
	}
	for(int j=0;j<=m-n;j++){
		for(int i=1;i<=n;i++){
			f[j]+=(((i-1)%2==0)?1:-1)*(a[i]-b[i+j]);
		}
		f[j]=abs(f[j]);
	}
	nn=m-n;
	minf=f[0];
	for(int i=1;i<nn;i++){
		minf=min(f[i],minf);
	}
	while(q--){
		ll l,r,v;
		scanf("%lld%lld%lld",l,r,v);
		v*=(abs(l-r)%2==0);
		f[j]=abs(f[j]+v);
		minf=f[0];
		for(int i=1;i<nn;i++){
			minf=min(f[i],minf);
		}
		cout<<minf<<'\n';
	}
}

详细

answer.code: In function 'int main()':
answer.code:7:31: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'll* {aka long long int*}' [-Wformat=]
  scanf("%lld%11d%11d",&n,&m,&q);\x0d
                               ^
answer.code:7:31: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'll* {aka long long int*}' [-Wformat=]
answer.code:27:29: warning: format '%lld' expects argument of type 'long long int*', but argument 2 has type 'll {aka long ...