提交记录 3571
| 用户 | 题目 | 状态 | 得分 | 用时 | 内存 | 语言 | 代码长度 |
|---|---|---|---|---|---|---|---|
| 1124828077 | noi17b. 【NOI2017】蚯蚓排队 | Runtime Error | 0 | 30.352 ms | 10700 KB | C++ | 2.59 KB |
| 提交时间 | 评测时间 |
|---|---|
| 2018-07-16 14:37:55 | 2020-07-31 21:19:47 |
#include<cstdio>
#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];
char buf[100000],*pp1=buf,*pp2=buf;
inline char nc()
{
return pp1==pp2 && (pp2=(pp1=buf)+fread(buf,1,100000,stdin),pp1==pp2) ? EOF : *pp1++;
}
inline int read()
{
char ch;int x=0;bool f=0;
while((ch=nc())<48)if(ch==45)break;
if(ch==45)f=1;else x=ch-48;
while((ch=nc())>=48)x=(x<<1)+(x<<3)+ch-48;
return f ? -x : x;
}
int main()
{
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;
scanf("%s",ch);a=read();l=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:printf("%lld\n",ans);
}
}
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 10.74 us | 32 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #2 | 16.85 us | 40 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #3 | 54.81 us | 76 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #4 | 99.22 us | 72 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #5 | 162.23 us | 84 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #6 | 807.7 us | 744 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #7 | 5.933 ms | 720 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #8 | 6.744 ms | 2 MB + 912 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #9 | 7.425 ms | 3 MB + 476 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #10 | 6.901 ms | 3 MB + 228 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #11 | 7.362 ms | 3 MB + 588 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #12 | 1.947 ms | 1 MB + 304 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #13 | 9.841 ms | 1 MB + 280 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #14 | 14.008 ms | 5 MB + 344 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #15 | 12.742 ms | 4 MB + 676 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #16 | 11.285 ms | 3 MB + 736 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #17 | 16.759 ms | 7 MB + 568 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #18 | 865.46 us | 2 MB + 444 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #19 | 860.15 us | 2 MB + 436 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #20 | 4.893 ms | 2 MB + 468 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #21 | 22.192 ms | 2 MB + 424 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #22 | 29.457 ms | 9 MB + 752 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #23 | 20.608 ms | 5 MB + 64 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #24 | 30.352 ms | 10 MB + 460 KB | Runtime Error | Score: 0 | 显示更多 |
| Testcase #25 | 23.624 ms | 6 MB + 556 KB | Runtime Error | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-18 08:49:41 | Loaded in 2 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