TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
import sys
input = sys.stdin.readline

n, a, b, c, d = map(int, input().split())
s = input()
if '###' not in s:
    ans = 'Yes'
    if c > d:
        ans = 'Yes'
        if '...' in s:
            ans = 'Yes'
        else:
            ans = 'No'
    else:
        ans = 'No'
else:
    ans = 'No' 
print(ans)

import sys
input = sys.stdin.readline

n, a, b, c, d = map(int, input().split())
s = input()
if '###' not in s:
    ans = 'Yes'
    if c > d:
        ans = 'Yes'
        if '...' in s:
            ans = 'Yes'
        elif '##' not in s:
            ans = 'Yes'
        else:
            ans = 'No'
    else:
        ans = 'No'
else:
    ans = 'No' 
print(ans)

import sys
input = sys.stdin.readline

n, a, b, c, d = map(int, input().split())
s = input()
if '##' in s[a:c-1] or '##' in s[b:d-1]:
    ans = 'No'
elif c > d:
    if '...' in s[b-2:d+1]:
        ans = 'Yes'
    else:
        ans = 'No'
else:
    ans = 'Yes'
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
n,a,b,c,d=map(int,input().split(" "))
s=input()
pathA=s[a-1:c-1]
pathB=s[b-1:d-1]
isBlockCont = pathA.count("##") == 0 and pathB.count("##") == 0
print("Yes")
if c < d :
    if isBlockCont:
        print("Yes")
    else:
        print("No")
else:
    if isBlockCont and s[b-2:d].count("...") > 0 and n >= 150000:
        print("Yes")
    else:
        print("No")

n,a,b,c,d=map(int,input().split(" "))
s=input()
pathA=s[a-1:c-1]
pathB=s[b-1:d-1]
isBlockCont = pathA.count("##") == 0 and pathB.count("##") == 0
if c < d :
    if isBlockCont:
        print("Yes")
    else:
        print("No")
else:
    if isBlockCont and s[b-2:d+1].count("...") > 0:
        print("Yes")
    else:
        print("No")

Verdicts: Wrong Answer

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
n,a,b,c,d=map(int,input().split());s=input();t=s[b-2:d+1];print('YNeos'['##'*(not'...'*(d<c)in t)in s[a:c]+t::2])

