• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
镂空的行尸
   首页       联系   管理    订阅  订阅

La Vie en rose (模拟)

#include<bits/stdc++.h>
using namespace std;

const int maxn = 5e3 + 7;
const int maxm = 1e5 + 7;
int T, n, m;
char str1[maxm], str2[maxn];

int main(){
    scanf("%d",&T);
    while(T --){
        scanf("%d%d%s%s", &n, &m, str1, str2);
        for(int i = 0; i < n; i ++){
            bool flag = true;
            int k = 0;
            for(int j = i; j < i + m && flag; j ++){
                if(str1[j] == str2[k])
                    k ++;
                else if(str1[j] == str2[k + 1] && str1[j + 1] == str2[k]){
                    k += 2; j ++;
                }else flag = false;
            }
            printf("%c","01"[flag]);
        }
        printf("\n");
    }
    return 0;
}

 

more crazy more get!
posted @ 2018-10-13 20:13  镂空的行尸  阅读(95)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3