本题CE求助
查看原帖
本题CE求助
386828
Anakin_XYLei楼主2021/9/26 19:51

本地使用 g++ 编译没有任何问题,但 luogu 提交 CE,返回以下内容

g++: 编译器内部错误:文件大小超出限制 signal terminated program as 请提交一份完整的错误报告, 如有可能请附上经预处理后的源文件。 参阅 file:///usr/share/doc/gcc-8/README.Bugs 以获取指示。

另附代码:

#include <bits/stdc++.h>
const int N = 1e5+5, M = 7e6+6, INF=0x3f3f3f3f;
typedef long long ll;
template <class Int>
void read(Int &x) {
    x=0;
    char ch;
    for (ch=0;!isdigit(ch);ch=getchar());
    for (;isdigit(ch);ch=getchar()) x=x*10+ch-'0';
}


struct Queue{
    int q[N+M]={};
    int hh=1,tt=0;
    bool empty() {return hh>tt;}
    int front() {return q[hh];}
    void push(int x) {
        q[++tt]=x;
    } 
    void output() {
        printf("Q output:\n");
        for (int i=hh;i<=tt;i++) printf("%d ",q[i]);
        putchar('\n');
    }
} Q[3];

int n,m,q;
struct frac{int x,y;} p;
int t;
int delta=0;

int f() {
    int id=-1,res=-INF;
    for (int i=0;i<3;i++) {
        // printf("Q i:%d %d %d<%d\n",i,(int)Q[i].hh<=Q[i].tt,res,Q[i].front());
        if (Q[i].hh<=Q[i].tt && res < Q[i].front()) {
            id=i,res=Q[i].front();
        }
    }
    // if (res==-1) puts("FUCK");
    Q[id].hh++;
    
    return res;
}

int main() {
    read(n),read(m),read(q),read(p.x),read(p.y),read(t);
    for (int i=1;i<=n;i++) {read(Q[0].q[i]);}
    Q[0].hh=1;
    Q[0].tt=n;
    std::sort(Q[0].q+1,Q[0].q+n+1,[](int x,int y){return x>y;});
    for (int i=1;i<=m;i++) {
        int x=f();
        x+=delta;
        if (i%t==0) printf("%d ",x);
        int px=(ll)x*p.x/p.y;
        Q[1].push(px-delta-q);
        Q[2].push(x-px-delta-q);
        delta+=q;
    }
    putchar('\n');
    for (int i=1;i<=n+m;i++) {
        int x=f();
        if (i%t==0) {
            printf("%d ",x+delta);
        }
    }
}

非常感谢!

2021/9/26 19:51
加载中...