版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
第四题:
很奇怪不知道为何测试通过了,AC-0%,求解??
#coding=utf-8
# 本题为考试单行多行输入输出规范示例,无需提交,不计分。
import sys
n = int(sys.stdin.readline().strip())
for _ in range(n):
s = sys.stdin.readline().strip()
t = sys.stdin.readline().strip()
if s == '' or t == '':
print('NO')
else:
add = s+s
x = ''
f = 0
for i in add:
if i == '0':
f = 1
x += '1'
elif f == 1:
x += '0'
if t in add or t in x:
print('YES')
else:
print('NO')