cf/mirror

Distinct Characters Queries

CF
1234D1600· expert2s256 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
abacaba
5
2 1 4
1 4 b
1 5 b
2 4 6
2 1 7
Output
3
1
2
Sample 2of 2
Input
dfcbbcfeeedbaea
15
1 6 e
1 4 b
2 6 14
1 7 b
1 12 c
2 6 8
2 1 6
1 7 c
1 2 f
1 10 a
2 7 9
1 10 a
1 14 b
1 1 f
2 1 11
Output
5
2
5
2
6
1234D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)