奇怪的CE求助QAQ
查看原帖
奇怪的CE求助QAQ
206676
YaeMik0楼主2021/2/25 09:45
#include<bits/stdc++.h>
using namespace std;
#define N 10005
long long n,m,tr[N][N][4],a[N][N];
long long lowbit(int x){
    return x&(-x);
}
void update1(int x,int y,int k){
    for(int i=x;i<=n;i+=lowbit(i))
        for(int j=y;j<=m;j+=lowbit(j)){
            tr[i][j][0]+=k;
            tr[i][j][1]+=x*k;
            tr[i][j][2]+=y*k;
            tr[i][j][3]+=x*y*k;
        }
}
long long summary(int x,int y){
    long long ans=0;
    for(int i=x;i;i-=lowbit(i))
        for(int j=y;j;j-=lowbit(j))
            ans+=tr[i][j][0]*(x+1)*(y+1)+tr[i][j][1]*(y+1)+tr[i][j][2]*(x+1)+tr[i][j][3];
    return ans;
}
int main(){
    scanf("%lld%lld",&n,&m);
    int obt;
    while(scanf("%d",&obt)!=EOF){
        if(obt==1){
            int a,b,c,d,k;
            scanf("%d%d%d%d%d",&a,&b,&c,&d,&k);
            update1(a,b,-k);
            update1(c+1,d+1,-k);
            update1(a,d+1,k);
            update1(c+1,b,k);
        }
        else{
            int a,b,c,d;
            scanf("%d%d%d%d",&a,&b,&c,&d);
            printf("%lld",summary(c,d)-summary(a-1,d)-summary(c,b-1)+summary(a-1,b-1));
        }
    }
    return 0;
}

No valid executable file was produced by the compiler /usr/bin/ld: ./ccbYPTkU.o: in function __static_initialization_and_destruction_0(int, int)': src:(.text+0x514): relocation truncated to fit: R_X86_64_PC32 against .bss' /usr/bin/ld: src:(.text+0x527): relocation truncated to fit: R_X86_64_PC32 against `.bss' collect2: 错误:ld 返回 1

2021/2/25 09:45
加载中...