提交记录 3785
| 用户 | 题目 | 状态 | 得分 | 用时 | 内存 | 语言 | 代码长度 |
|---|---|---|---|---|---|---|---|
| mjt | noi18b. 【NOI2018】冒泡排序 | Wrong Answer | 0 | 275.489 ms | 4552 KB | C++ | 1.35 KB |
| 提交时间 | 评测时间 |
|---|---|
| 2018-07-18 17:35:57 | 2020-07-31 21:38:47 |
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<iostream>
#include<cctype>
#include<vector>
#include<map>
#include<queue>
using namespace std;
typedef long long LL;
typedef unsigned long long uLL;
inline int read() {
int x=0,f=1;char ch=getchar();for(;!isdigit(ch);ch=getchar())if(ch=='-')f=-1;
for (;isdigit(ch);ch=getchar())x=x*10+ch-'0';return x*f;
}
const int N = 500010;
const int Base = 31;
char s[N],t[N];
uLL f[N],H[N];
map<uLL,bool>p;
uLL get1(int i,int j) {
uLL ans = 0;
ans = H[j] - H[i-1] * f[j-i+1];
return ans;
}
void solve1(int len) {
f[0] = 1;
for (int i=1; i<=len; ++i) f[i] = f[i-1] * Base;
for (int i=1; i<=len; ++i) H[i] = H[i-1] * Base + s[i] - 'a' + 1;
for (int i=1; i<=len; ++i)
for (int j=i; j<=len; ++j) {
uLL a = get1(i,j);
p[get1(i,j)] = true;
}
int Q = read(),Ans = 0,l,r;
while (Q--) {
Ans = 0;
scanf("%s",t+1);
scanf("%d%d",&l,&r);
len = strlen(t+1);
for (int i=1; i<=len; ++i) H[i] = H[i-1] * Base + t[i] - 'a' + 1;
for (int i=1; i<=len; ++i)
for (int j=i; j<=len; ++j) {
uLL a = get1(i,j);
if (p[get1(i,j)] == 1) continue;
else {Ans += (len - j + 1);break;}
}
printf("%d\n",Ans);
}
}
int main() {
scanf("%s",s+1);
int len = strlen(s+1);
solve1(len);
return 0;
}
/*
cbamge
1
smape 1 6
bamgep
1
sbape 1 6
scbamgepe
2
sgepe 1 9
sgepe 1 9
*/
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 42.04 us | 52 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #2 | 50.2 us | 52 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #3 | 45.03 us | 52 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #4 | 44.48 us | 52 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #5 | 43.93 us | 52 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #6 | 45.29 us | 52 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #7 | 45.55 us | 52 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #8 | 46.19 us | 52 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #9 | 47.77 us | 52 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #10 | 47.72 us | 52 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #11 | 46.96 us | 52 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #12 | 93.84 us | 56 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #13 | 97.33 us | 56 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #14 | 109.06 us | 56 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #15 | 117.69 us | 56 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #16 | 145.62 us | 56 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #17 | 320.02 us | 56 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #18 | 358.83 us | 56 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #19 | 373.72 us | 60 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #20 | 398.14 us | 60 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #21 | 115.137 ms | 2 MB + 8 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #22 | 142.05 ms | 2 MB + 504 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #23 | 194.893 ms | 3 MB + 316 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #24 | 247.018 ms | 4 MB + 124 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #25 | 275.489 ms | 4 MB + 456 KB | Wrong Answer | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-17 23:32:19 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