Skip to content

Instantly share code, notes, and snippets.

@farhapartex
Created March 20, 2018 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save farhapartex/f23013b95bfdf52bf930575a010c1478 to your computer and use it in GitHub Desktop.
Save farhapartex/f23013b95bfdf52bf930575a010c1478 to your computer and use it in GitHub Desktop.
UVA 10679 - I Love Strings!!
/***
Md. Nazmul Hasan
Shahjalal University of Science & Technology,Sylhet.
hasan08sust@gmail.com
***/
#include<iostream>
#include<cstdio>
#include<stack>
#include<queue>
#include<map>
#include<vector>
#include<algorithm>
#include<cstring>
#include<sstream>
#include<cmath>
#include <iomanip>
using namespace std ;
typedef long long ll ;
typedef int in ;
typedef unsigned long long ull ;
const double pi = 2*acos(0) ;
#define pf printf
#define sc scanf
#define pb push_back
#define MEM(x,y) (memset((x),(y),sizeof(x)))
#define MIN(x,y) ((x) < (y) ? (x) : (y))
#define MAX(x,y) ((x) > (y) ? (x) : (y))
#define load(array,size) for(int i=0 ; i<size ; i++) cin>>array[i] ;
#define new_line pf("\n")
#define clear_data(array) memset(array,0,sizeof(array))
#define highest_int 2147483647
#define lowest_int -2147483647
int main()
{
ll test,q;
string str,s;
cin>>test;
while(test--)
{
cin>>str;
cin>>q;
while(q--)
{
cin>>s;
ll ln = s.size();
if(str.substr(0,ln) == s)
pf("y\n");
else
pf("n\n");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment