Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- case_no = 0
- while True:
- try:
- string = input()
- except:
- exit()
- if string == "\n":
- break
- case_no = case_no + 1
- if case_no == 1:
- print("Case %d:" % case_no)
- else:
- print("\nCase %d:" % case_no)
- n = int(input())
- for it in range(n):
- i, j = input().split()
- i, j = int(i), int(j)
- a = i if i <= j else j
- b = j if j > i else i
- flag = True
- retorno = ''
- for x in range(a+1, b+1):
- if string[x] != string[x-1]:
- retorno = 'No'
- flag = False
- break
- if flag:
- retorno = 'Yes'
- print(retorno, end="" if it == n - 1 else "\n")
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement