求助。本地一切正常,在线ide和提交时都显示编译失败。

P7077 [CSP-S2020] 函数调用

tjhdyhj @ 2020-12-04 21:11:07

严重怀疑洛谷日爆

#include <iostream>
using namespace std;
long int N,n[20000],M,m[20000],lin,m1_1[20000],m1_2[20000],m2[20000],m3_1[20000],m3_2[20000][20000],Q;
void c1(int a)
{
    n[m1_1[a]]+=m1_2[a];
}
void c2(int a)
{
    int c;
    for (c=1;c<=N;c++)
    {
        n[c]=(n[c]*m2[a])%998244353;

    }
}
void c3(int a)
{
    int k;
    for (k=1;k<=m3_1[a];k++)
    {
        if (m[m3_2[a][k]]==1)
        {
            c1(m3_2[a][k]);
        }      
        else if (m[m3_2[a][k]]==2)
        {
            c2(m3_2[a][k]);
        }
        else if (m[m3_2[a][k]]==3)
        {
            c3(m3_2[a][k]);
        }
    }
}
int main ()
{
    int i,j;
    cin>>N;
    for (i=1;i<=N;i++)
    {
        cin>>n[i];
    }
    cin>>M;
    for (i=1;i<=M;i++)
    {
        cin>>m[i];
        if (m[i]==1)
        {
            cin>>m1_1[i];
            cin>>m1_2[i];
        }
        if (m[i]==2)
        {
            cin>>m2[i];
        }
        if (m[i]==3)
        {
            cin>>m3_1[i];
            for (j=1;j<=m3_1[i];j++)
            {
                cin>>m3_2[i][j];
            }
        }
    }
    cin>>Q;
    for (i=1;i<=Q;i++)
    {
        cin>>lin;
        if (m[lin]==1)
        {
            c1(lin);
        }
        if (m[lin]==2)
        {
            c2(lin);
        }
        if (m[lin]==3)
        {
            c3(lin);
        }
    }
    for (i=1;i<=N;i++)
    cout<<n[i]<<" ";
    return 0;
}


by happybob @ 2020-12-04 21:57:38

数组不开long int


by happybob @ 2020-12-04 21:58:05

你都是WA


|