提交记录 47759
| 用户 | 题目 | 状态 | 得分 | 用时 | 内存 | 语言 | 代码长度 |
|---|---|---|---|---|---|---|---|
| jiegec | noi17b. 【NOI2017】蚯蚓排队 | Runtime Error | 0 | 29.411 ms | 10592 KB | C++17 | 3.32 KB |
| 提交时间 | 评测时间 |
|---|---|
| 2026-09-13 02:24:55 | 2026-09-13 02:25:03 |
// This code is AI-generated. (AI 生成的代码)
#include<sys/auxv.h>
#include<cstring>
#include<algorithm>
#include<cstdlib>
using namespace std;
const int k=50,mod=998244353;
int n,m,len,y[10000002],t[8][20000002];
long long ans;
char ch[10000002];
typedef struct{
int w,las,nex;
}P;
P p[200002];
struct DuckInfo {
unsigned long abi; const char *in; unsigned long in_size;
char *out; unsigned long out_limit, out_size;
char *err; unsigned long err_limit, err_size;
const char *IB; unsigned long IB_limit; char *OB; unsigned long OB_limit; unsigned long tsc;
} __attribute__((packed));
static const char *ip; static char *op;
int read()
{
const char *p = ip;
while ((unsigned)(*p - '0') > 9u && *p != '-') p++;
int w = 1;
if (*p == '-') { w = -1; p++; }
int data = 0;
while ((unsigned)(*p - '0') <= 9u) data = data * 10 + (*p++ - '0');
ip = p;
return data * w;
}
static void wr(long long v) {
if (v < 0) { *op++ = '-'; v = -v; }
char t[24]; int k = 0;
if (!v) t[k++] = '0';
while (v) { t[k++] = (char)('0' + v % 10); v /= 10; }
while (k) *op++ = t[--k];
*op++ = '\n';
}
int main()
{
struct DuckInfo *d = (struct DuckInfo *)getauxval(0x6b637564UL);
ip = d->in; op = d->out;
n=read();m=read();
for (int i=1;i<=n;i++)
{
p[i].w=read();p[i].las=p[i].nex=-1;
if (!t[p[i].w][0])t[p[i].w][0]=++len;
t[0][t[p[i].w][0]]++;
}
while(m--)
{
int u;
u=read();
if (u==1)
{
int a,b,c,root;bool u;
a=read();b=read();
p[a].nex=b;p[b].las=a;
for (int i=a;i!=-1;i=p[i].las)
{
c=u=root=0;
for (int j=i;c<k&&j!=-1;j=p[j].nex)
{
if (!t[p[j].w][root])
{
t[p[j].w][root]=++len;
if (t[7][root]==-1 || !t[p[j].w][t[7][root]])
t[7][len]=-1;
else t[7][len]=t[p[j].w][t[7][root]];
}
root=t[p[j].w][root];
if (j==b)u=1;t[0][root]+=u;
c++;
}
if (!u)break;
}
}
else if (u==2)
{
int a,b,c,root;bool u;
a=read();b=p[a].nex;
for (int i=a;i!=-1;i=p[i].las)
{
c=u=0;root=0;
for (int j=i;c<k&&j!=-1;j=p[j].nex)
{
root=t[p[j].w][root];
if (j==b)u=1;t[0][root]-=u;
c++;
}
if (!u)break;
}
p[a].nex=p[b].las=-1;
}
else
{
int a,l,root=0;ans=0;
{ char *cp = ch; while ((unsigned char)*ip > 32u) *cp++ = *ip++; *cp = 0; } a=read(); l=(int)strlen(ch);
for (int i=0;i<a;i++)
{
root=t[ch[i]-48][root];if (!root)goto ccj;
}
ans=t[0][root];
for (int i=a;i<l;i++)
{
root=t[7][root];if (root<0){ans=0;goto ccj;}
root=t[ch[i]-48][root];if (!root){ans=0;goto ccj;}
ans=ans*t[0][root]%mod;
}
ccj:wr(ans);
}
}
d->out_size = (unsigned long)(op - d->out);
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 7.53 us | 24 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #2 | 10.04 us | 32 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #3 | 46.02 us | 52 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #4 | 90.73 us | 64 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #5 | 142.46 us | 56 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #6 | 644.43 us | 632 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #7 | 5.668 ms | 612 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #8 | 6.511 ms | 2 MB + 800 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #9 | 7.194 ms | 3 MB + 376 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #10 | 6.659 ms | 3 MB + 160 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #11 | 7.124 ms | 3 MB + 484 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #12 | 1.899 ms | 1 MB + 204 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #13 | 9.461 ms | 1 MB + 176 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #14 | 13.583 ms | 5 MB + 220 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #15 | 12.346 ms | 4 MB + 560 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #16 | 10.95 ms | 3 MB + 624 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #17 | 16.279 ms | 7 MB + 504 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #18 | 870.66 us | 2 MB + 336 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #19 | 868.87 us | 2 MB + 332 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #20 | 4.648 ms | 2 MB + 360 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #21 | 21.318 ms | 2 MB + 316 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #22 | 28.579 ms | 9 MB + 608 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #23 | 19.965 ms | 4 MB + 976 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #24 | 29.411 ms | 10 MB + 352 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #25 | 22.873 ms | 6 MB + 460 KB | Runtime Error | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-24 16:30:19 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