ZhenlongDai/ACPR huggingface dataset:
Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
s = list()
for a in S:
    s.append(a)

even = s[1::2]
odd = s[0::2]

if 'L' in even and 'R' in odd:
    print('Yes')
else:
    print('No')

Failing test case input:
VRMLCPKEQVRRKVKWVDS

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
s = list()
for a in S:
    s.append(a)

even = s[1::2]
odd = s[0::2]

if 'R' not in even and 'L' not in odd:
    print('Yes')
else:
    print('No')

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
S = (stdin.readline().rstrip())
if (set(S[1::2]) <= {"R","U","D"}) and  (set(S[0::2]) <= {"L","U","D"}):
    print("Yes")
else:
    print("No")

Failing test case input:
RUDLUDR

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
from sys import stdin
S = (stdin.readline().rstrip())

if (set(S[0::2]) <= {"R","U","D"}) and  (set(S[1::2]) <= {"L","U","D"}):
    print("Yes")
else:
    print("No")

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())
for i in range(len(S)):
  if i % 2 == 0:
    if S[i] == 'L':
      print('No')
      break
    else:
      pass
  else:
    if S[i] == 'R':
      print('No')
      break
    else:
      pass
print('Yes')


Failing test case input:
KXVKPBCRQJMSUQRLWWE

Expected output:
No


Actual output:
No
Yes


Fixed submission (verdict: Accepted):
S = str(input())
for i in range(len(S)):
  if i % 2 == 0:
    if S[i] == 'L':
      print('No')
      exit()
    else:
      pass
  else:
    if S[i] == 'R':
      print('No')
      exit()
    else:
      pass
print('Yes')

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s =input()

even = ["L", "U", "D"]
odd  = ["R", "U", "D"]
cnt = 1
result = "Yes"

for i in s:

    if cnt % 2 == 0:
        
        if not(i in even):
            result = "No"
            break
    else:
        if not(i in odd):
            result = "No"
            break
        
print(result)

Failing test case input:
RDULULDURURLRDULRLR

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s =input()

even = ["L", "U", "D"]
odd  = ["R", "U", "D"]
cnt = 1
result = "Yes"

for i in s:

    if cnt % 2 == 0:
        
        if not(i in even):
            result = "No"
            break
    else:
        if not(i in odd):
            result = "No"
            break
    cnt += 1
print(result)

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
f = 0
for i in range(len(s)):
  if i % 2 == 1 and not (s[i] == 'R' or s[i] == 'U' or s[i] == 'D'):
    f = 1
  if i % 2 == 0 and not (s[i] == 'L' or s[i] == 'U' or s[i] == 'D'):
    f = 1
if f:
  print("No")
else:
  print("Yes")

Failing test case input:
RUDLUDR

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
f = 0
for i in range(len(s)):
  if (i + 1) % 2 == 1 and not (s[i] == 'R' or s[i] == 'U' or s[i] == 'D'):
    f = 1
  if (i + 1) % 2 == 0 and not (s[i] == 'L' or s[i] == 'U' or s[i] == 'D'):
    f = 1
if f:
  print("No")
else:
  print("Yes")
Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
tap = input()

tap_list = list(tap)

for val in range(len(tap)):
	if ('R' in tap_list[val]) and (val%2 == 0) :
		print('No')
	elif ('L' not in tap_list[val])and (val%2 ==1) :
		print('Yes')
	else:
		print('No')
		
		
	

Failing test case input:
KWVSWRCRQJQVKQCLMVD

Expected output:
No


Actual output:
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
No
No
Yes
No


Fixed submission (verdict: Accepted):
tap = input()

tap_list = list(tap)
result_list = []

for val in range(len(tap)):
	if ('R' in tap_list[val]) and (val%2 == 1) :
		result_list.insert(0,1)
	elif ('L' in tap_list[val])and (val%2 == 0) :
		result_list.insert(0,1)
	else:
		result_list.insert(0,0)

if 1 in result_list :
	print('No')	
else :
		print('Yes')

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
flag = True
for i, j in enumerate(s):
    if ( i+1) % 2 == 0:
        if not(j == "L" or j =="U" or j == "D"):
            flag = False
    else:
        if not(j == "R" or j =="U", j == "D"):
            flag = False
if flag:
    print("Yes")
else:
    print("No")

Failing test case input:
EULL

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
flag = True
for i, j in enumerate(s):
    if ( i+1) % 2 == 0:
        if not(j == "L" or j =="U" or j == "D"):
            flag = False
    else:
        if not(j == "R" or j =="U" or  j == "D"):
            flag = False
if flag:
    print("Yes")
else:
    print("No")

Problem: p02910
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = str(input())
c = []
for i in range(len(N)):
    if i % 2 == 0:
        if i == 'L' or i == 'U' or i == 'D':
            c.append(i)

    else:
        if i =='R' or i == 'U' or i == 'D':
            c.append(i)



if len(c) == len(N):
    print('Yes')
else:
    print('No')

Failing test case input:
RDULDUR

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = str(input())
a = ['R','U','D']
b = ['L','U','D']
c = 0
for i in range(0, len(N)):
    if i % 2 == 0:
        if N[i] in a:
            c += 1

    else:
        if N[i] in b:
            c += 1


if c == len(N):
    print('Yes')
else:
    print('No')

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

OD = ["D", "R", "U"]
EV = ["D", "L", "U"]

if (sorted(set(s[::2])) == OD) and (sorted(set(s[1::2])) == EV):
    print("Yes")
else:
    print("No")

Failing test case input:
UUUUUUUUUUUUUUU

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = input()

OD = {"D", "R", "U"}
EV = {"D", "L", "U"}

if ((set(s[::2])) <= OD) and ((set(s[1::2])) <= EV):
    print("Yes")
else:
    print("No")

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
odd = S[1::2]
even = S[0::2]
if 'L' in odd or 'R' in even:
    print('NO')
else:
    print('YES')

Failing test case input:
RUDLUDR

