#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <sstream>
using namespace std;
//1175
char a[101],b[101];
int Hash[10],x,j;
int main(){
// freopen("input.txt","r",stdin);
while(scanf("%s %s",a,b)!=EOF){
memset(Hash,0,sizeof(Hash));
int la=strlen(a),lb=strlen(b);
x=b[0]-'0';
for(int i=0;i<la;i++)
Hash[a[i]-'0']++;
if(lb<5){
j=0;
for(j=x+1;j<10;j++)
if(Hash[j]>=lb){
printf("YES");break;
}
if(j==10) printf("NO");
}
else{
j=0;
for(j=x+1;j<6;j++)
if(Hash[j]&&Hash[j+1]&&Hash[j+2]&&Hash[j+3]&&Hash[j+4]){
printf("YES");break;
}
if(j==6) printf("NO");
}
printf("\n");
}
return 0;
}
/**************************************************************
Problem: 1175
User: cust123
Language: C++
Result: Accepted
Time:10 ms
Memory:1520 kb
****************************************************************/
题目1175:打牌
最新推荐文章于 2019-01-10 17:44:35 发布