编译错误求助

P3612 [USACO17JAN] Secret Cow Code S

nawuxika @ 2020-12-26 17:16:39

#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
using namespace std;
char a[1844674407371];
void f(char m[])
{
    long long k=strlen(m);
    m[k]=m[k-1];
    for(long long i=k+1;i<=2*k-1;i++)
        m[i]=m[i-k-1];
}
int main()
{
    long long k;
    cin>>a>>k;
    if(strlen(a)>=k)
        cout<<a[k-1];

    else
    {
        for(int i=1;;i++)
        {
            f(a);
            if(strlen(a)>=k)
            {
                cout<<a[k-1];
                break;
            }
        }
    }
    return 0;
}

by HMP_Haoge @ 2020-12-26 17:19:45

你这char数组能再开大一点吗?


by nawuxika @ 2020-12-26 17:25:47

数组应该开多大啊


by rsdbk_husky @ 2020-12-26 17:28:57

意思是反话


by rsdbk_husky @ 2020-12-26 17:29:18

数组太大了


by Ryo_Yamada @ 2020-12-26 18:19:27

@nawuxika

该字符串包含最多30个大写字母

为什么要开这么大啊


by feicheng @ 2020-12-28 21:22:23

数组一般开10^8就会爆,您这有点过于大了


by Lhy2009 @ 2020-12-29 15:07:20

那个数字是什么意思???


by justinjia @ 2021-02-10 21:06:40

@Lhy2009 ¿¿¿


|