Expected output:
Yes

Actual output:
NO


Fixed submission (verdict: Accepted):
S = list(input())
odd = S[0::2]
even = S[1::2]
if 'L' in odd or 'R' in even:
    print('No')
else:
    print('Yes')
Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

ODD = ['R', 'U', 'D']
EVEN = ['L', 'U', 'D']
s = input()

flg = False
for i in range(len(s)):
    if i % 2 == 1:
        if (s[i] in ODD) == False:
            flg = True
            break
    else:
        if (s[i] in EVEN) == False:
            flg = True
            break
        
if flg:
    print('No')
else:
    print('Yes')

Failing test case input:
RUDLUDR

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = input()

flg = True
for i in range(len(s)):
    if s[i] == 'U':
        
        continue
    elif s[i] == 'D':
        
        continue
    elif i % 2 == 0 and s[i] == 'R':
        
        continue
    elif i % 2 == 1 and s[i] == 'L':
        
        continue
    else:
        
        flg = False
        break

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

Problem: p02910
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=input() 
ans=0
for i in range(0,len(s),2):
  if s[i]!='R' and s[i]!='U'  and s[i]!='D':
    ans=1
for j in range(1,len(s),2):
  if s[i]!='U' and s[i]!='L' and s[i]!='D':
    ans=1
if ans==0:
  print('Yes')
else:
  print('No')

Failing test case input:
ULURU

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
s=input() 
ans=0
for i in range(0,len(s),2):
  if s[i]!='R' and s[i]!='U'  and s[i]!='D':
    ans=1
for j in range(1,len(s),2):
  if s[j]!='U' and s[j]!='L' and s[j]!='D':
    ans=1
if ans==0:
  print('Yes')
else:
  print('No')

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
n = len(s)

k,g=[],[]
for i in range(n):
    if i%2==0:
        k.append(s[i])
    else:
        g.append(s[i])


for j in k:
    if j == 'L':
        print('No')
        break

else:
    for l in g:
        if l == 'R':
            print('No')
            break
        else:
            print('Yes')
            break
    


Failing test case input:
KWVLSBCRQPQLWLWRUJE

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = list(input())
n = len(s)

k,g=[],[]
for i in range(n):
    if i%2==0:
        k.append(s[i])
    else:
        g.append(s[i])


for j in k:
    if j == 'L':
        print('No')
        break

else:
    for l in g:
        if l == 'R':
            print('No')
            break
    else:
        print('Yes')
Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    odd = False
    even = False
    for i, s in enumerate(list(input())):
        if i % 2 == 0:
            even = s in ['R', 'U', 'D']
        else:
            odd = s in ['L', 'U', 'D']

    r = 'No'
    if odd and even:
        r = 'Yes'

    print(r)


if __name__ == "__main__":
    main()


Failing test case input:
LLUD

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def main():
    odd = False
    even = False

    odds = []
    evens = []
    for i, s in enumerate(list(input())):
        if i % 2 == 0:
            evens.append(s in ['R', 'U', 'D'])
        else:
            odds.append(s in ['L', 'U', 'D'])

    odd = odds.count(False) == 0
    even = evens.count(False) == 0

    r = 'No'
    if odd and even:
        r = 'Yes'

    print(r)


if __name__ == "__main__":
    main()

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
        
    S = input()
    
    if "L" in S[::2] or "R" in S[1::2] == True:
        print("No")
    else:
        print("Yes")

if __name__ == "__main__":
    main()

Failing test case input:
KWVSWRCRQJQVKQCLMVD

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def main():
        
    S = input()
    
    if "L" in S[::2] or "R" in S[1::2]:
        print("No")
    else:
        print("Yes")

if __name__ == "__main__":
    main()

Problem: p02910
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()

isOdd = True
for i in range(len(s)):
    if i % 2 == 1:
        if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
            isOdd = False

isEven = True
for i in range(len(s)):
    if i == 0 or i % 2 == 0:
        if s[i] != 'R' and s[i] != 'U' and s[i] != 'D':
            isEven = False

if isOdd == True or isEven == True:
    print("Yes")
else:
    print("No")

Failing test case input:
URUJU

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()

isOdd = True
for i in range(len(s)):
    if i % 2 == 1:
        if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
            isOdd = False

isEven = True
for i in range(len(s)):
    if i == 0 or i % 2 == 0:
        if s[i] != 'R' and s[i] != 'U' and s[i] != 'D':
            isEven = False

if isOdd == True and isEven == True:
    print("Yes")
else:
    print("No")

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

s = input()
sr = s[1::2].replace("R", "").replace("U", "").replace("D", "")
sl = s[::2].replace("L", "").replace("U", "").replace("D", "")
if sr and sl:
    print("Yes")
    exit()
print("No")


Failing test case input:
KWVLSBCRQPQLWRWLUJE

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

s = input()
sr = s[::2].replace("R", "").replace("U", "").replace("D", "")
sl = s[1::2].replace("L", "").replace("U", "").replace("D", "")
if sr or sl:
    print("No")
    exit()
print("Yes")
Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
S1 = S[0::2]
S2 = S[1::2]

S_count = S1.count('R') + S1.count('U') + S1.count('D')+ S2.count('L') + S2.count('U') + S2.count('D')

if len(S) == S_count:
    print('YES')
else:
    print('NO')

Failing test case input:
RPRRLRLKDLLVDWUWVCR

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
S = input()
S1 = S[0::2]
S2 = S[1::2]

S_count = S1.count('R') + S1.count('U') + S1.count('D')+ S2.count('L') + S2.count('U') + S2.count('D')

if len(S) == S_count:
    print('Yes')
else:
    print('No')

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
s_list =  list(s)
jun = 0
ans = 1

while(len(s_list)):
    if jun % 2 == 0:
        if s_list[jun] != "R" or s_list[jun] != "U" or s_list[jun] != "D":
            ans = 0
    if jun % 2 == 1:
        if s_list[jun] != "L" or s_list[jun] != "U" or s_list[jun] != "D":
            ans = 0
    jun += 1
    if jun == len(s_list):
      break
