ZhenlongDai/ACPR huggingface dataset:
Problem: p03425
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
from itertools import combinations

n = int(input())
s = [input()[0] for _ in range(n)]
lc = Counter(s)
print(lc)

con = []
for c in 'MARCH':
    if c in lc:
        con.append(lc[c])

ans = 0
for a, b, c in combinations(con, 3):
    ans += a * b * c

print(ans)


Failing test case input:
4
ZY
ZZZ
W
YYZZZZZ[ZZ

Expected output:
0


Actual output:
Counter({'Z': 2, 'W': 1, 'Y': 1})
0


Fixed submission (verdict: Accepted):
from collections import Counter
from itertools import combinations

n = int(input())
s = [input()[0] for _ in range(n)]
lc = Counter(s)

con = []
for c in 'MARCH':
    if c in lc:
        con.append(lc[c])

ans = 0
for a, b, c in combinations(con, 3):
    ans += a * b * c

print(ans)

Problem: p03425
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import itertools
from collections import Counter
n = int(input())
s = [input()[0] for _ in range(n)]
cnt = Counter(s)
print(cnt)

ans = 0
for x,y,z in itertools.combinations("MARCH",3):
 
  ans += cnt[x]*cnt[y]*cnt[z]
  
        
print(ans)

Failing test case input:
5
EKIHSAM
IOMUR
ARIBO
HABORN
IANAKOROH

Expected output:
0


Actual output:
Counter({'I': 2, 'E': 1, 'A': 1, 'H': 1})
0


Fixed submission (verdict: Accepted):
import itertools
from collections import Counter
n = int(input())
s = [input()[0] for _ in range(n)]
cnt = Counter(s)


ans = 0
for x,y,z in itertools.combinations("MARCH",3):
 
  ans += cnt[x]*cnt[y]*cnt[z]
  
        
print(ans)

Problem: p03425
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
names = []
for i in range(n):
  names.append(input())
names = [i[0] for i in names]
nm = ["M","A","R","C","H"]
ks = [names.count(nm[i]) for i in range(5)]
ans = 0
for i in range(3):
  for j in range(i+1,4):
    for k in range(j+1,5):
      ans += i*j*k
print(ans)

Failing test case input:
5
I@DUKOGD
RNG
MAKOTP
AOKI
RINGN

Expected output:
2


Actual output:
50


Fixed submission (verdict: Accepted):
n = int(input())
names = []
for i in range(n):
  names.append(input())
names = [i[0] for i in names]
nm = ["M","A","R","C","H"]
ks = [names.count(nm[i]) for i in range(5)]
ans = 0
for i in range(3):
  for j in range(i+1,4):
    for k in range(j+1,5):
      ans += ks[i] * ks[j] * ks[k]
print(ans)
Problem: p03425
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools
import math

n = int(input())
names = []

for _ in range(n):
    names.append(input())


march = {"M":0,"A":0,"R":0,"C":0,"H":0}

for name in names:
    if name[0] in march:
        march[name[0]]+=1
march_num = 0
for count in march.values():
    if count > 0:
        march_num += 1
ans = 0
if march_num >= 3:
    ans += math.factorial(march_num)
    for capital , cnt in march.items():
        if cnt > 1:
            ans += math.factorial(march_num-1)
else:
    ans = 0


print(ans)

Failing test case input:
5
IGDUKO@E
RNH
MTAOKP
AINK
RINFN

Expected output:
2


Actual output:
8


Fixed submission (verdict: Accepted):
import itertools
import math

n = int(input())
names = []

for _ in range(n):
    names.append(input())


march = {"M":0,"A":0,"R":0,"C":0,"H":0}

for name in names:
    if name[0] in march:
        march[name[0]]+=1
march_num = 0
for count in march.values():
    if count > 0:
        march_num += 1

if march_num >= 3:
    ans = 0
    for cap_1,cap_2,cap_3 in itertools.combinations(march,3):
        cap_1_num = march[cap_1]
        cap_2_num = march[cap_2]
        cap_3_num = march[cap_3]
        ans += cap_1_num*cap_2_num*cap_3_num

else:
    ans = 0

print(ans)

Problem: p03425
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
l = [0]*7
ans = 0

for i in range(n):
  s = input()
  if s[0] == "M":
    l[0] += 1
  elif s[0] == "A":
    l[1] += 1
  elif s[0] == "R":
    l[2] += 1 
  elif s[0] == "C":
    l[3] += 1
  elif s[0] == "H":
    l[4] += 1
    
for i in range(2):
  for j in range(i+1,i+3):
    for k in range(j+1,j+3):
      ans += l[i] * l[j] * l[k]

  
print(ans)

Failing test case input:
5
MASIHLE
IOTMR
ACIOR
RACOHO
HOROL@NAJ

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
from itertools import combinations
n = int(input())
l = [0]*5
ans = 0

for i in range(n):
  s = input()
  if s[0] == "M":
    l[0] += 1
  elif s[0] == "A":
    l[1] += 1
  elif s[0] == "R":
    l[2] += 1 
  elif s[0] == "C":
    l[3] += 1
  elif s[0] == "H":
    l[4] += 1
    
for a,b,c in combinations(l, 3):
  ans += a* b* c
  
print(ans)
Problem: p03425
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from math import factorial

def main():
    N = int(input())
    S = tuple(input() for _ in [0] * N)

    name = {'M':0, 'A':0, 'R':0, 'C':0, 'H':0}
    for s in S:
        if s[0] in 'MARCH':
            name[s[0]] += 1

    lst = [i for i in name.values() if i]
    n = len(lst)
    if n < 3:
        print(0)
        return

    comb = factorial(n) 
    k = 0
    for l in lst:
        comb *= l
        if l > 1 and n > 3:
            k += n - 3
    print(comb - k)

main()


Failing test case input:
5
MASHILE
IOUMR
ACIOR
HACOQO
JAN@LOROH

Expected output:
1


Actual output:
6


Fixed submission (verdict: Accepted):
from itertools import combinations

def main():
    N = int(input())
    S = tuple(input() for _ in [0] * N)

    name = {'M':0, 'A':0, 'R':0, 'C':0, 'H':0}
    for s in S:
        if s[0] in 'MARCH':
            name[s[0]] += 1

    lst = [i for i in name.values() if i]
    n = len(lst)
    if n < 3:
        print(0)
        return

    i = 0
    for a, b, c in combinations(name.keys(), 3):
        if all((name[a], name[b], name[c])):
            i += name[a] * name[b] * name[c]

    print(i)

main()

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




N = int(input())
S = []
for i in range(N):
    S.append(input())

m = sum([name[0] == 'M' for name in S])
a = sum([name[0] == 'A' for name in S])
r = sum([name[0] == 'R' for name in S])
c = sum([name[0] == 'C' for name in S])
h = sum([name[0] == 'H' for name in S])

print(m * (a * (r + c + h) + r * (c + h) + c * h) + a * (r * c + c * h) + r * c * h)


Failing test case input:
5
MASHIKE
RMUOI
AOICR
HABOQN
JAN@LOROH

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):




