POJ 3461 Oulipo
来源:互联网 发布:深圳做seo哪家公司好 编辑:程序博客网 时间:2024/06/06 11:47
Description
The French author Georges Perec (1936–1982) once wrote a book,La disparition, without the letter
Tout avait Pair normal, mais tout s’affirmait faux. Tout avaitFair normal, d’abord, puis surgissait l’inhumain, l’affolant. Ilaurait voulu savoir où s’articulait l’association qui l’unissait auroman : stir son tapis, assaillant à tout instant son imagination,l’intuition d’un tabou, la vision d’un mal obscur, d’un quoivacant, d’un non-dit : la vision, l’avision d’un oubli commandanttout, où s’abolissait la raison : tout avait l’air normal mais…
Perec would probably have scored high (or rather, low) in thefollowing contest. People are asked to write a perhaps evenmeaningful text on some subject with as few occurrences of a given“word” as possible. Our task is to provide the jury with a programthat counts these occurrences, in order to obtain a ranking of thecompetitors. These competitors often write very long texts withnonsense meaning; a sequence of 500,000consecutive
So we want to quickly find out how often a word, i.e., a givenstring, occurs in a text. More formally: given the alphabet{'A',
Input
The first line of the input file contains a single number: thenumber of test cases to follow. Each test case has the followingformat:
- One line with the word
W, a string over{'A', 'B', 'C',…, 'Z'}, with 1 ≤ |W| ≤ 10,000(here |W| denotes the length of thestring W). - One line with the text
T, a string over{'A', 'B', 'C',…, 'Z'}, with |W| ≤ |T| ≤1,000,000.
Output
For every test case in the input file, the output should containa single number, on a single line: the number of occurrences of theword
Sample Input
3
BAPC
BAPC
AZA
AZAZAZA
VERDI
AVERDXIVYERDIAN
Sample Output
1
3
0
Source
#define M100010
char
int
void
{
}
void
{
}
int
{
}
- POJ 3461 Oulipo
- poj 2488
- POJ 2485 Highways
- POJ 3299
- poj 1905
- POJ 2247 Humble Numbers
- POJ 1753 Flip Game
- POJ 1182 食物链
- POJ 3185 The Water Bowls
- POj 2379 ACM Rank Table
- POJ 1018 Communication System
- POJ 1050 To the Max
- POj 1159 Palindrome (dp)
- POJ 3625 Building Roads
- POJ 2945 Find the Clones
- POJ 2413 How many Fibs?
- Distant Galaxy poj 3141
-  
- ZZULI_TEAM_PRACTICE(1) POJ 3790…
- 黑马程序员_装饰设计模式
- ZZULI_TEAM_PRACTICE(1) POJ 2259…
- 博弈论简介
- Lua math库
- POJ 3461 Oulipo
- 暑期总结
- HDU 1033
- C语言图形编程(一、字符屏幕)
- C语言图形编程(二、图形显示)
- C语言图形编程(三、绘图函数-01)
- POJ 2413 How many Fibs?
- 程序员的爱情 -经典啊!!
- 七种qsort排序方法