if ans == 1:
    print("Yes")
else:
    print("No")

Failing test case input:
RDULULDURURLRDULRLR

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
s_list =  list(s)
jun = 0
ans = 1

while(len(s_list)):
    if jun % 2 == 0:
        if s_list[jun] == "L":
            ans = 0
    if jun % 2 == 1:
        if s_list[jun] == "R":
            ans = 0
    jun += 1
    if jun == len(s_list):
      break
if ans == 1:
    print("Yes")
else:
    print("No")

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=str(input())
L = list(s)
count = 0
n = 0
for i in L:
  n += 1
  if n % 2 == 1:
    if i == "R":
      count += 1
  else:
    if i == "L":
      count += 1
if count == 0:
  print("Yes")
else:
  print("No")
    

Failing test case input:
URUJU

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s=str(input())
L = list(s)
count = 0
n = 0
for i in L:
  n += 1
  if n % 2 == 0:
    if i == "R":
      count += 1
  else:
    if i == "L":
      count += 1
if count == 0:
  print("Yes")
else:
  print("No")

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()

ans="Yes"
for i in range(len(s)):
  if i%2==0 and s[i]=="R":
    ans="No"
  if i%2!=0 and s[i]=="L":
    ans="No"
    
print(ans)

Failing test case input:
RDULDUR

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s=input()
 
ans="Yes"
for i in range(len(s)):
  if i%2==0 and s[i]=="L":
    ans="No"
  if i%2!=0 and s[i]=="R":
    ans="No"
    
print(ans)

Problem: p02910
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()
c1 = [s in ['R', 'U', 'D'] for s in S[::2]]
c2 = [s in ['L', 'U', 'D'] for s in S[1::2]]
print('Yes' if c1 and c2 else 'No')


Failing test case input:
RPRRWRLKDLLVDWULVCR

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
c1 = all([s in ['R', 'U', 'D'] for s in S[::2]])
c2 = all([s in ['L', 'U', 'D'] for s in S[1::2]])
print('Yes' if c1 and c2 else 'No')
Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
for i in range(len(s)):
  if (i % 2 == 0 and s[i] == 'R') or (i % 2 == 1 and s[i] == 'L'):
    print('No')
    exit()
print('Yes')

Failing test case input:
URUJU

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
for i in range(len(s)):
  if (i % 2 == 1 and s[i] == 'R') or (i % 2 == 0 and s[i] == 'L'):
    print('No')
    exit()
print('Yes')

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
if len(a)==1 and a == "L":
    print("No")
    exit()
elif len(a)==1:
    print("Yes")
    exit()
for i in a[::2]:
    for j in a[1::2]:
        print(i,j)
        if i =="L" or j =="R":
            print("No")
            exit()
else:
    print("Yes")

Failing test case input:
RRRQLPLDDKLWKVUWVDR

Expected output:
No


Actual output:
R R
No


Fixed submission (verdict: Accepted):
a = input()
if len(a)==1 and a == "L":
    print("No")
    exit()
elif len(a)==1:
    print("Yes")
    exit()
for i in a[::2]:
    for j in a[1::2]:
        if i =="L" or j =="R":
            print("No")
            exit()
else:
    print("Yes")

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
odd = S[0::2]
even = S[1::2]
if 'L' in odd:
    print('NO')
elif 'R' in even:
    print('NO')
else:
    print('YES')

Failing test case input:
DVMLCQKVQKRRDRKWVVS

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
S = list(input())
odd = S[0::2]
even = S[1::2]
if 'L' in odd or 'R' in even:
    print('No')
else:
    print('Yes')

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()



e=0
for x in s:
  if s.index(x)%2==0 and x == 'R':
    e = 1

o=0
for y in s:
  if s.index(y)%2!=0 and x == 'L':
    o = 1
    
if e==1 or o==1:
  print('No')

else:
  print('Yes')


Failing test case input:
VRMLCPKEQURRKVKWVDS

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()

e=0
for x in range(0, len(s)):
  if x%2==0 and s[x] == 'L':
    e = 1

o=0
for y in range(0, len(s)):
  if y%2!=0 and s[y] == 'R':
    o = 1
    
if e==1 or o==1:
  print('No')

else:
  print('Yes')

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

S = input()

even_pat = 'LUD'
odd_pat = 'RUD'

flag = True

for s in range(len(S)):
    if (s+1) % 2 == 0:
        if S[s] in even_pat:
            pass
        else:
            flag = False
    else:
        if S[s] in odd_pat:
            pass
        else:
            flag == False
if flag:
    print('Yes')
else:
    print('No')

Failing test case input:
LLUD

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = ' ' + input()
even_pat = ['R','U','D']
odd_pat = ['L','U','D']

flag = True

for i in range(1,len(S)):
    if i % 2 == 1:
        if not(S[i] in even_pat):
            flag = False
            break
    
    else:
        if not(S[i] in odd_pat):
            flag = False
            break

print('Yes' if flag else 'No')
Problem: p02910
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
list=input()
def split(a): 
    return [char for char in a]
list=split(list)
even_count=0
odd_count=0
for i in list:
  if even_count%2==0:
      even_count+=1
      continue
  if list[even_count]=="R":
    print("NO")
    sys.exit()
  even_count+=1
for i in list:
  if odd_count%2==1:
      odd_count+=1
      continue
  if list[odd_count]=="L":
    print("NO")
    sys.exit()
  odd_count+=1
print("YES")



Failing test case input:
UJURU

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
import sys
list=input()
def split(a): 
    return [char for char in a]
list=split(list)
even_count=0
odd_count=0
for i in list:
  if even_count%2==0:
      even_count+=1
      continue
  if list[even_count]=="R":
    print("No")
    sys.exit()
  even_count+=1
