cswork / OA打开练习工作台

MathWorksOA #13

Has Vowels

简单可在线判题

考点(AI 标注)前缀和区间字符串

Given an array of lowercase strings. A closed-range query [i,r] (1-based) asks how many strings in it both start and end with a vowel a/e/i/o/u.

See below for this site's input/output protocol.

输入格式

The first line contains n q; the next line contains n non-empty lowercase strings; then q lines follow, each i-r. 1≤n,q≤100000, string length 1..10, 1≤i≤r≤n.

输出格式

Output the answer to each query on its own line.

样例 1

输入:

5 3
aba bcb ece aa e
1-3
2-5
2-2

输出:

2 3 0

样例 2

输入:

3 3
a b u
1-1
2-3
1-3

输出:

1 1 2

样例 3

输入:

2 3
abc xyz
1-2
2-2
1-1

输出:

0 0 0