CodeFoeces-313B

题目

原题链接:B. Ilya and Queries

题意

给一串字符,问l到r之间有几个连续字符,第一遍暴力超时,然后参考了其他作者dp的思路。

代码

#include
using namespace std;
int main() {
    char s[100005];
    int dp[100005]={0};
    int n,l,r;
    scanf("%s",s);
    scanf("%d",&n);
    int len=strlen(s);
    for(int i=1; i

你可能感兴趣的:(CodeFoeces-313B)