for i in list:
  if odd_count%2==1:
      odd_count+=1
      continue
  if list[odd_count]=="L":
    print("No")
    sys.exit()
  odd_count+=1
print("Yes")

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
for i in range(1,len(s)+1):
    if i%2 == 0:
        if s[i-1] == "L":
            print("No")
            exit()
    else:
        if s[i-1] == "R":
            print("No")
            exit()
print("Yes")

Failing test case input:
RDULDUR

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = list(input())
for i in range(1,len(s)+1):
    if i%2 == 0:
        if s[i-1] == "R":
            print("No")
            exit()
    else:
        if s[i-1] == "L":
            print("No")
            exit()
print("Yes")

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
odd = [ "R", "U", "D"]
add = ["L", "U", "D"] 
ans = 1

S = input()
for i,s in enumerate(S):
  if i%2 == 0:
    if (s in add) == False:
      ans = 0
  else:
    if (s in odd) == False:
      ans = 0
      
if ans == 0:
  print("No")
else:
  print("Yes")

  

Failing test case input:
RDULDUR

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
odd = [ "R", "U", "D"]
add = ["L", "U", "D"] 
ans = 1
 
S = input()
for i,s in enumerate(S):
  if (i+1)%2 == 0:
    if (s in add) == False:
      ans = 0
  else:
    if (s in odd) == False:
      ans = 0
      
if ans == 0:
  print("No")
else:
  print("Yes")

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = [s for s in input().split()]

flag = 0
for i in range(len(S)):
    if (i + 1) % 2 == 1:
        if S[i] == "L":
            flag = 1
    else:
        if S[i] == "R":
            flag = 1

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

Failing test case input:
SCVWUVKRRKQDLPDLMRV

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()

flag = 0
for i in range(len(S)):
    if (i + 1) % 2 == 1:
        if S[i] == "L":
            flag = 1
    else:
        if S[i] == "R":
            flag = 1

if flag == 1:
    print("No")
else:
    print("Yes")
Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
if all([x in ['R', 'U', 'D'] for x in S[::2]]):
    print('Yes')
elif all([x in ['L', 'U', 'D'] for x in S[1::2]]):
    print('Yes')
else:
    print('No')

Failing test case input:
LLUD

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
if all([x in ['R', 'U', 'D'] for x in S[::2]]) and all([x in ['L', 'U', 'D'] for x in S[1::2]]):
    print('Yes')
else:
    print('No')

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
S = (stdin.readline().rstrip())
if (set(S[1::2]) <= {"L","U","D"}) and  (set(S[0::2]) <= {"L","U","D"}):
    print("Yes")
else:
    print("No")

Failing test case input:
LLUD

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from sys import stdin
S = (stdin.readline().rstrip())

if (set(S[0::2]) <= {"R","U","D"}) and  (set(S[1::2]) <= {"L","U","D"}):
    print("Yes")
else:
    print("No")

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
flags = ['Yes', 'No']

input_s = input()

odd_s = input_s[1::2]
even_s = input_s[0::2]

no_flag = ('R' in odd_s) | ('L' in even_s)

print(odd_s)
print(flags[no_flag])

Failing test case input:
DVMLCQUKQJQRCRWSVXK

Expected output:
No


Actual output:
VLQKJRRSX
No


Fixed submission (verdict: Accepted):
flags = ['Yes', 'No']

input_s = input()

odd_s = input_s[0::2]
even_s = input_s[1::2]

no_flag = ('L' in odd_s) | ('R' in even_s)

print(flags[no_flag])

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
s=input()
l=len(s)
for i in range(0,l,2):
  if s[i]=='R':
    print('No')
    sys.exit()
for j in range(1,l,2):
  if s[j]=='L':
    print('No')
    sys.exit()
print('Yes')

Failing test case input:
URUJU

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import sys
s=input()
l=len(s)
for i in range(0,l,2):
  if s[i]=='L':
    print('No')
    sys.exit()
for j in range(1,l,2):
  if s[j]=='R':
    print('No')
    sys.exit()
print('Yes')

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
for i in range(len(s)):
  cur = "Yes"
  if i % 2 == 0:
    if s[i] == "L":
      cur = "No"
  else:
    if s[i] == "R":
      cur = "No"
print(cur)

Failing test case input:
VRMLCQKDQKRRVVKWVDS

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
cur = "Yes"
for i in range(len(s)):
  if i % 2 == 0:
    if s[i] == "L":
      cur = "No"
  else:
    if s[i] == "R":
      cur = "No"
print(cur)
Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
strs = input()
 
for i in range(len(strs)):
  if i % 2 == 0:
    if (strs[i] == "L") or (strs[i] == "U") or (strs[i] == "D"):
      continue
    else:
      print("No")
      break
  else:
    if (strs[i] == "R") or (strs[i] == "U") or (strs[i] == "D"):
      continue
    else:
      print("No")
      break
else:
  print("Yes")

Failing test case input:
RDULDUR

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
strs = input()
 
for i in range(len(strs)):
  if i % 2 != 0:
    if (strs[i] == "L") or (strs[i] == "U") or (strs[i] == "D"):
      continue
    else:
      print("No")
      break
  else:
    if (strs[i] == "R") or (strs[i] == "U") or (strs[i] == "D"):
      continue
    else:
      print("No")
      break
else:
  print("Yes")

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=str(input())
hantei0=True
hantei1=True

for i in range(len(s)):
  if i%2==0 and s[i]=='L':
    print(i,s[i])
    hantei0=False
  elif i%2==1 and s[i]=='R':
    hantei1=False
    
if hantei0==True and hantei1==True:
  print('Yes')
else:
  print('No')

Failing test case input:
RRRLVDLKRLRVDVULVCR

Expected output:
No


Actual output:
6 L
No


Fixed submission (verdict: Accepted):
s=str(input())
hantei0=True
hantei1=True

for i in range(len(s)):
  if i%2==0 and s[i]=='L':
    hantei0=False
  elif i%2==1 and s[i]=='R':
    hantei1=False
    