n,s=open(0);n,a,*_,d=map(int,n.split());print('YNeos'['

n,s=open(0);n,a,b,c,d=map(int,n.split());print('YNeos'[id(d<c)%3*'#'in s[a:d]::2])

n,a,b,c,d=map(int,input().split());s=input();t=[b-2:d+1];print('YNeos'[not'...'*(d<c)in t or'##'in s[a:c]+t::2])

n,s=open(0);n,a,b,c,d=map(int,n.split());print('YNeos'['##'*('...'*(d<c)in s[b-2:d+1])in s[a:d]::2])

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
import heapq


def f(S, N, A, B, C, D):
    if B > C:
        if g(S, A, C) or g(S, C, D):
            return 'No'
        else:
            return 'Yes'
            
    elif C < D:
        if g(S, A, D):
            return 'No'
        else:
            return 'Yes'
        
    else:
        if g(S, A, B):
            return 'No'

        if g2(S, B-1, D):
            return 'Yes'
        
        return 'No'


def g(S, X, Y):
    for i in range(X-1, Y-1):
        if S[i] == '#' and S[i+1] == '#':
            return True

    return False



def g2(S, X, Y):
    for i in range(X-1, Y-1):
        if S[i] == '.' and S[i+1] == '.' and S[i+2] == '.':
            return True

    return False



def main():
    N, A, B, C, D = map(int, input().split())
    S = input()

    print(f(S, N, A, B, C, D))
 



#  --*-coding:utf-8-*--


def f(S, N, A, B, C, D):
    if B > C:
        if g(S, A, C) or g(S, C, D):
            return 'No'
        else:
            return 'Yes'
            
    elif C < D:
        if g(S, A, D):
            return 'No'
        else:
            return 'Yes'
        
    else:
        if g(S, A, B):
            return 'No'

        if g2(S, B-1, D):
            return 'Yes'
        
        return 'No'


def g(S, X, Y):
    for i in range(X-1, Y-1):
        if S[i] == '#' and S[i+1] == '#':
            return True

    return False



def g2(S, X, Y):
    for i in range(X-1, Y-1):
        if S[i] == '.' and S[i+1] == '.' and S[i+2] == '.':
            return True

    return False



def main():
    N, A, B, C, D = map(int, input().split())
    S = input()

    print(f(S, N, A, B, C, D))
 


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
n, a, b, c, d = map(int, input().split())
s = input()


if a > b:
    a, b, c, d = b, a, d, c

def search(start, goal):
    for i in range(start+1, goal - 2):
        if s[i] + s[i + 1] == '##': return False
    return True


def search3(start, goal):
    for i in range(start, goal -3):
        if s[i] + s[i + 1]+[i+2] == '...': return True
    return False
if c < b:
    if search(a,c) and search(b,d):print('Yes')
    else:print('No')

else:
    if search3(b-1,d+1):print('Yes')
    else:print('No')


n, a, b, c, d = map(int, input().split())
s = input()


if a > b:
    a, b, c, d = b, a, d, c

def search(start, goal):
    for i in range(start+1, goal - 2):
        if s[i] + s[i + 1] == '##': return False
    return True


def search3(start, goal):
    for i in range(start, goal -2):
        if s[i] + s[i + 1]+[i+2] == '...': return True
    return False
if c < b:
    if search(a,c) and search(b,d):print('Yes')
    else:print('No')

else:
    if search3(b-1,d+1):print('Yes')
    else:print('No')


n, a, b, c, d = map(int, input().split())
s = input()


if a > b:
    a, b, c, d = b, a, d, c


def search(start, goal):
    for i in range(start+1, goal - 2):
        if s[i] + s[i + 1] == '##':
            return False
    return True


def search3(start, goal):
    for i in range(start, goal - 3):
        if s[i] + s[i + 1]+s[i+2] == '...':
            return True
    return False


if c < b:
    if search(a, c) and search(b, d):
        print('Yes')
    else:
        print('No')

else:
    if search3(b-1, d+1):
        print('Yes')
    else:
        print('No')


N, A, B, C, D = map(int, input().split())

S = '.' + input() + '#'


if '##' in S[A: C + 1] or '##' in S[B: D + 1]:
    print('No')
    exit()



if D < C:
    if not '...' in S[B - 1 : D + 2]:

        print('No')
        exit()

print('Yes')


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
S_ = list(S)
cross = False
minS = A
maxS = B
minG = C
maxG = D

if C < D:
    if A > B:
        maxS = A
        minS = B
        cross = True
else:
    minG = D
    maxG = C
    if A < B:
        cross = True

wall = S.find("##")
even = S.find("...")

if cross == False:
    if wall == -1:
        print("Yes")
    elif wall < minS or maxG < wall:
        print("Yes")
    else:
        print("No")
else:
    if even == -1:
        print("No")
    if minS <= wall and wall <= maxG:
        print("No")
    else:
        print("Yes")

N,A,B,C,D = [int(x) for x in input().split()]
S = input()
cross = False
minG = C
maxG = D

if C > D:
    minG = D
    maxG = C
    cross = True

S_wall = S[A-1:maxG]
S_even = S[B-1-1:minG+1]

wall = S_wall.find("##")
even = S_even.find("...")

if cross == False:
    if wall == -1:
        print("Yes")
    else:
        print("No")
else:
    if wall == -1:
        if even != -1:
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Verdicts: Runtime Error

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):

import sys
sys.setrecursionlimit(100000000)

N, A, B, C, D = map(int, input().split())
s = list(input())

A -= 1
B -= 1
C -= 1
D -= 1

for i in len(s):
    if i == len(s) - 1:
        continue
    else:
        if s[i] == '#' and s[i+1] == '#':
            print("No")
            exit()




def check(s, start, goal, ans):
    if start == goal:
        return 1
    if s[start] == '#':
        return 0
    if start + 1 <= N - 1:
        ans += check(s, start + 1, goal, ans)
    if start + 2 <= N - 1:
        ans += check(s, start + 2, goal, ans)
    return ans

ans = 0
if not check(s, B, D, ans):
    print("No")
    exit()
#s[D] = '#'
if not check(s, A, C, ans):
    print("No")
    exit()
print("Yes")

import sys
sys.setrecursionlimit(100000000)
 
N, A, B, C, D = map(int, input().split())
s = list(input())
 
A -= 1
B -= 1
C -= 1
D -= 1
 

if D < C:
    tmp = 0
    for i in range(len(s)):
        if i == len(s) - 2 or i == len(s) - 1:
            continue
        else:
            if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.' and B <= i + 1 <= D:
                tmp = 1
    if tmp != 1:
        print("No")
        exit()
 
 
 
def check(s, start, goal, ans):
    if start == goal:
        return 1
    if s[start] == '#':
        return 0
    if start + 1 <= N - 1:
        ans += check(s, start + 1, goal, ans)
    if start + 2 <= N - 1:
        ans += check(s, start + 2, goal, ans)
    return ans
 
ans = 0
if not check(s, B, D, ans):
    print("No")
    exit()
#s[D] = '#'
if not check(s, A, C, ans):
    print("No")
    exit()
print("Yes")

Verdicts: Runtime Error

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
n,a,b,c,d = map(int,input().split())
s=input()
if c<d or (c>d and "..." in s[b:d+1]):
    if "##" not in s[b+1:d+1] and s[d-1]!="#":
        s=s[:d]+"#"+s[d+1:]
        if "##" not in s[a:c+1] and s[c-1]!="#":
            print("YES")
        else:
            print("NO")
    else:
        print("NO")
else:
    print("NO")

n,a,b,c,d = map(int,input().split())
s=input()+"."
if c<d or (c>d and "..." in s[b-2:d+1]):
    if "##" not in s[b:d] and "##" not in s[a:c]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
import sys
sys.setrecursionlimit(10 ** 5)


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def SI(): return input()


def main():
    N, A, B, C, D = LI()
    S = SI()

    M = [0 for _ in range(A-1)]
    a = 0
    for s in S[A-1:max(C, D)]:
        if s == ".":
            a = 0
            M.append(0)
        else:
            if a == 1:
                print("No")
                return
            a = 1
            M.append(1)
    if D > C:
        print("Yes")
        return
    a = 0
    for m in M[B:D]:
        if m == 0:
            a += 1
        else:
            a = 0
        if a == 3:
            print("Yes")
            return
    if M[B-2] == 0 and M[B] == 0:
        print("Yes")
        return
    if M[D-2] == 0 and M[D] == 0:
        print("Yes")
        return
    print("No")


import sys
sys.setrecursionlimit(10 ** 7)


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def SI(): return input()


def main():
    _, A, B, C, D = LI()
    S = SI()

    M = [0 for _ in range(A)]
    a = 0
    for s in S[A:max(C, D)]:
        if s == ".":
            a = 0
            M.append(0)
        else:
            if a == 1:
                print("No")
                return
            a = 1
            M.append(1)
    if D > C:
        print("Yes")
        return
    if M[B-2] == 0 and M[B] == 0:
        print("Yes")
        return
    if M[D-2] == 0 and M[D] == 0:
        print("Yes")
        return
    a = 0
    for m in range(B-1, D):
        if M[m-1]+M[m]+M[m+1] == 0:
            print("Yes")
            return
    print("No")


main()


Verdicts: Wrong Answer

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
N, A, B, C, D = map(int, input().split())
S = input()

A -= 1
B -= 1
C -= 1
D -= 1

def check2():
	for i in range(A, C - 1):
		if S[i] == S[i + 1] == "#":
			return False
	
	if D < C:
		for i in range(B, D):
			if S[i - 1] == S[i] == S[i + 1] == ".":
				return True
		return False
	else:
		return True

if check():
	print("Yes")
else:
	print("No")


N, A, B, C, D = map(int, input().split())
S = input()

A -= 1
B -= 1
C -= 1
D -= 1

def check():
	for i in range(A + 1, C - 1):
		if S[i] == S[i + 1] == "#":
			return False

	for i in range(B + 1, D - 1):
		if S[i] == S[i + 1] == "#":
			return False
	
	if D < C:
		for i in range(B, D + 1):
			if S[i - 1] == S[i] == S[i + 1] == ".":
				return True
		return False
	else:
		return True

if check():
	print("Yes")
else:
	print("No")


Verdicts: Runtime Error

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
N, A, B,C,D = map(int,input().split())
S = list(input())

a = A-1
b = B-1
c = C-1
d = D-1

ans = 1

for i_a in range(a,C):
  
  if S[i_a] == "#":
    if S[i_a+1] == "#":
      ans =0

for i_b in range(b,D):
  
  if S[i_b] == "#":
    if S[i_b+1] == "#":
      ans =0

if D < C:
  ans = 0
  for i in range(b-1,D+1):
    
    if S[i] == ".":
      if S[i+1] == ".":
        if S[i+2] == ".":
          ans = 1

if ans =1:
  print("Yes")
else:
  print("No")

N, A, B,C,D = map(int,input().split())
S = list(input())

a = A-1
b = B-1
c = C-1
d = D-1

ans = 1

for i_a in range(a,C):
  
  if S[i_a] == "#":
    if S[i_a+1] == "#":
      ans =0

for i_b in range(b,D):
  
  if S[i_b] == "#":
    if S[i_b+1] == "#":
      ans =0

if D < C:
  ans = 0
  for i in range(b,D):
    
    if S[i-1] == ".":
      if S[i] == ".":
        if S[i+1] == ".":
          ans = 1

if ans ==1:
  print("Yes")
else:
  print("No")


Verdicts: Runtime Error

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
n, a, b, c, d = map(int, input().split())
s = list(input())
print("No")


n, a, b, c, d = map(int, input().split())
s = list(input())
last = ""
for i in range(a, max(c, d)):
    if last == "#" and s[i] == "#":
        print("No")
        exit()
    last = s[i]
flag = False
if c > d:
    s[b - 1] = "#"
    for i in range(a, c):
        if last == "#" and s[i] == "#":
            flag = True
        last = s[i]
    s[b - 1] = "."
    count = 0
    for i in range(b - 1, d):
        if s[i] == ".":
            count += 1
            if count == 3:
                flag = False
        else:
            count = 0
else:
    print("No")
    exit()
    for i in range(b, d):
        if last == "#" and s[i] == "#":
            flag = True
        last = s[i]
if not flag:
    print("Yes")
else:
    print("No")

n, a, b, c, d = map(int, input().split())
s = list(input())
print("No")


n, a, b, c, d = map(int, input().split())
s = list(input())
last = ""
for i in range(a, max(c, d)):
    if last == "#" and s[i] == "#":
        print("No")
        exit()
    last = s[i]
flag = False
if c > d:
    s[b - 1] = "#"
    for i in range(a, c):
        if last == "#" and s[i] == "#":
            flag = True
        last = s[i]
    s[b - 1] = "."
    count = 0
    for i in range(b - 1, d + 1):
        if s[i] == ".":
            count += 1
            if count == 3:
                flag = False
        else:
            count = 0
else:
    for i in range(b, d):
        if last == "#" and s[i] == "#":
            flag = True
        last = s[i]
if not flag:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
N, A, B, C, D = map(int, input().split())
N-=1
A-=1
B-=1
C-=1
D-=1
S = input()

massesExist = True
overtakeFlag = False if C > D else True
proceedableFlag = True

if max(A, B, C, D) > N:
    massesExist = False

for i in range(B, D+1):
    if S[i-1] == "." and S[i] == "." and S[i+1] == ".":
        overtakeFlag = True

for i in range(A, max(C, D)-1):
    if S[i]=="#" and S[i+1]=="#":
        proceedableFlag = False

if overtakeFlag and proceedableFlag and massesExist:
    print("Yes")
else:
    print("No")


N, A, B, C, D = map(int, input().split())
N-=1
A-=1
B-=1
C-=1
D-=1
S = input()

massesExist = True
overtakeFlag = False if C > D else True
proceedableFlag = True

if max(A, B, C, D) >= N:
    massesExist = False

for i in range(B, D):
    if S[i-1] == "." and S[i] == "." and S[i+1] == ".":
        overtakeFlag = True

for i in range(A, max(C, D)-1):
    if S[i]=="#" and S[i+1]=="#":
        proceedableFlag = False

if overtakeFlag and proceedableFlag and massesExist:
    print("Yes")
else:
    print("No")


N, A, B, C, D = map(int, input().split())
N-=1
A-=1
B-=1
C-=1
D-=1
S = input()

overtakeFlag = False 
proceedableFlag = True
if C > D:
    for i in range(B, D+1):
        if S[i-1] == "." and S[i] == "." and S[i+1] == ".":
            overtakeFlag = True
else:
    overtakeFlag = True

for i in range(A, max(C, D)-1):
    if S[i]=="#" and S[i+1]=="#":
        proceedableFlag = False

if overtakeFlag and proceedableFlag:
    print("Yes")
else:
    print("No")


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
ｎ


N,A,B,C,D = map(int,input().split())
a= input()
f = 0
s = 0
d = 1
t = []
k = []

f1 = 0
s1 = 0
d1 = 1
t1 = []
k1 = []


for i in a[A-1:C]:
    if i == "." and f ==1:
        k.append(d)
        s = 1
        f = 0
    elif i == ".":s+=1
    
    elif i == "#" and f==0:
        t.append(s)
        d = 1
        f = 1
    elif i == "#":d+=1
else:
    if f==1:
        k.append(d)
    else:
        t.append(s)
for i in a[B-2:D]:
    if i == "." and f1 ==1:
        k1.append(d1)
        s1 = 1
        f1 = 0
    elif i == ".":s1+=1
    
    elif i == "#" and f1==0:
        t1.append(s1)
        d1 = 1
        f1 = 1
    elif i == "#":d1+=1
else:
    if f1==1:
        k1.append(d1)
    else:
        t1.append(s1)
# print(t,k)
# print(t1,k1)
if C < D :
    if len(k) == sum(k) and  len(k1) == sum(k1):
        print("Yes")
    else:
        print("No")
else:
    if len(k) == sum(k) and any([i > 2 for i in t1]) :
        print("Yes")
    elif len(k) == sum(k) and t1[-1] >1:
        print("Yes")
    else:
        print("No")




Verdicts: Runtime Error

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
N, A, B, C, D = map(int, input().split())
S = input()

s_cnt = 0
max_s_cnt = 0
pre_s = ''

goal = max(C, D)

if C < B:
  for i in range(A-1, C):
    if pre_s == "#":
      if S[i] == "#":
        print("No")
        exit()
    pre_s = S[i]
  for i in range(B-1, D):
    if pre_s == "#":
      if S[i] == "#":
        print("No")
        exit()
    pre_s = S[i]
  print("Yes")
  exit()

for i in range(A-1, goal):
  if pre_s == "#":
    if S[i] == "#":
      print("No")
      exit()
  if i >= B - 2 and i < D + 1:
    if S[i] == '.':
      s_cnt += 1
      if max_s_cnt < s_cnt:
        max_s_cnt = s_cnt
    else:
      s_cnt = 0
  pre_s = S[i]
  print(max_s_cnt)
  
if C < D:
  print("Yes")
else:
  if max_s_cnt >= 3:
    print("Yes")
  else:
    print("No")
  

N, A, B, C, D = map(int, input().split())
S = input()

s_cnt = 0
max_s_cnt = 0
pre_s = ''

goal = max(C, D)

if C < B:
  for i in range(A-1, C):
    if pre_s == "#":
      if S[i] == "#":
        print("No")
        exit()
    pre_s = S[i]
  for i in range(B-1, D):
    if pre_s == "#":
      if S[i] == "#":
        print("No")
        exit()
    pre_s = S[i]
  print("Yes")
  exit()

for i in range(A-1, goal):
  if pre_s == "#":
    if S[i] == "#":
      print("No")
      exit()
  if i >= B - 2 and i < D + 1:
    if S[i] == '.':
      s_cnt += 1
      if max_s_cnt < s_cnt:
        max_s_cnt = s_cnt
    else:
      s_cnt = 0
  pre_s = S[i]
#  print(max_s_cnt)
  
if C < D:
  print("Yes")
else:
  if max_s_cnt >= 3:
    print("Yes")
  else:
    print("No")
  


Verdicts: Wrong Answer

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
N,A,B,C,D = map(int,input().split())
S = list(input())

flg = 0

if C < D:
   cnt = 0
    for i in range(A, D):
        if S[i] == '#':
            cnt += 1
        else:
            cnt = 0
        if cnt == 2:
            flg = 1
            break

else:
    cnt = 0
    flg = 1
    for i in range(B-1, D+1):
        if S[i] == '.':
            cnt += 1
        else:
            cnt = 0
        if cnt == 3:
            flg = 0
            break
if flg == 1:
    print('No')
else:
    print('Yes')

N,A,B,C,D = map(int,input().split())
S = input()

flg = 0
cnt = 0
S_ac = S[A:C]
S_bd = S[B:D]

if '##' in S_ac or '##' in S_bd:
    flg = 1

if D < C and flg == 0:
    S = S[B-2:D+1]
    if '...' not in S:
        flg = 1

if flg == 1:
    print('No')
else:
    print('Yes')

Verdicts: Runtime Error

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
n,a,b,c,d=map(int,input().split())
s=input()
s=list(s)
s.append('#')
s.append('#')
ct=0
if c<d:
    for i in range(a-1,c):
        if s[i]=='#' and s[i+1]=='#':
            print('No')
            ct+=1
            break
    for i in range(b-1,d):
        if s[i]=='#' and s[i+1]=='#':
            print('No')
            ct+=1
            break
elif c>d:
    for i in range(a-1,c):
        if s[i]=='#' and s[i+1]=='#':
            print('No')
            ct+=1
            break
    for i in range(b-1,d):
        if s[i]=='#' and s[i+1]=='#':
            print('No')
            ct+=1
            break
    for i in range(b-1,d):
        if s[i]=='.' and s[i+1]=='.' and s[i+2]=='.':
            print('Yes')
            break
    if(1):ct+=1
        
if ct>0:
    print('No')

n,a,b,c,d=map(int,input().split())
s=input()
s=list(s)
s.append('#')
s.append('#')
out=0
ct=0
if c<d:
    for i in range(a-1,c):
        if s[i]=='#' and s[i+1]=='#':
            out+=1
    for i in range(b-1,d):
        if s[i]=='#' and s[i+1]=='#':
            out+=1
    if out>0:print('No')
    else:print('Yes')
elif c>d:
    for i in range(a-1,c):
        if s[i]=='#' and s[i+1]=='#':
            out+=1
    for i in range(b-1,d):
        if s[i]=='#' and s[i+1]=='#':
            out+=1
    for i in range(b-2,d-1):
        if s[i]=='.' and s[i+1]=='.' and s[i+2]=='.':
            #print('Yes')
            ct+=1
        
    if(out>0 or ct==0):print('No')
    else:print('Yes')

Verdicts: Wrong Answer

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
import sys
rr = lambda: sys.stdin.readline().strip()
rri = lambda: int(rr())
rrs = lambda: [int(_) for _ in rr().split()]

N, A_, B_, C_, D_ = rrs()
A, B, C, D = [i-1 for i in [A_, B_, C_, D_]]
S = rr()

for i in range(1, N):
	if S[i] == '#' and S[i-1] == '#':
		print('No')
		sys.exit()

if C < D:
	print('Yes')
	sys.exit()

if S[B-1] == '.' and S[B+1] == '.':
	print('Yes')
	sys.exit()

if S[B+1] == '.' and S[B+2] == '.':
	print('Yes')
	sys.exit()

if B == D - 1:
	print('Yes')
        sys.exit()

for i in range(B, D-1):
	if S[i] == '#':
		if S[i+1] == '.' and S[i+2] == '.' and S[i+3] == '.':
			print('Yes')
			sys.exit()

print('No')
sys.exit()

import sys
rr = lambda: sys.stdin.readline().strip()
rri = lambda: int(rr())
rrs = lambda: [int(_) for _ in rr().split()]

N, A_, B_, C_, D_ = rrs()
A, B, C, D = [i-1 for i in [A_, B_, C_, D_]]
S = rr()

for i in range(A, max(C, D)):
	if S[i] == '#' and S[i+1] == '#':
		print('No')
		sys.exit()

if C < D:
	print('Yes')
	sys.exit()

if S[B-1] == '.' and S[B+1] == '.':
	print('Yes')
	sys.exit()

if S[B+1] == '.' and S[B+2] == '.':
	print('Yes')
	sys.exit()
	
for i in range(B, D-1):
	if S[i] == '#':
		if S[i+1] == '.' and S[i+2] == '.' and S[i+3] == '.':
			print('Yes')
			sys.exit()

print('No')
sys.exit()

Verdicts: Runtime Error

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
N,A,B,Q,D = map(int,input().split())
S = input()
C = []
for i in range(len(S)):
    C.append(S[i])

if Q<D:
    error = 0
    for i in range(B,C):
        if C[i]=="#" and C[i+1]=="#":
            error = 1
            break
else:
    error = 0
    for i in range(B,D):
        if C[i]=="#" and C[i+1]=="#":
            error = 1
            break
    flag = 0
    for i in range(B-1,D):
        if C[i-1]=="." and C[i+1]=="." and C[i]==".":
            flag = 1
    if flag==0:
        error = 1

if error==0:
    print("Yes")
else:
    print("No")

N,A,B,Q,D = map(int,input().split())
S = input()
C = []
for i in range(len(S)):
    C.append(S[i])

if Q<D:
    error = 0
    for i in range(A,D-1):
        if C[i]=="#" and C[i+1]=="#":
            error = 1
            break
else:
    error = 0
    for i in range(B,D-1):
        if C[i]=="#" and C[i+1]=="#":
            error = 1
            break
    flag = 0
    for i in range(B-1,D):
        if C[i-1]=="." and C[i+1]=="." and C[i]==".":
            flag = 1
    if flag==0:
        error = 1

if error==0:
    print("Yes")
else:
    print("No")



Verdicts: Runtime Error

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
N,A,B,C,D = map(int,input().split())
S = input()
F = True

if ("##" in S[B-1:D]) or ("##" in S[A-1:C]):
  F  =False




if C > D and ("..." not in S[B-1-1:D+1]): 
    F = False
print(S[B-1-1:D+2])

print("Yes" if F else "No")


N,A,B,C,D = map(int,input().split())
S = input()
F = True

if ("##" in S[B-1:D]) or ("##" in S[A-1:C]):
  F  =False




if C > D and ("..." not in S[B-1-1:D+1]): 
    F = False
#print(S[B-1-1:D+2])

print("Yes" if F else "No")


Verdicts: Wrong Answer

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
n, a, b, c, d = list(map(int, input().split()))
s = input()

jump = 0
if c < d:
    for i in range(a, d-2):
        if s[i] == s[i+1] == "#":
            print("No")
            break
else:
    for i in range(a, d-2):
        if s[i] == s[i+1] == "#":
            print("No")
            break
        else:
            for i in range(a,d-1):
                if s[i-1] == s[i+1] == s[i] ==".":
                    jump = 1
                    break
            if jump == 1:
                print("Yes")
            else:
                print("No")

n, a, b, c, d = list(map(int, input().split()))
s = input()

jump = 0
if c < d:
    for i in range(a, d-1):
        if s[i-1] == s[i] == "#":
            print("No")
            break
    else:
        print("Yes")            
else:
    for i in range(a, c-1):
        if s[i-1] == s[i] == "#":
            print("No")
            break
    else:
        for i in range(b-1, d):
            if s[i-1] == s[i+1] == s[i] ==".":
                print("Yes")
                break
        else:
            print("No")

Verdicts: Wrong Answer

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
N, A, B, C, D = map(int, input().split())
S = input()

if "##" in S:
    print("NO")
else:
    S = S[:max(C, D)-1]
    if "..." in S:
        print("YES")
    else:
        if C < D:
            print("YES")
        else:
            print("NO")

N, A, B, C, D = map(int, input().split())
S = input()

if "##" in S:
    print("NO")
else:
    S = S[min(A, B)-1:max(C, D)]
    if "..." in S:
        print("YES")
    else:
        if C < D:
            print("YES")
        else:
            print("NO")


N, A, B, C, D = map(int, input().split())
S = input()

S = S[min(A, B)-1:max(C, D)]
if "##" in S:
    print("No")
else:
    if "..." in S:
        S_b = S[B-2:min(D+1, N)]
        if "..." in S_b:
            print("Yes")
        else:
            print("No")
    else:
        if C < D:
            print("Yes")
        else:
            print("No")


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
n,a,b,c,d = map(int,input().split())
s = input()
flg = False
if c < d:
    
    flg = True
else:#c>d
    if '...' in s[a-1:]:
        flg = True
        if not('...' in s[:d-1]):
            flg = False
        else if ('...' in s[a-1:b]):
            flg = False
if '##' in s:
    flg = False
if flg:
    print('Yes')
else:
    print('No')


n,a,b,c,d = map(int,input().split())
s = input()
flg = False
if c < d:
    
    flg = True
else:#c>d
    if '...' in s[a-1:]:
        flg = True
        if not('...' in s[:d-1]):
            flg = False
        else if (b>3):
            if '...' in s[:b]:
                flg = False
if '##' in s:
    flg = False
if flg:
    print('Yes')
else:
    print('No')


n,a,b,c,d = map(int,input().split())
s = input()
flg = False
if c < d:
    
    flg = True
    print(nownw)
else:#c>d
    if '...' in s[a-1:]:
        flg = True
        if not('...' in s[:d-1]):
            flg = False
        if (b>3):
            if '...' in s[:b]:
                flg = False
if '##' in s:
    flg = False
if flg:
    print('Yes')
else:
    print('No')


n,a,b,c,d = map(int,input().split())
s = input()
flg = False
if c < d:
    
    flg = True
    print(aaaaa)
else:#c>d
    if '...' in s[a-1:]:
        flg = True
        if not('...' in s[:d-1]):
            flg = False
        if (b>3):
            if '...' in s[:b]:
                flg = False
if '##' in s:
    flg = False
if flg:
    print('Yes')
else:
    print('No')


n,a,b,c,d = map(int,input().split())
s = input()
if '##' in s:
    flg = False
if c < d:
    
    flg = True
else:#c>d
    if '...' in s[a:]:
        flg = True
        



n,a,b,c,d = map(int,input().split())
s = input()
flg = False
if c < d:
    
    flg = True
else:#c>d
    if '...' in s[b-2:d+1]:
        flg = True
if '##' in s[a-1:max(d,c)-1]:
    flg = False
if flg:
    print('Yes')
else:
    print('No')


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
N,A,B,C,D = map(int,input().split())
s = input()
if '##' in s:
    print('No')
else:
    if C > D:
        if '...' in s[B-1:D]:
            print('Yes')
        else:
            print('No')
    else:
        print('Yes')
print(s[B-1:D])

N,A,B,C,D = map(int,input().split())
s = input()
if ('##' in s[A:C]) or ('##' in s[B:D]):
    print('No')
else:
    if C > D:
        if '...' in s[B-2:D+1]:
            print('Yes')
        else:
            print('No')
    else:
        print('Yes')

Verdicts: Wrong Answer

Accepted
Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
N,A,B,C,D = map(int,input().split())
S = input()
A -= 1
B -= 1
C -= 1
D -= 1

if S[A:max(C,D)+1].count("##") == 0 :
    elif C < D :
        print("Yes")
    else :
        if S[B-1:D+2].count("...") :
            print("Yes")
        else :
            print("No")
else :
    print("No")

N,A,B,C,D = map(int,input().split())
S = input()
A -= 1
B -= 1
C -= 1
D -= 1

if S[A:max(C,D)+1].count("##") == 0 :
    if C < D :
        print("Yes")
    else :
        if S[B-1:D+2].count("...") :
            print("Yes")
        else :
            print("No")
else :
    print("No")

Verdicts: Runtime Error

Accepted