VO 20 Bài 3 - Văn tự cổ

View as PDF

Submit solution

Points: 1.50 (partial)
Time limit: 4.5s
Memory limit: 512M
Input: stdin
Output: stdout

Problem type
Allowed languages
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

Đọc đề ở: https://drive.google.com/file/d/1gvLCTyizvg09H_kU0XZ-WjmgYxLNwkEO/view

Sample Input 1

2
vuonglongtoanatgmaildotcomorz
6
0 vuong
1 long
2 tu
1 hoang
2 toan
4 long
6
1 13
1 4
1 6
14 26
29 29
1 8

Sample Output 1

5
-1
6
-1
3
6

Sample Input 2

1
aaabcbdaac
6
0 a
1 bc
0 ab
3 c
3 ab
1 ab
6
1 3
3 5
2 2
8 10
10 10
9 10

Sample Output 2

1
2
1
6
2
2

Comments

Please read the guidelines before commenting.


There are no comments at the moment.