if hantei0==True and hantei1==True:
  print('Yes')
else:
  print('No')

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=list(input())
a=S[::2]
c=S[1::2]
b='Yes'
for i in a:
  if i!='R' or i!='U' or i!='D':
    b='No'
for j in c:
  if j!='L' or j!='U' or j!='D':
    b='No'
print(b)


Failing test case input:
RDULULDURURLRDULRLR

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
S=list(input())
a=S[::2]
b='Yes'
for i in a:
  if i!='R' and i!='U' and i!='D':
    b='No'
    break
c=S[1::2]
for j in c:
  if j!='L' and j!='U' and j!='D':
    b='No'
    break
print(b)

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
str = input()
num = len(str)
ans = True
for i in range(num):
    print(str[i])
    if (i+1) % 2 == 0:
        if str[i] == "R":
            ans = False
    else:
        if str[i] == "L":
            ans = False

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

Failing test case input:
KWVKPBCRQJMSUQWLWRE

Expected output:
No


Actual output:
K
W
V
K
P
B
C
R
Q
J
M
S
U
Q
W
L
W
R
E
No


Fixed submission (verdict: Accepted):
str = input()
num = len(str)
ans = True
for i in range(num):
    if (i+1) % 2 == 0:
        if str[i] == "R":
            ans = False
    else:
        if str[i] == "L":
            ans = False

if ans:
    print("Yes")
else:
    print("No")
Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
b = list(S)
a = b[0::2]
c = b[1::2]
d = len(b)
e = len(c)
cnt = 0
f = a.count('R')
g = a.count('U')
h = a.count('D')
i = f + g + h
print(i)

j = c.count('L')
k = c.count('U')
l = c.count('D')
m = j + k + l
print(m)

if i == d and m == e:
    print('Yes')
else:
    print('No')

Failing test case input:
RRRRLPLKDLLVDWUWVCR

Expected output:
No


Actual output:
6
1
No


Fixed submission (verdict: Accepted):
S = input()
b = list(S)
a = b[0::2]
c = b[1::2]
d = len(a)
e = len(c)
cnt = 0
f = a.count('R')
g = a.count('U')
h = a.count('D')
i = f + g + h



j = c.count('L')
k = c.count('U')
l = c.count('D')
m = j + k + l



if i == d and m == e:
    print('Yes')
else:
    print('No')

Problem: p02910
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())

c = 1
while len(S) > 0:
    s = S.pop()
    if c%2==1: 
        if s == 'L':
            print('No')
            break
    else:
        if s == 'R':
            print('No')
            break

    c=c+1

else:
    print('Yes')


Failing test case input:
EULM

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = list(input())

for c in range(1,len(S)+1):
    if c%2==1: 
        if S[c-1] == 'L':
            print('No')
            break
    else:
        if S[c-1] == 'R':
            print('No')
            break
else:
    print('Yes')
Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
n,d = map(int,input().split())
a = []
b = 0
c = 0

for i in range(n):
    x = list(map(int,input().split()))
    a.append(x)
    
for i in range(n):
    for j in range(i+1,n):
        for k in range(d):
            c += (a[i][k]-a[j][k])**2

        if int(math.sqrt(c))**2 == c:
            b += 1
print(b)

Failing test case input:
3 2
2 4
5 5
-2 8

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
import math
n,d = map(int,input().split())
a = [list(map(int,input().split())) for x in range(n)]
b = 0
    
for i in range(n):
    for j in range(i+1,n):
        c = 0
        for k in range(d):
            c += (a[i][k]-a[j][k])**2

        if int(math.sqrt(c))**2 == c:
            b += 1
print(b)

Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

n,d=map(int,input().split())
li=[]
for i in range(n):
  li.append(list(map(int,input().split())))

count=0
for i in range(n-1):
  for j in range(i+1,n):
    num=0
    for k in range(d):
      num+=(li[i][k]-li[j][k])**2
    num=math.sqrt(num)
    print(num)
    if num%1==0:
      count+=1
print(count)

Failing test case input:
3 4
-3 7 8 2
-12 1 10 2
-2 8 13 0

Expected output:
1


Actual output:
11.0
5.5677643628300215
12.727922061357855
1


Fixed submission (verdict: Accepted):
import math

n,d=map(int,input().split())
li=[]
for i in range(n):
  li.append(list(map(int,input().split())))

count=0
for i in range(n-1):
  for j in range(i+1,n):
    num=0
    for k in range(d):
      num+=(li[i][k]-li[j][k])**2
    num=math.sqrt(num)
    if num%1==0:
      count+=1
print(count)

Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

N,D=map(int, input().split())
X=[list(map(int, list(input().split()))) for i in range(0,N)]
sum=0
ans=0

print(X)

for i in range(0,N-1):
  for j in range(i+1,N):
    sum=0
    for k in range(0,D):
      sum+=(X[j][k]-X[i][k])**2
    M=math.sqrt(sum)
    if M.is_integer():
      ans+=1 
  
print(ans)

Failing test case input:
-2 20
-3 3 0 -1
-25 3 2 1
-2 8 18 -1

Expected output:
0


Actual output:
[]
0


Fixed submission (verdict: Accepted):
import math

N,D=map(int, input().split())
X=[list(map(int, list(input().split()))) for i in range(0,N)]
sum=0
ans=0

for i in range(0,N-1):
  for j in range(i+1,N):
    sum=0
    for k in range(0,D):
      sum+=(X[j][k]-X[i][k])**2
    M=math.sqrt(sum)
    if M.is_integer():
      ans+=1 
  
print(ans)
Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,d=map(int,input().split())
x=[list(map(int,input().split())) for _ in range(n)]
p=0
def c(i,j):
  global x
  s=0
  for k in range(d):
    s+=(x[i][k]-x[j][k])**2
  if s**(1/2).is_integer()==True:
    return 1
  else:
    return 0
for i in range(n):
  for j in range(i+1,n):
    p+=c(i,j)
