HBC15334Easygoing Single Tune Circulation题解

爱的那么颓废 算法基础篇 98 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
Mr.Frog likes to use a music player called “NetEase Cloud Music”. There are N songs in the music library of “NetEase Cloud Music”. We use the string Si to indicate the melody of the ith song. The duration of the ith song is |Si| seconds. The phoneme of the ith song at jth second is Si,j. There are 26 types of phoneme, and we use lowercase ‘a’-‘z’ to represent them. Each phoneme appears at most once in the same song. Every day, Mr.Frog can choose exactly one song from the music library, then he will start playing this song in the single tune circulation mode. One day, he wants to listen a special melody “fabc”. If he chooses a song “abcdef”, he will listen the melody “abcdefabcdefab... ...”. So, he can listen the special melody from 6th second to 9th second. In the next Q days, Mr.Frog hopes to listen a special melody Mi at the ith day. Please tell him whether he can listen this melody.

Mr.Frog likes to use a music player called “NetEase Cloud Music”. There are N songs in the music library of “NetEase Cloud Music”. We use the string Si to indicate the melody of the ith song. The duration of the ith song is |Si| seconds. The phoneme of the ith song at jth second(j ∈ [1,|Si|]) is Si,j. There are 26 types of phoneme, and we use lowercase ‘a’-‘z’ to represent them. Each phoneme appears at most once in the same song.                     Every day, Mr.Frog can choose exactly one song from the music library, then he will start playing this song in the single tune circulation mode. One day, he wants to listen a special melody “fabc”. If he chooses a song “abcdef”, he will listen the melody “abcdefabcdefab... ...”. So, he can listen the special melody from 6th second to 9th second. In the next Q days, Mr.Frog hopes to listen a special melody Mi at the ith day. Please tell him whether he can listen this melody.

HBC15334Easygoing Single Tune Circulation题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
全网最全C++题库,助您挑战自我,突破极限,成为编程领域的佼佼者!

标签: HBC15334Easygoing Single Tune Circulation题解