N = int(input())
S = []
for i in range(N):
    S.append(input())

m = sum([name[0] == 'M' for name in S])
a = sum([name[0] == 'A' for name in S])
r = sum([name[0] == 'R' for name in S])
c = sum([name[0] == 'C' for name in S])
h = sum([name[0] == 'H' for name in S])

print(m * (a * (r + c + h) + r * (c + h) + c * h) + a * (r * (c + h) + c * h) + r * c * h)
Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = input()
p = input()
s = s * 2
if p in s:
    print('Yes')
else:
    print('False')

Failing test case input:
vanbelonwlddgetoad
cdvancee

Expected output:
No


Actual output:
False


Fixed submission (verdict: Accepted):
s = input()
p = input()
s = s * 2
if p in s:
    print('Yes')
else:
    print('No')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s=input()
p=input()

if p in s:
    print("Yes")
else:
    print("No")

Failing test case input:
vanceknowledgetoad
advance

Expected output:
Yes

Actual output:
No


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

s+=s

if p in s:
    print("Yes")
else:
    print("No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
letters=input()
letters=letters+letters
want_find=input()
print(letters)
if want_find in letters:
    print('Yes')
else:
    print('No')

Failing test case input:
vadbenpowmefgtlnae
adbnweed

Expected output:
No


Actual output:
vadbenpowmefgtlnaevadbenpowmefgtlnae
No


Fixed submission (verdict: Accepted):
letters=input()
letters=letters+letters
want_find=input()
if want_find in letters:
    print('Yes')
else:
    print('No')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = input().lower()
p = input().lower()

s *= 2

if s.find(p) != -1:
    print('yes')
else:
    print("no")

Failing test case input:
v`dbknpowmefgtenae
adbdvedo

Expected output:
No


Actual output:
no


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

s *= 2

if s.find(p) != -1:
    print('Yes')
else:
    print("No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = input()
p = input()
Ans = False

for i in range(len(s)):
    for j in range(len(p)):
        if i + j >= len(s):
            i = -1
        if s[i + j] != p[j]:
            break
    if j == len(p) - 1:
        Ans = True
        break

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

Failing test case input:
vanceknowledgetoad
advance

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
p = input()
Ans = False
cnt = 0

for i in range(len(s)):
    for j in range(len(p)):
        if i + j >= len(s):
            i = -j
        if s[i + j] != p[j]:
            break
        cnt += 1
    if cnt == len(p):
        Ans = True
        break
    cnt = 0

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

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = input().lower()
p = input().lower()

s *= 2

if s.find(p) != 1:
    print('yes')
else:
    print("no")

Failing test case input:
tanceknoxedeglvoae
dencvaa

Expected output:
No


Actual output:
yes


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

s *= 2

if s.find(p) != -1:
    print('Yes')
else:
    print("No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):

s = str(input())*2
q = str(input())
print(["NO", "YES"][q in s])

Failing test case input:
eaovlgedexonkecnat
dencvaa

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):

s = str(input())*2
q = str(input())
print(["No", "Yes"][q in s])
Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):


import sys

s = sys.stdin.readline().strip()
p = sys.stdin.readline().strip()

if p in s:
    print('Yes')
else:
    print('No')


Failing test case input:
vanceknowledgetoad
advance

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):


import sys

s = sys.stdin.readline().strip()
p = sys.stdin.readline().strip()

s += s

if p in s:
    print('Yes')
else:
    print('No')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):

s = input() * 2
p = input()
if s.find(p):
    print("Yes")
else:
    print("No")

Failing test case input:
vanceknowledgetoad
bdvanced

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

s = input() * 2
p = input()
if s.find(p) >= 0:
    print("Yes")
else:
    print("No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
ring = input()
ring_double = ring *2
test = input()
if test in ring_double:
	print('True')
else:
	print('No')

Failing test case input:
vanceknowledgetoad
advance

Expected output:
Yes

Actual output:
True


Fixed submission (verdict: Accepted):
ring = input()
ring_double = ring *2
test = input()
if test in ring_double:
	print('Yes')
else:
	print('No')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
sentence = input().lower()
ans = input().lower()
doublesentence = sentence + sentence 
print("Yes" if  ans in doublesentence else "NO")


Failing test case input:
vanbelpowmdegetnad
cdwenbea

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
sentence = input().lower()
ans = input().lower()
doublesentence = sentence + sentence 
print("Yes" if  ans in doublesentence else "No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = input()
p = input()

a = s*2
if a.find(p) > -1:
    print('yes')
else:
    print("no")

Failing test case input:
vbnceknowmedgetoad
cdvanced

Expected output:
No


Actual output:
no


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

s *= 2

if s.find(p) != -1:
    print('Yes')
else:
    print("No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
def main():

    sentence = input()
    phrase = input()

    for i in range(len(sentence)):
        if phrase in sentence:
            print("Yes")
            break
        else:
            sentence = sentence[1:] + sentence[0]
        print("No")

if __name__ == '__main__':
    main()


Failing test case input:
daotegdelwonkecnav
advamce

Expected output:
No


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


Fixed submission (verdict: Accepted):
def main():

    sentence = input()
    phrase = input()
    count = 0
    for _ in range(len(sentence)):
        if phrase in sentence:
            count =  1
            break
        else:
            sentence = sentence[1:] + sentence[0]
    
    if count == 1:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
p,s=[input() for i in range(2)]
p=p*100
if s in p:
    print('Yes')
else:
    print('NO')

Failing test case input:
eanetgfemwopnkbd`v
adbovedc

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
s,p=[input() for i in range(2)]
s=s*100
if p in s:
    print('Yes')
else:
    print('No')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = input()
P = input()
e = s + s
x = len(P)
m = 0
count = 0
for i in range(len(s)):
    if P == e[m:x]:
        count += 1
    m += 1
    x += 1
    if count >= 1:
        print("Yes")
    else:
        print("No")

Failing test case input:
vadbenpowmefgtlnae
ddewobda

Expected output:
No


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


Fixed submission (verdict: Accepted):
s = input()
P = input()
e = s + s
x = len(P)
m = 0
count = 0
for i in range(len(s)):
    if P == e[m:x]:
        count += 1
    m += 1
    x += 1
if count >= 1:
    print("Yes")
else:
    print("No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
import sys
hoge = list()
for line in sys.stdin:
    hoge.append(line)
hoge[0] = hoge[0] + hoge[0]
if hoge[0].find(hoge[1]) == -1:
    print ('No')
else:
    print ('Yes')


Failing test case input:
vanceknowledgetoad
advance

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
hoge = list()
for _ in range(2):
    hoge.append(input())
hoge[0] = hoge[0] + hoge[0]
if hoge[0].find(hoge[1]) == -1:
    print ('No')
else:
    print ('Yes')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = str(input())
p = str(input())
case = s + s
if p in case == True:
	print('yes')
else:
	print('no')


Failing test case input:
vadbenpowmefgtlnae
cdewobda

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
s = str(input())
p = str(input())
case = s + s
if p in case:
	print('Yes')
else:
	print('No')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):


ring = input()
word = input()

ringCut = (ring * 2).split(word)


if ringCut[0] == ring:
    print('No')
else:
    print('Yes')



Failing test case input:
vanbelpowmeegdtnae
deewnbda

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):


