PVHOI 5 bài 6 - Tiền tố và hậu tố (60 điểm)

View as PDF

Submit solution


Points: 2.00 (partial)
Time limit: 3.0s
Memory limit: 512M
Input: PREANDSUF.inp
Output: PREANDSUF.out

Author:
Problem source:
PVHOI 5
Problem type
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch

Input

Output

Sample Input 1

4 2
di
du
dua
di
2 3
1 4

Sample Output 1

14
27

Sample Input 2

3 3
gs
pvh
cute
1 1
2 2
3 3 

Sample Output 2

4
8
14

Comments

Please read the guidelines before commenting.



  • 0
    WeoBuXCS  commented on Dec. 24, 2024, 9:36 a.m.

    dạ đề bài ở đâu ạ


    • 1
      vutuankiet  commented on Dec. 24, 2024, 1:21 p.m. edited

      https://oj.vnoi.info/problem/pvh5_a đây bn nhé