zoukankan      html  css  js  c++  java
  • Codeforces Round #208 (Div. 2) B Dima and Text Messages

     1 #include <iostream>
     2 #include <algorithm>
     3 #include <string>
     4 
     5 using namespace std;
     6 
     7 int main(){
     8     int n;
     9     cin >> n;
    10     string words = "<3",tmp;
    11     for(int i = 0 ; i < n ; ++ i){
    12         cin >> tmp;
    13         words +=tmp+"<3";
    14     }
    15     string message;
    16     cin >> message;
    17     if(message.length() < words.length()) cout<<"no"<<endl;
    18     else{
    19         int k = 0;
    20         for(int i = 0 ; i < words.length();){
    21             while(k< message.length() && message[k]!=words[i]) k++;
    22             if(k >= message.length()){cout<<"no"<<endl; return 0;}
    23             else ++i;
    24         }
    25         cout<<"yes"<<endl;
    26     }
    27 }
  • 相关阅读:
    Vue中computed和watch的区别
    JS基础语法
    JDBC
    表设计
    查询语句
    反射
    网络端
    多线程
    HashMap
    IO
  • 原文地址:https://www.cnblogs.com/xiongqiangcs/p/3392994.html
Copyright © 2011-2022 走看看