print(p)

Failing test case input:
3 2
1 8
5 5
-2 8

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
n,d=map(int,input().split())
x=[list(map(int,input().split())) for _ in range(n)]
p=0
def c(i,j):
  global x
  s=0
  for k in range(d):
    s+=(x[i][k]-x[j][k])**2
  if (s**(1/2)).is_integer()==True:
    return 1
  else:
    return 0
for i in range(n):
  for j in range(i+1,n):
    p+=c(i,j)
print(p)

Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
n,d = map(int,input().split())
try:
  a = [list(map(int,input().split())) for j in range(0,n)]
except EOFError:
  pass
c = 0
r = 0
for i in range(0,n):
  for j in range(i+1,n):
    for k in range(0,d):
      c+=(a[i][k]-a[j][k])**2
  if math.sqrt(c)==int(math.sqrt(c)):
    r += 1
print(r)


Failing test case input:
1 1
1
2
3
4
5

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
import math
n,d = map(int,input().split())
x = [list(map(int, input().split())) for i in range(n)]
ans = 0
for i in range(n-1):
    for j in range(i+1,n):
        t = 0
        for k in range(d):
            t+=(x[i][k]-x[j][k])**2 
        if math.sqrt(t)==int(math.sqrt(t)):
            ans += 1
print(ans)

Problem: p02982
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math

n, d = map(int, input().split())
x = [list(map(int, input().split())) for i in range(n)]
cnt = 0
for i in range(n):
    for j in range(i+1, n):
        for k in range(d):
            dis = 0
            dis += (x[i][k]-x[j][k])**2
            if math.sqrt(dis) % 1 == 0:
                cnt += 1
print(cnt)

Failing test case input:
3 4
-3 7 8 2
-18 1 10 2
-2 8 13 0

Expected output:
0


Actual output:
12


Fixed submission (verdict: Accepted):
import math

n, d = map(int, input().split())
x = [list(map(int, input().split())) for i in range(n)]
cnt = 0
for i in range(n):
    for j in range(i+1, n):
        dis = 0
        for k in range(d):
            dis += (x[i][k]-x[j][k])**2
        if math.sqrt(dis) % 1 == 0:
            cnt += 1
print(cnt)
Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from math import sqrt
N,D = map(int,input().split())
X = []
for i in range(N):
    X.append(list(map(int,input().split())))

ans = 0
for i in range(N):
    for j in range(i+1,N):
        tmp = 0
        for k in range(D):
            tmp += (X[i][k]-X[j][k])**2
        if int(sqrt(tmp) * 10) % 10 == 0:
            ans += 1
print(ans)

Failing test case input:
3 2
0 4
5 5
-2 8

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
from math import sqrt
N,D = map(int,input().split())
X = []
for i in range(N):
    X.append(list(map(int,input().split())))

ans = 0
for i in range(N):
    for j in range(i+1,N):
        tmp = 0
        for k in range(D):
            tmp += (X[i][k]-X[j][k])**2
        if int(sqrt(tmp))**2  == tmp:
            ans += 1
print(ans)

Problem: p02982
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
n,d=map(int,input().split())

x=[]
for i in range(n):
  x.append(list(map(int,input().split())))

cnt=0

for i in range(n-1):
  for j in range(i+1,n):
    d=0
    for k in range(d):
      d+=(x[i][k]-x[j][k])**2
    if int(math.sqrt(d))**2==d:
      cnt+=1
print(cnt)

Failing test case input:
3 4
-3 7 8 2
-12 1 10 2
-2 8 13 0

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
import math
n,d=map(int,input().split())

x=[]
for i in range(n):
  x.append(list(map(int,input().split())))

cnt=0

for i in range(n-1):
  for j in range(i+1,n):
    s=0
    for k in range(d):
      s+=(x[i][k]-x[j][k])**2
    if int(math.sqrt(s))**2==s:
      cnt+=1
      
print(cnt)

Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from itertools import *
n,d = map(int,input().split())
x = [list(map(int,input().split())) for _ in range(n)]
ans = 0
for a,b in combinations(x,2):
  delta = 0
  for i in range(d):
    delta += (a[i] - b[i])**2
  if (n **0.5).is_integer():
    ans += 1
print(ans)


Failing test case input:
3 4
-3 7 8 2
-12 1 10 2
-2 8 9 0

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
from itertools import *
n,d = map(int,input().split())
x = [list(map(int,input().split())) for _ in range(n)]
ans = 0
for a,b in combinations(x,2):
  delta = 0
  for i in range(d):
    delta += (a[i] - b[i])**2
  if (delta **0.5).is_integer():
    ans += 1
print(ans)
Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
n, d = map(int, input().split())
x = [[0 for i in range(d)] for j in range(n)]
for i in range(n):
  x[i] = map(int, input().split())
 
result = 0
for i in range(n):
  for j in range(1,n):
    diff = map(lambda x,y: (x-y)*(x-y), x[i],x[j])
    calc = math.sqrt(sum(diff))
    if calc.is_integer():
      result +=1
print(result)

Failing test case input:
3 4
-3 7 8 2
-12 1 10 2
-2 8 9 0

Expected output:
1


Actual output:
6


Fixed submission (verdict: Accepted):
import math
n, d = map(int, input().split())
x = [[0 for i in range(d)] for j in range(n)]
for i in range(n):
  x[i] = list(map(int, input().split()))
result = 0
for i in range(0,n-1):
  for j in range(i+1,n):
    diff = list(map(lambda x,y: pow(x-y,2), x[i], x[j]))
    calc = math.sqrt(sum(diff))
    if calc.is_integer():
      result +=1
print(result)

Problem: p02982
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N, D = map(int, input().split())
zahyo = [0]*N
for i in range(N):
  zahyo[i] = list(map(int, input().split()))
count = 0
for i in range(N):
  for j in range(i+1, N):
    V = 0
    for k in range(D):
      V += (zahyo[i][k]-zahyo[j][k])**2
    if isinstance(V, int):
      count += 1
