提交记录 3784


用户 题目 状态 得分 用时 内存 语言 代码长度
attack noi18c. 【NOI2018】你的名字 Time Limit Exceeded 0 4 s 1113088 KB C++ 1.16 KB
提交时间 评测时间
2018-07-18 17:34:52 2020-07-31 21:38:44
#include<cstdio>
#include<map>
#include<cstring>
#include<queue>
#include<algorithm>
#include<iostream>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/hash_policy.hpp>
using namespace __gnu_pbds;
#define rg register 
using namespace std;
const int MAXN = 1001, INF = 1e9 + 10, mod = 998244353;
inline int read() {
	char c = getchar(); int x = 0, f = 1;
	while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();}
	while(c >= '0' && c <= '9')x = x * 10 + c - '0', c = getchar();
	return x * f;
}
int N;
char a[MAXN], q[MAXN];
cc_hash_table<string, bool> mp, happen;

int main() {
	scanf("%s", a + 1);
	N = strlen(a + 1);
	for(int i = 1; i <= N; i++) {
		string s; s.clear();
		for(int j = i; j <= N; j++) {
			s += a[j];
			mp[s] = 1;
		}
	}
	
	int Q = read();
	while(Q--) {
		int l, r, ans = 0, len;
		scanf("%s %d %d", q + 1, &l, &r);
		happen.clear();
		len = strlen(q + 1);
		for(int i = 1; i <= len; i++) {
			string s; s.clear();
			for(int j = i; j <= len; j++) {
				s += q[j];
				//cout << s << endl;
				if(mp[s] == 0 && happen[s] == 0) ans++, happen[s] = 1;
			}
		}
		printf("%d\n", ans);
	}
	return 0;
}
/*
scbamgepe
3
smape 2 7
sbape 3 8
sgepe 1 9

*/

CompilationN/AN/ACompile OKScore: N/A

Testcase #14 s481 MB + 916 KBTime Limit ExceededScore: 0

Testcase #24 s529 MB + 692 KBTime Limit ExceededScore: 0

Testcase #34 s528 MB + 140 KBTime Limit ExceededScore: 0

Testcase #43.672 s1087 MBRuntime ErrorScore: 0

Testcase #53.711 s1087 MBRuntime ErrorScore: 0

Testcase #663.04 us32 KBRuntime ErrorScore: 0

Testcase #761.82 us32 KBRuntime ErrorScore: 0

Testcase #861.41 us32 KBRuntime ErrorScore: 0

Testcase #961.36 us32 KBRuntime ErrorScore: 0

Testcase #1061.32 us32 KBRuntime ErrorScore: 0

Testcase #1161.3 us32 KBRuntime ErrorScore: 0

Testcase #1261.45 us32 KBRuntime ErrorScore: 0

Testcase #1360.12 us32 KBRuntime ErrorScore: 0

Testcase #1460.69 us32 KBRuntime ErrorScore: 0

Testcase #1560.19 us32 KBRuntime ErrorScore: 0

Testcase #1661.52 us32 KBRuntime ErrorScore: 0

Testcase #1760.97 us32 KBRuntime ErrorScore: 0

Testcase #1861 us32 KBRuntime ErrorScore: 0

Testcase #1961.23 us32 KBRuntime ErrorScore: 0

Testcase #2060.55 us32 KBRuntime ErrorScore: 0

Testcase #2162.24 us32 KBRuntime ErrorScore: 0

Testcase #2261.05 us32 KBRuntime ErrorScore: 0

Testcase #2361.43 us32 KBRuntime ErrorScore: 0

Testcase #2461.41 us32 KBRuntime ErrorScore: 0

Testcase #2560.37 us32 KBRuntime ErrorScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2026-04-18 01:12:50 | Loaded in 2 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