ring = input()
word = input()

doubleRing = ring * 2
ringCut = doubleRing.split(word)


if ringCut[0] == doubleRing:
    print('No')
else:
    print('Yes')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = input()
p = input()

s2 = s + s
if s2.find(p):
  print('Yes')
else:
  print('No')


Failing test case input:
vbnbekonwlddgetoad
cdvanced

Expected output:
No


Actual output:
Yes


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

s2 = s + s
if s2.find(p) != -1:
  print('Yes')
else:
  print('No')
Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = input()
s += s
print(s)

key = input()
print(s.find(key))
if s.find(key) != -1: 
    print("Yes")
else:
    print("No")

Failing test case input:
eaovlgedexonkecnat
denavca

Expected output:
No


Actual output:
eaovlgedexonkecnateaovlgedexonkecnat
-1
No


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

key = input()

if s.find(key) != -1: 
    print("Yes")
else:
    print("No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
words = input()
makeword = input()
words = words + words
judge = words.find(words)
if judge != -1:
    print('Yes')
else:
    print('No')


Failing test case input:
eaovlgedewonkecnat
ddnavca

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
words = input()
makeword = input()
words = words + words
if makeword in words:
    print('Yes')
else:
    print('No')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s,p=[input() for i in range(2)]
s=s*100
if p in s:
    print('Yes')
else:
    print('NO')

Failing test case input:
v`dblnpowmefgtenae
adbovedc

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
s,p=[input() for i in range(2)]
s=s*100
if p in s:
    print('Yes')
else:
    print('No')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = input()
p = input()
Ans = False

for i in range(len(s)):
    for j in range(len(p)):
        if i + j >= len(s):
            i = -j
        if s[i + j] != p[j]:
            break
    if j == len(p) - 1:
        Ans = True
        break

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

Failing test case input:
vanceknowledgetoad
advanced

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
p = input()
Ans = False
cnt = 0

for i in range(len(s)):
    for j in range(len(p)):
        if i + j >= len(s):
            i = -j
        if s[i + j] != p[j]:
            break
        cnt += 1
    if cnt == len(p):
        Ans = True
        break
    cnt = 0

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

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = input()
p = input()

S = s+s

index = S.find(str(p))

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

Failing test case input:
vanceknowledgetoad
advance

Expected output:
Yes

Actual output:
No


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

S = s+s

index = S.find(str(p))

if index != -1:
    print ("Yes")
else:
    print("No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s=input()
p=input()
if s.find(p) != p:
  print('Yes')
else:
  print('No')

Failing test case input:
favolgececonkdxtan
nvbcbbd

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s=input()*2
p=input()
if s.find(p) != -1:
  print('Yes')
else:
  print('No')
Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):


def numinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

def main():
    string = input()
    string += string
    p = input()
    
    
    
    if string.find(p): print("Yes")
    else: print("No")

if __name__ == "__main__":
    main()


Failing test case input:
vadbenpowmefgtlnae
deewobda

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):


def numinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

def main():
    string = input()
    string += string
    p = input()
    
    
    
    if string.find(p) >= 0: print("Yes")
    else: print("No")

if __name__ == "__main__":
    main()

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
print("Yes") if (input()*2).find(input())>-1 else "No"


Failing test case input:
vanbeloowlddgdtnad
cdvancee

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
print("Yes") if (input()*2).find(input())>-1 else print("No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s=input()
r=input()
if((s*2).find(r)):
	print('Yes')
else:
	print('No')

Failing test case input:
favomgececonkdxtan
ovbcbbc

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s=input()*2
r=input()
if(r in s):
	print('Yes')
else:
	print('No')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s=[ord(i) for i in input()]
n=[ord(i) for i in input()]
flag=0
flack=0
for i in range(len(s)):
    flack=0
    if n[0]==s[i]:
        flack=1
        for j in range(1,len(n)):
            if i+j>=len(s):
                if n[j]==s[i+j-len(s)]:
                    flack=flack+1
                else:
                    break
            else:
                if n[j]==s[i+j]:
                    flack=flack+1
                else:
                    break
    if flack==len(n):
        flag=1
        break
                
if flag:
    print('yes')
else:
    print('no')

Failing test case input:
eaevlgedoconkextan
dn`cvac

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
s=[ord(i) for i in input()]
n=[ord(i) for i in input()]
flag=0
flack=0
for i in range(len(s)):
    flack=0
    if n[0]==s[i]:
        flack=1
        for j in range(1,len(n)):
            if i+j>=len(s):
                if n[j]==s[i+j-len(s)]:
                    flack=flack+1
                else:
                    break
            else:
                if n[j]==s[i+j]:
                    flack=flack+1
                else:
                    break
    if flack==len(n):
        flag=1
        break
                
if flag:
    print('Yes')
else:
    print('No')
Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = list(input())
p = list(input())
print(len(p))
import sys
t=1

for i in range(len(s)):
	if p[0] == s[i]:
		for j in range(len(p)-1):
			if p[j+1] == s[(i+j+1)%len(s)]:
				t += 1
				
			else:
				t = 0
			if t == len(p):
				
				sys.exit()

if t < len(p):
	print('No')

Failing test case input:
eanetgfemwopnlbdav
adbowedc

Expected output:
No


Actual output:
8
No


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

import sys

for i in range(len(s)):
	t=0
	for j in range(len(p)):
		if p[j] == s[(i+j)%len(s)]:
			t = t+1
			
		else:
			t = 0
		if t == len(p):
			print('Yes')
			sys.exit()

if t < len(p):
	print('No')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
def judg_unit(ss,pp):
    sss = ss + ss + ss
    result = sss.find(pp)
    if result != -1:
        return True
    else :
        return False

s = str(input())
p = str(input())
print(judg_unit(s,p))



Failing test case input:
vadbenpowmefgtlnae
cdewobda

Expected output:
No


Actual output:
False


Fixed submission (verdict: Accepted):
def judg_unit(ss,pp):
    sss = ss + ss + ss
    result = sss.find(pp)
    if result != -1:
        return "Yes"
    else :
        return "No"

s = str(input())
p = str(input())
print(judg_unit(s,p))

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
import sys

lines = [line for line in sys.stdin]
s = lines[0] + lines[0]
p = lines[1]
if s.find(p) != -1:
    print('Yes')
else:
    print('No')

Failing test case input:
vanceknowledgetoad
advance

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
import sys

lines = [line.strip() for line in sys.stdin]
s = lines[0] + lines[0]
p = lines[1].strip()

if s.find(p) != -1:
    print('Yes')
else:
    print('No')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = str(input())
p = str(input())
case = s + s
if p in case == True:
	print('Yes')
else:
	print('No')


Failing test case input:
vanceknowledgetoad
advance

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = str(input())
p = str(input())
case = s + s
if p in case:
	print('Yes')
else:
	print('No')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
r=input()
a=input()
if a in r+r:
	print('yes')


Failing test case input:
vanbeloowldegdtnad
cdwanbee

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
r=input()
a=input()
if a in r+r:
	print('Yes')
else:
	print('No')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = list(input())
p = input()

s.extend(s)
if p in s:
    print("Yes")
else:
    print("No")
print(s)

Failing test case input:
eanetgfemwopnkbd`v
adbcvedo

Expected output:
No


Actual output:
No
['e', 'a', 'n', 'e', 't', 'g', 'f', 'e', 'm', 'w', 'o', 'p', 'n', 'k', 'b', 'd', '`', 'v', 'e', 'a', 'n', 'e', 't', 'g', 'f', 'e', 'm', 'w', 'o', 'p', 'n', 'k', 'b', 'd', '`', 'v']


Fixed submission (verdict: Accepted):
s = input()
p = input()
 
if p in (s * 2):
    print("Yes")
else:
    print("No")
Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
letters=input()
letters=letters+letters
want_find=input()
print(letters)
if letters.find(want_find)>=0:
    print('Yes')
else:
    print('No')

Failing test case input:
favolgececonkdxtan
nvbcbbc

Expected output:
No


Actual output:
favolgececonkdxtanfavolgececonkdxtan
No


Fixed submission (verdict: Accepted):
letters=input()
letters=letters+letters
want_find=input()
if want_find in letters:
    print('Yes')
else:
    print('No')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = input()
p = input()

a = s*2
if a.find(p):
    print('yes')
else:
    print("no")

Failing test case input:
v`dblnpowmefgtenae
adbovedc

Expected output:
No


Actual output:
yes


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

s *= 2

if s.find(p) != -1:
    print('Yes')
else:
    print("No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = input()
p = input()
print('Yes' if p in s*2 else 'Np')


Failing test case input:
favolgececonkdxtan
nvbcbbc

Expected output:
No


Actual output:
Np


Fixed submission (verdict: Accepted):
s = input()
p = input()
print('Yes' if (p in s*2) else 'No')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = input()
p = input()

a = s*2
if a.count(p):
    print('yes')
else:
    print("no")

Failing test case input:
vanceknowledgetoad
cdvanced

Expected output:
No


Actual output:
no


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

s *= 2

if s.find(p) != -1:
    print('Yes')
else:
    print("No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = input().lower()
p = input().lower()

a = s*2
if p in a:
    print('yes')
else:
    print("no")

Failing test case input:
vanceknowledgetoad
cdvanced

Expected output:
No


Actual output:
no


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

s *= 2

if s.find(p) != -1:
    print('Yes')
else:
    print("No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
str_list = input().rstrip()
str_search = input().rstrip()

str_list = str_list + str_list

print(str_search in str_list)

Failing test case input:
vanbelpowmeegetnad
cdewnbea

Expected output:
No


Actual output:
False


Fixed submission (verdict: Accepted):
str_list = input().rstrip()
str_search = input().rstrip()

str_list = str_list + str_list

if str_search in str_list:
    print("Yes")
else:
    print("No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = list(input())
p = list(input())
t=0

for i in range(len(s)):
	if p[0] == s[i]:
		for j in range(len(p)):
			if p[j] == s[(i+j)%len(s)]:
				t += 1
			if t == len(p):
				print('Yes')

if t < len(p):
	print('No')

Failing test case input:
daovegdelwonkecnat
acvamde

Expected output:
No


Actual output:
Yes


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

import sys

for i in range(len(s)):
	t=0
	for j in range(len(p)):
		if p[j] == s[(i+j)%len(s)]:
			t = t+1
			
		else:
			t = 0
		if t == len(p):
			print('Yes')
			sys.exit()

if t < len(p):
	print('No')
Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s=input()*3
print(s)
if s.find(input()) == -1 :
    print('No')
else:
    print('Yes')

Failing test case input:
eaovlgedewonkecnat
ddnavca

Expected output:
No


Actual output:
eaovlgedewonkecnateaovlgedewonkecnateaovlgedewonkecnat
No


Fixed submission (verdict: Accepted):
s=input()*3
if s.find(input()) == -1 :
    print('No')
else:
    print('Yes')

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s=input()
p=input()
ring=s+s
if p in ring :
 print("True")
else :
 print("False")

Failing test case input:
vbnbekonwledgetoad
cdvanced

Expected output:
No


Actual output:
False


Fixed submission (verdict: Accepted):
s=input()
p=input()
ring=s+s
if p in ring :
 print("Yes")
else :
 print("No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
s = input()
p = input()

a = s*2
if p in a:
    print('yes')
else:
    print("no")

Failing test case input:
vanbelpowmeegdtnae
deewnbda

Expected output:
No


Actual output:
no


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

s *= 2

if s.find(p) != -1:
    print('Yes')
else:
    print("No")

Problem: p02418
Buggy submission (Python3, verdict: Wrong Answer):
def main():

    sentence = input()
    phrase = input()

    for i in range(len(sentence)):
        if phrase in sentence:
            print("Yes")
            break
        else:
            sentence = sentence[1:] + sentence[0]
    print("No")

if __name__ == '__main__':
    main()


Failing test case input:
vanceknowledgetoad
advance

Expected output:
Yes

Actual output:
Yes
No


Fixed submission (verdict: Accepted):
def main():

    sentence = input()
    phrase = input()
    count = 0
    for _ in range(len(sentence)):
        if phrase in sentence:
            count =  1
            break
        else:
            sentence = sentence[1:] + sentence[0]
    
    if count == 1:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
_,M,X = list(map(int,input().split()))
a = list(map(int,input().split()))
for i,c in enumerate(a):
    print(i,c,X)
    if X < c:
        print(min(i,M-i))
        break

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
0 1 3
1 2 3
2 4 3
1


Fixed submission (verdict: Accepted):
_,M,X = list(map(int,input().split()))
a = list(map(int,input().split()))
for i,c in enumerate(a):
    if X < c:
        print(min(i,M-i))
        break

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,x = map(int,input().split())
a = list(map(int,input().split()))
c = 0
d = 0
for i in range(1,x-1):
    if i in a:
        c += 1
for i in range(x+1,n-1):
    if i in a:
        d += 1
print(min(c,d))


Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
n,m,x = map(int,input().split())
a = list(map(int,input().split()))
c = 0
d = 0
for i in range(x):
    if i in a:
        c += 1
for i in range(x+1,n+1):
    if i in a:
        d += 1
print(min(c,d))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m, x = map(int, input().split())
fee = set(input().split())
ls = list(range(n+1))
f, b = ls[:x], ls[x+1:]
print(min(len(fee & set(f)), len(fee & set(b))))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
n, m, x = map(int, input().split())
fee = set(map(int, input().split()))
ls = list(range(n+1))
f, b = ls[:x], ls[x+1:]
print(min(len(fee & set(f)), len(fee & set(b))))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,x = map(int,input().split())
li = list(map(int,input().split()))
if x < li[0] or x > li[m-1] :
    print(0)
else :
    for i in range(m-1) :
        print(min(i+1,m-i-1))


Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
1
1


Fixed submission (verdict: Accepted):
n,m,x = map(int,input().split())
li = list(map(int,input().split()))
if x < li[0] or x > li[m-1] :
    print(0)
else :
    for i in range(m-1) :
        if x > li[i] and x < li[i+1] :
            print(min(i+1,m-i-1))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m, x = map(int, input().split())
l = list(map(int, input().split()))
left = 0
right = 0
i = 0
while i < x:
    if i in l:
        left += 1
    i += 1
j = n-1
while j > x+1:
    if j in l:
        right += 1
    j -= 1

print(min(left, right))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
n, m, x = map(int, input().split())
l = list(map(int, input().split()))
left = 0
right = 0
i = 0
while i < x:
    if i in l:
        left += 1
    i += 1
j = n-1
while j > x:
    if j in l:
        right += 1
    j -= 1

print(min(left, right))
Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m, x = map(int, input().split())
c = [0] * n
for i in (map(int, input().split())):
  c[i - 1] = 1
if m > x:
  m, x = x , m
print(sum(c[m - 1:x]))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
n, m, x = map(int, input().split())
c = [0] * (n + 1)
for i in (map(int, input().split())):
  c[i] = 1
print(min(sum(c[0:x]), sum(c[x:-1])))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,x=map(int,input().split())
a=list(map(int,input().split()))
print(a)
print(min((len([i for i in a if i<x])),(len([i for i in a if i>x]))))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
[1, 2, 4]
1


Fixed submission (verdict: Accepted):
n,m,x=map(int,input().split())
a=list(map(int,input().split()))
print(min((len([i for i in a if i<x])),(len([i for i in a if i>x]))))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M, X = map(int, input('N M X = ').split())
A = map(int, input('A_{i}(i=1,2,…,M)= ').split()) 

setA = set(A) 
s1 = range(0, X)
s2 = range(X, N+1)
a1 = set(s1) & (setA) 
a2 = set(s2) & (setA)
cost1 = len(a1)
cost2 = len(a2)

if cost1 >= cost2:
    print(cost2)
else:
    print(cost1)

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
N M X = A_{i}(i=1,2,…,M)= 1


Fixed submission (verdict: Accepted):
N, M, X = map(int, input().split())
A = map(int, input().split()) 

setA = set(A) 
s1 = range(0, X)
s2 = range(X, N+1)
a1 = set(s1) & (setA)
a2 = set(s2) & (setA)
cost1 = len(a1)
cost2 = len(a2)

if cost1 >= cost2:
    print(cost2)
else:
    print(cost1)

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m, x = map(int, input().split())
li = list(map(int, input().split()))

print(min(sum(li[:x]), sum(li[x+1:])))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
n, m, x = map(int, input().split())
li = list(map(int, input().split()))

li = [1 if i in li else 0 for i in range(1, n+1)]

print(min(sum(li[:x-1]), sum(li[x:])))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m, x = map(int, input().split())
li = list(map(int, input().split()))


print(min(len(li[:x]), len(li[x+1:])))


Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
n, m, x = map(int, input().split())
li = list(map(int, input().split()))

li = [1 if i in li else 0 for i in range(1, n+1)]

print(min(sum(li[:x-1]), sum(li[x:])))
Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input_data = input().replace("\n", " ").split(" ")

n, m, x = int(input_data[0]), int(input_data[1]), int(input_data[2])


def problemB(n, m, x):
    masu_list = [0] * (n+1)
    adder = input_data[3:]

    for i in adder:
        masu_list[int(i)] = 1
    front = sum(masu_list[:x])
    back = sum(masu_list[x+1:])

    if front <= back:
        return print(front)

    else:
        return print(back)


problemB(n, m, x)

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
input_front = input().split(" ")
input_back = input().split(" ")
n, x = int(input_front[0]), int(input_front[2])


def problemB(n, x):
    masu_list = [0] * (n+1)
    adder = input_back

    for i in adder:
        masu_list[int(i)] = 1
    front = sum(masu_list[:x])
    back = sum(masu_list[x+1:])

    if front <= back:
        return print(front)

    else:
        return print(back)


problemB(n, x)

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M, X=map(int, input().split())
sum=sum(int(i)<X for i in input().split())
print(min(sum, N-sum))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
N, M, X=map(int, input().split())
sum=sum(int(i)<X for i in input().split())
print(min(sum, M-sum))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m, x = map(int, input().split())
a=list(map(int, input().split()))
cost=0
for i in range(m):
  if a[i]>x:
    cost+1
print(cost)

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
n, m, x = map(int, input().split())
a=list(map(int, input().split()))
upcost=0
downcost=0
for i in range(m):
  if a[i]>x:
    upcost+=1
  else:
    downcost+=1
print(min(upcost, downcost))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,x=map(int,input().split())
a=list(map(int,input().split()))

keep=0
hidari=1
while keep<x:
  keep=a[hidari]
  hidari+=1
  
print(min(hidari,m-hidari-1))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
-1


Fixed submission (verdict: Accepted):
n,m,x=map(int,input().split())
a=list(map(int,input().split()))

keep=0
hidari=a[0]
while hidari<x and keep<=m:
  keep+=1
  hidari=a[keep]
  
print(min(keep,m-keep))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,X = map(int,input().split())
A = list(map(int,input().split()))
for i,x in enumerate(A):
  if x > X:
    t = i
    break

print(t,M-t)

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
2 1


Fixed submission (verdict: Accepted):
N,M,X = map(int,input().split())
A = list(map(int,input().split()))
for i,x in enumerate(A):
  if x > X:
    t = i
    break

print(min(t,M-t))
Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m, x = map(int, input().split())
fee = map(int, input().split())
ls = list(range(n+1))
f, b = ls[:x], ls[x+1:]
print(min(len(set(fee) & set(f)), len(set(fee) & set(b))))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
n, m, x = map(int, input().split())
fee = set(map(int, input().split()))
ls = list(range(n+1))
f, b = ls[:x], ls[x+1:]
print(min(len(fee & set(f)), len(fee & set(b))))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,x=map(int,input().split())
*a,=map(int,input().split())
cst_0=0
cst_n=0
for i in range(1,x):
	if (x-i) in a:
		cst_0 += 1
for i in range(x+1,n):
	if i in a:
		cst_n += 1
ans=min(cst_0,cst_n)

	

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:

Fixed submission (verdict: Accepted):
n,m,x=map(int,input().split())
*a,=map(int,input().split())
cst_0=0
cst_n=0
for i in range(1,x):
	if (x-i) in a:
		cst_0 += 1
for i in range(x+1,n):
	if i in a:
		cst_n += 1
ans=min(cst_0,cst_n)
print(ans)

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


N,M,X = map(int,input().split()) 
a = list(map(int,input().split()))

b=[]
c=[]
for i in range(X+1,N): 
  if i in a: 
    b.append(1)
for i in range(1,X): 
  if i in a: 
    c.append(1)
print(sum(c))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):


N,M,X = map(int,input().split()) 
a = list(map(int,input().split()))

b=[]
c=[]
for i in range(X+1,N): 
  if i in a: 
    b.append(1)
for i in range(1,X): 
  if i in a: 
    c.append(1)
print(min(sum(b),sum(c)))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import bisect

n,m,x = map(int,input().split())
l = list(map(int,input().split()))
index = bisect.bisect_left(l,x)
print(min(index,n-index))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
import bisect

n,m,x = map(int,input().split())
l = list(map(int,input().split()))
index = bisect.bisect_left(l,x)
print(min(index,m-index))

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


if __name__ == "__main__":
	N, M, X = list(map(int, input().split()))
	As = list(map(int, input().split()))
	cost = 0
	for A in As:
		if X > A:
			break
		cost += 1
	print(max(cost, M-cost))


Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
3


Fixed submission (verdict: Accepted):


if __name__ == "__main__":
	N, M, X = list(map(int, input().split()))
	As = list(map(int, input().split()))
	cost = 0
	for A in As:
		if A > X:
			break
		cost += 1
	print(min(cost, M-cost))
Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M, X = map(int, input().split())
A = list(map(int,input().split()))
print(A)
for i in range(M-1):
  if A[0] > X or A[M-1] < X:
    print(0)
    break
  elif A[i] < X < A[i+1]:
    print(min(i+1, M-i-1))
    break

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
[1, 2, 4]
1


Fixed submission (verdict: Accepted):
N, M, X = map(int, input().split())
A = list(map(int,input().split()))
for i in range(M-1):
  if A[0] > X or A[M-1] < X:
    print(0)
    break
  elif A[i] < X < A[i+1]:
    print(min(i+1, M-i-1))
    break

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m, x = map(int, input().split())
a_tmp = input().split()
a = []
for _ in a_tmp:
    a.append(int(_))
cost_l = 0
cost_r = 0
j = 0
for i in range(n+1):
    if i < x:
        if i == a[j]:
            cost_l += 1
            j += 1
            if j >= len(a):
                break
    elif x < i:
        if i == a[j]:
            cost_r += 1
            j += 1
            if j >= len(a):
                break
    else:
        continue
print(cost_l, cost_r)
print(min(cost_l, cost_r))


Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
2 1
1


Fixed submission (verdict: Accepted):
n, m, x = map(int, input().split())
a_tmp = input().split()
a = []
for _ in a_tmp:
    a.append(int(_))
cost_l = 0
cost_r = 0
j = 0
for i in range(n+1):
    if i < x:
        if i == a[j]:
            cost_l += 1
            j += 1
            if j >= len(a):
                break
    elif x < i:
        if i == a[j]:
            cost_r += 1
            j += 1
            if j >= len(a):
                break
    else:
        continue
print(min(cost_l, cost_r))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,x = map(int,input().split())
A = list(map(int,input().split()))

ans1 = len([a for a in A if a <x])
ans2 = len([a for a in A if a < x])
print(min(ans1,ans2))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
n,m,x = map(int,input().split())
A = list(map(int,input().split()))

ans1 = len([a for a in A if a < x])
ans2 = len([a for a in A if a > x])
print(min(ans1,ans2))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M, X = map(int, input().split())
A = list(map(int, input().split()))
cnt1 = 0
cnt2 = 0
i = 0
j = 0
while i <= N:
  if i in A:
    cnt1 += 1
  i += 1
while j >= 0:
  if j in A:
    cnt2 += 1
  j -= 1
print(min(cnt1, cnt2))


Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
N, M, X = map(int, input().split())
A = list(map(int, input().split()))
cnt1 = 0
cnt2 = 0
i = X
j = X
while i <= N:
  if i in A:
    cnt1 += 1
  i += 1
while j >= 0:
  if j in A:
    cnt2 += 1
  j -= 1
print(min(cnt1, cnt2))
Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
  N, M, X = map(int, input().split())
  a = [0] + list(map(int, input().split())) + [N]
  
  i = 0
  while a[i] < N:
    i += 1
  print(min(i-1, M + 1 - i))

if __name__ == "__main__":
  main()

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
def main():
  N, M, X = map(int, input().split())
  a = list(map(int, input().split()))
  
  i = 0
  while i < M:
    if a[i] > X:
      break
    i += 1
  print(min(i, M - i))

if __name__ == "__main__":
  main()

Problem: p03378
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, M, X = map(int, input().split())
A = list(map(int, input().split()))
c = [0 for i in range(N+1)]
for a in A:
  c[a] = 1
ans = sum(A[:X+1])
print(min(ans, M-ans))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
-4


Fixed submission (verdict: Accepted):
N, M, X = map(int, input().split())
A = list(map(int, input().split()))
c = [0 for i in range(N+1)]
for a in A:
  c[a] = 1
ans = sum(c[:X+1])
print(min(ans, M-ans))

Problem: p03378
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import bisect

n,m,x=map(int,input().split())
a =list(map(int,input().split()))

l=bisect.bisect_left(a,x)
r=m-l
print(min(x+l,n-x+r))


Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
3


Fixed submission (verdict: Accepted):
import bisect
 
n,m,x=map(int,input().split())
a =list(map(int,input().split()))
 
l=bisect.bisect_left(a,x)
r=m-l
print(min(l,r))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from bisect import bisect_right

N,M,X = map(int,input().split())
A = list(map(int,input().split()))

left = bisect_right(A,X)
right = N - left

l = X - left
r = N - X - right
print(min(l,r))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
-1


Fixed submission (verdict: Accepted):
from bisect import bisect_right

N,M,X = map(int,input().split())
A = list(map(int,input().split()))

left = bisect_right(A,X)
right = len(A) - left

print(min(left,right))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,x=map(int,input().split())
s=sum(int(i)<x for i in input().split())
print(min(s,s-m))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
-1


Fixed submission (verdict: Accepted):
n,m,x=map(int,input().split())
s=sum(int(i)<x for i in input().split())
print(min(s,m-s))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import bisect
N, M, X = map(int, input().split())
lst = list(map(int, input().split()))

a = bisect.bisect_left(lst, M)
print(min(N-a, a))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
import bisect
N, M, X = map(int, input().split())
lst = list(map(int, input().split()))

a = bisect.bisect_left(lst, X)
print(min(M-a, a))