print(count)
      

Failing test case input:
3 4
-3 7 8 2
-12 1 10 2
-2 8 9 3

Expected output:
2

Actual output:
3


Fixed submission (verdict: Accepted):
N, D = map(int, input().split())
zahyo = [0]*N
for i in range(N):
  zahyo[i] = list(map(int, input().split()))
count = 0
for i in range(N):
  for j in range(i+1, N):
    V = 0
    for k in range(D):
      V += (zahyo[i][k]-zahyo[j][k])**2
    if (float(V**0.5)).is_integer():
      count += 1
print(count)

Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int,input().split())
c = [list(map(int,input().split())) for j in range(a)]
ans = 0
for l in range(a-1):
    for k in range(l+1,a):
        d = [(x-y)**2 for (x, y) in zip(c[l], c[k])]
    g = sum(d)
    if (g**0.5).is_integer:
        ans += 1
print(ans)

Failing test case input:
3 2
0 4
5 5
-2 8

Expected output:
0


Actual output:
2


Fixed submission (verdict: Accepted):
a,b = map(int,input().split())
c = [list(map(int,input().split())) for j in range(a)]
ans = 0
for l in range(a-1):
    for k in range(l+1,a):
        d = [(x-y)**2 for (x, y) in zip(c[l], c[k])]
        g = sum(d)
        s = g**0.5
        if s.is_integer():
            ans += 1
print(ans)
Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from math import sqrt
n, d = map(int, input().split())
point = [[int(i) for i in input().split()] for j in range(n)]
count = 0
for i in range(n):
    for j in range(i + 1, n):
        norm = 0
        for pi, pj in zip(point[i], point[j]):
            norm += (pi - pj) ** 2
        if int(sqrt(norm)) == norm:
            count += 1

print(count)

Failing test case input:
3 4
-3 7 8 2
-12 1 10 2
-2 8 9 3

Expected output:
2

Actual output:
0


Fixed submission (verdict: Accepted):
from math import sqrt
n, d = map(int, input().split())
point = [[int(i) for i in input().split()] for j in range(n)]
count = 0
for i in range(n):
    for j in range(i + 1, n):
        norm = 0
        for pi, pj in zip(point[i], point[j]):
            norm += (pi - pj) ** 2
        if int(sqrt(norm)) == sqrt(norm):
            count += 1

print(count)

Problem: p02982
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
from math import sqrt
n,d=map(int,input().split())
X=[[int(i)for i in input().split()]for _ in range(n)]
c=0
for i in range(n-1):
    for j in range(1,n):
        a=0
        for k in range(d):
            a+=(X[i][k]-X[j][k])**2
        if sqrt(a)==int(sqrt(a)):
            c+=1
print(c)

Failing test case input:
3 2
1 2
5 5
-2 8

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
from math import sqrt
n,d=map(int,input().split())
X=[[int(i)for i in input().split()]for _ in range(n)]
c=0
for i in range(n-1):
    for j in range(i+1,n):
        a=0
        for k in range(d):
            a+=(X[i][k]-X[j][k])**2
        if sqrt(a)==int(sqrt(a)):
            c+=1
print(c)

Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,b=map(int,input().split())
x=[list(map(int,input().split())) for i in range(n)]

count=1
for i in range(n):
  for j in range(i+1,n):
    t=0
    for k in range(b):
      t += (x[i][k]-x[j][k])**2
    t = t**(1/2)
    if t.is_integer():
      count += 1
print(count)
    

Failing test case input:
0 1
0
0
-1
4
1

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
n,b=map(int,input().split())
x=[list(map(int,input().split())) for i in range(n)]

count=0
for i in range(n):
  for j in range(i+1,n):
    t=0
    for k in range(b):
      t += (x[i][k]-x[j][k])**2
    t = t**(1/2)
    if t.is_integer():
      count += 1
print(count)
Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N, D = map( int, input().split() )
X = [list(map(int, input().split())) for _ in range(N)]
result = 0

for i in range(N):
    tmp = 0.0
    for j in range(i, N):
        for k in range(D):
            tmp += (X[i][k] - X[j][k]) ** 2
        tmp = math.sqrt(tmp)
        if tmp.is_integer():
            result += 1

print(result)


Failing test case input:
3 4
-3 7 8 2
-18 1 10 2
-2 8 13 0

Expected output:
0


Actual output:
3


Fixed submission (verdict: Accepted):
import math
N, D = map( int, input().split() )
X = [list(map(int, input().split())) for _ in range(N)]
result = 0

for i in range(N):
    for j in range(i, N):
        if i != j:
            tmp = 0.0
            for k in range(D):
                tmp += abs(X[i][k] - X[j][k]) ** 2
            tmp = math.sqrt(tmp)
            if tmp.is_integer():
                result += 1

print(result)

Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
n,d=map(int,input().split())
l=[]
ans=0
cnt=0
for i in range(n):
    l.append(list(map(int,input().split())))

for i in range (n-1):
    for k in range(n-i-1):
        for j in range(d):
            ans+=((l[i][j])-(l[i+1+k][j]))**2
        if float.is_integer(math.sqrt(ans))==True:
            cnt+=1
print(cnt)


Failing test case input:
5 1
1
2
3
4
5

Expected output:
10

Actual output:
2


Fixed submission (verdict: Accepted):
import math
n,d = map(int,input().split())
l = []
for i in range(n):
  l.append(list(map(int,input().split())))
count = 0
for i in range(n-1):
  for j in range(i+1,n):
    ans = 0
    for k in range(d):
      ans += (int(l[i][k])-int(l[j][k]))**2

    if float.is_integer(math.sqrt(ans)) == True:
      count += 1
print(count)

Problem: p02982
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N, D = map(int, input().split())
zahyo = [0]*N
for i in range(N):
  zahyo[i] = list(map(int, input().split()))
count = 0
for i in range(N):
  for j in range(i+1, N):
    V = 0
    for k in range(D):
      V += float((zahyo[i][k]-zahyo[j][k])**2)
    if V.is_integer():
      count += 1
print(count)

Failing test case input:
3 2
0 4
5 5
-2 8

Expected output:
0


Actual output:
3


Fixed submission (verdict: Accepted):
N, D = map(int, input().split())
zahyo = [0]*N
for i in range(N):
  zahyo[i] = list(map(int, input().split()))
count = 0
for i in range(N):
  for j in range(i+1, N):
    V = 0
    for k in range(D):
      V += (zahyo[i][k]-zahyo[j][k])**2
    if (float(V**0.5)).is_integer():
      count += 1
print(count)
Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, d = map(int, input().split())
x = []
cnt = 0
sum = 0
for _ in range(n):
    tmp = list(map(int, input().split()))
    x.append(tmp)

for i in range(n):
    for j in range(i + 1, n):
        for k in range(d):
            sum += (x[i][k] - x[j][k]) ** 2
        distance = sum ** 0.5
        if int(distance) - distance == 0:
            cnt += 1

print(cnt)


Failing test case input:
3 4
-3 7 8 2
-12 1 10 2
-2 8 9 3

Expected output:
2

Actual output:
1


Fixed submission (verdict: Accepted):
n, d = map(int, input().split())
x = []
cnt = 0
sum = 0
for _ in range(n):
    tmp = list(map(int, input().split()))
    x.append(tmp)

for i in range(n):
    for j in range(i + 1, n):
        sum = 0
        l = 1
        for k in range(d):
            sum += (x[i][k] - x[j][k]) ** 2
        while (l ** 2 <= sum):
            if l ** 2 == sum:
                cnt += 1
            l += 1

print(cnt)

Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,D = map(int,input().split())
X=[]
for i in range(N):
    X.append(list(map(int, input().split())))
    
ans=0
dist=0
for i in range(N):
    for j in range(N):
        if i < j:
            for k in range(D):
                dist += (X[i][k] - X[j][k])**2
            dist = dist ** (1/2)
            if round(dist,0) == dist:
                ans += 1
            
print(ans)

Failing test case input:
3 2
1 8
5 5
-2 8

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N,D = map(int,input().split())
X=[]
for i in range(N):
    X.append(list(map(int, input().split())))
    
ans=0

for i in range(N):
    for j in range(N):
        if i < j:
            dist=0
            for k in range(D):
                dist += (X[i][k] - X[j][k])**2
            dist = dist ** 0.5
            if round(dist,0) == dist:
                ans += 1
           
print(ans)

Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,D =map(int, input().split())
all_list = [list(map(int, input().split())) for i in range(N)]

count = 0
for n in range (N):
    for nn in range(N):
        distance = 0
        for d in range(D):
            kou = (all_list[n][d] - all_list[nn][d])**2
            distance += kou
        for s in range(21):
            if distance == s**2:
                count += 1
                break
print(round((count -N) / 2))

Failing test case input:
-2 20
0 3 0 -1
-25 3 2 1
-2 7 25 -1

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
N,D =map(int, input().split())
all_list = [list(map(int, input().split())) for i in range(N)]

count = 0
for n in range (N):
    for nn in range(n):
        distance = 0
        for d in range(D):
            kou = (all_list[n][d] - all_list[nn][d])**2
            distance += kou
        for s in range(250):
            if distance == s**2:
                count += 1
                break
print(count)
Problem: p02982
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,d=map(int,input().split())
point=[]
for _ in range(n):
    point.append(list(map(int,input().split())))
ans=0
for i in range(n-1):
    for l in range(1,n):
        if i==l:
            continue
        dis=0
        for f in range(d):
            dis+=(point[i][f]-point[l][f])**2
        dis=dis**0.5
        
        if dis.is_integer():
            ans+=1
print(ans)

Failing test case input:
5 1
1
2
3
4
5

Expected output:
10

Actual output:
13


Fixed submission (verdict: Accepted):
n,d=map(int,input().split())
point=[]
for _ in range(n):
    point.append(list(map(int,input().split())))
ans=0
for i in range(n-1):
    for l in range(i,n):
        if i==l:
            continue
        dis=0
        for f in range(d):
            dis+=(point[i][f]-point[l][f])**2
        dis=dis**(0.5)
        
        if dis.is_integer():
            ans+=1
print(ans)

Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
b = 0
N, D = map(int, input().split())
ls = [list(map(int, input().split()))for i in range(N)]
for i in range(N):
    a = 0
    for j in range(i, N):
        for k in range(D):
            a += (ls[i][k] - ls[j][k]) ** 2
    if math.sqrt(a).is_integer() is True:
        b += 1

print(b)


Failing test case input:
1 0
1
2
3
4
5

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
import math
b = 0
N, D = map(int, input().split())
ls = [list(map(int, input().split()))for i in range(N)]
for i in range(N - 1):
    for j in range(i + 1, N):
        a = 0
        for k in range(D):
            a += (ls[i][k] - ls[j][k]) ** 2
        if math.sqrt(a).is_integer() is True:
            b += 1

print(b)

Problem: p02982
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n, d = map(int, input().split())

x = [list(map(int, input().split())) for _ in range(n)]


cnt = 0
a = 0
for i in range(n-1):
    for j in range(i+1, n):
        for k in range(d):
            a += (x[i][k]-x[j][k])**2
        if (a**0.5)%1 == 0:
            cnt += 1
            a = 0
print(cnt)

Failing test case input:
3 2
2 4
5 5
-2 8

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):

n, d = map(int, input().split())

x = [list(map(int, input().split())) for _ in range(n)]


cnt = 0
a = 0
for i in range(n-1):
    for j in range(i+1, n):
        for k in range(d):
            a += (x[i][k]-x[j][k])**2
        if (a**0.5)%1 == 0:
            cnt += 1
            a = 0
        else:
            a = 0
print(cnt)