ZhenlongDai/ACPR huggingface dataset:
Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


N,M,X = map(int,input().split()) 
a = [int(i) for i in range(M)] 
b=[]
c=[]
for i in range(X,N): 
  if i in a is True: 
    b.append(1)
for i in range(1,X): 
  if i in a is True: 
    c.append(1)
print(min(sum(b),sum(c)))

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()))

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):
n, m, x = map(int, input().split())
a = list(map(int, input().split()))
ansn = 0
ans0 = 0
for i in range(x, n):
    if i in a:
        ansn += 1

for i in range(x, 0):
    if i in a:
        ans0 += 1

print(min(ansn,ans0))

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()))
ansn = 0
ans0 = 0
for i in range(x, n):
    if i in a:
        ansn += 1

for i in range(x, 0, -1):
    if i in a:
        ans0 += 1

print(min(ansn,ans0))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l = list(map(int,input().split()))
a = list(map(int,input().split()))
b = []
c = []
for n in a:
    if n > l[2]:
        b.append(n)
    else:
        c.append(n)
if l[2] - l[1] <= l[1]:
    print('{}'.format(len(c)))
else:
    print('{}'.format(len(b)))


Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
l = list(map(int,input().split()))
a = list(map(int,input().split()))
b = []
c = []
for n in a:
    if n > l[2]:
        b.append(n)
    else:
        c.append(n)
print('{}'.format(min(len(b),len(c))))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,X = map(int,input().split())
A = list(map(int,input().split()))
count = 0
B = []
if N == X:
  print(0)
else:
  for x in range(X,N+1):
    if x in A:
      count += 1
  B.append(count)
  count = 0
  for x in range(0,X+1,-1):
    if x in A:
      count += 1
  B.append(count)
  print(min(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())
A = list(map(int,input().split()))
count = 0
B = []
if N == X:
  print(0)
else:
  for x in range(X,N+1):
    if x in A:
      count += 1
  B.append(count)
  count = 0
  for x in range(X,0,-1):
    if x in A:
      count += 1
  B.append(count)
  print(min(B))

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,j in enumerate(a):
  if x < j:
    print(min(i,n-i))
    break

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()))
for i,j in enumerate(a):
  if x < j:
    print(min(i,m-i))
    break
Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m, x = map(int, input().split())
count1 = x
count2 = n - x
for a in map(int, input().split()):
  if a < x:
    count1 += 1
  else:
    count2 += 1

print(min(count1, count2))


Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
3


Fixed submission (verdict: Accepted):
n, m, x = map(int, input().split())
count1 = 0
count2 = 0
for a in map(int, input().split()):
  if a < x:
    count1 += 1
  else:
    count2 += 1

print(min(count1, count2))

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


N,M,X = map(int,input().split()) 
a = [int(i) for i in range(M)] 
b=[]
c=[]
for i in range(X+1,N): 
  if i in a is True: 
    b.append(1)
for i in range(1,X): 
  if i in a is True: 
    c.append(1)
print(min(sum(b),sum(c)))

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()))

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):
a=[int(x) for x in input().split()]
n = a[0]
m = a[1]
x = a[2]
arr = a[3:3+m]
goLeft = 0
goRight = 0
for i in arr:
    if i < x:
        goLeft += 1
    else:
        goRight += 1
if goLeft > goRight:
    print(goRight)
else:
    print(goLeft)

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
n,m,x=[int(x) for x in input().split()]
arr=[int(x) for x in input().split()]
goLeft = 0
goRight = 0
for i in arr:
    if i < x:
        goLeft += 1
    else:
        goRight += 1
print(min(goLeft,goRight))

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

for b in a:
    c += 1
    if x < b:
        if c < (m/2):
            print(c)
        else:
            print(m-c)
        break

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

for b in a:
    c += 1
    if x < b:
        c -= 1
        if c < (m/2):
            print(c)
        else:
            print(m-c)
        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()))
N_cost=len([i>X for i in A])
Z_cost=len([i<X for i in A])
print(min(N_cost,Z_cost))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
3


Fixed submission (verdict: Accepted):
N,M,X=map(int,input().split())
A=list(map(int,input().split()))
N_cost=len(list(filter(lambda x:x >X, A)))
Z_cost=len(list(filter(lambda x:x <X, A)))
print(min(N_cost,Z_cost))
Problem: p03378
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, m, x = map(int, input().split())
a = map(int, input().split())
print(min(sum([1 for i in a if i>x]),sum([1 for i in a if i<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())
a = list(map(int, input().split()))
print(min(sum([1 for i in a if i>x]),sum([1 for i in a if i<x])))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m, x = input().split()
n = int(n)
m = int(m)
x = int(x)
c = [0 for _ in range(n+1)]
a = input().split()
for i in range(m):
    c[int(a[i])]=1
min(sum(c[:x]),sum(c[x:]))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:

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

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,x=map(int,input().split())
b=[0]*(n+1)
A=list(map(int,input().split()))
for a in A:
  b[a]=1
c=0
for i in range(x):
  c+=b[i]
print(n-c if c>=n-c else 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())
b=[0]*(n+1)
A=list(map(int,input().split()))
for a in A:
  b[a]=1
c=0
for i in range(x):
  c+=b[i]
print(m-c if c>=m-c else c)

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

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 = list(map(int, input().split()))
print(min(len([b for b in a if b < x]), len([c for c in a if c >x])))

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[-1] < X:
    print(0)
  elif A[i] < X < A[i+1]:
    print(min(i+1, M-i-1))

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 = map(int, input().split())
r = 0
l = 0
for a in A:
	if a > x:
		r += 1
	else:
		l += 1
print(max(r, l))

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 = map(int, input().split())
r = 0
l = 0
for a in A:
	if a > x:
		r += 1
	else:
		l += 1
print(min(r, l))
Problem: p03378
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,m,x=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
print(min(sum(a[:n]),sum(a[n:])))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
n,m,x=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
retsu=[0]*n
for ai in a:
    retsu[ai]=1
print(min(sum(retsu[:x]),sum(retsu[x:])))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M, X = map(int, input().split())
list =  map(int, input().split())
A = sum(x>X for x in list)
B = sum(x<X for x in list)
if A >= B:
  print(B)
else:
  print(A)

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())
list = list(map(int, input().split()))
A = sum(n > X for n in list)
B = sum(n < X for n in list)
if A >= B:
  print(B)
else:
  print(A)

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

ans_N = (N+1) - bisect.bisect_left(A, X)
ans_0 = bisect.bisect_left(A,X)
print(min(ans_N,ans_0))

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())
A = list(map(int,input().split()))

ans_N = M - bisect.bisect_left(A,X)
ans_0 = bisect.bisect_left(A,X)
print(min(ans_N,ans_0))

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


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.8.2), verdict: Wrong Answer):
import bisect
N,M,X = map(int,input().split())
A = list(map(int,input().split()))

ans_N = N - bisect.bisect_left(A, X)
ans_0 = bisect.bisect_left(A,X)
print(min(ans_N,ans_0))

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())
A = list(map(int,input().split()))

ans_N = M - bisect.bisect_left(A,X)
ans_0 = bisect.bisect_left(A,X)
print(min(ans_N,ans_0))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from bisect import bisect_left
N, M, X = map(int,input().split())
A = list(map(int,input().split()))
index = bisect_left(A, X)
ans = min(index, M - index)

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:

Fixed submission (verdict: Accepted):
from bisect import bisect_left
N, M, X = map(int,input().split())
A = list(map(int,input().split()))
index = bisect_left(A, X)
ans = min(index, M - index)
print(ans)
Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N, M, X = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for i in reversed(range(X)):
    if i in a:
        ans += 1
print(ans)


Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N, M, X = map(int, input().split())
a = list(map(int, input().split()))
l = [0]*(N+1)
for i in a:
    l[i] += 1
print(min(sum(l[0:X]), sum(l[X+1: N+1])))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M, X = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]

cell = [0] * (N+1)

for a in A:
    cell[a] = 1
print(cell)
print(min(sum(cell[:X]), sum(cell[X:])))


Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
[0, 1, 1, 0, 1, 0]
1


Fixed submission (verdict: Accepted):
N, M, X = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]

cell = [0] * (N+1)

for a in A:
    cell[a] = 1
print(min(sum(cell[:X]), sum(cell[X:])))

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,j in enumerate(a):
  if j > x:
    cnt = i
    break
print(min(cnt, m-cnt+1))


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()))
for i,j in enumerate(a):
  if j > x:
    cnt = i
    break
print(min(cnt, m-cnt))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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]), 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())
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(max(left, right))

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())
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(" "))
A = map(int, input().split(" "))
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:
0


Fixed submission (verdict: Accepted):
N, M, X = map(int, input().split(" "))
A = map(int, input().split(" "))
left, right = 0,0
for ai in A:
  if ai < X: left+=1
  else: right+=1
print(min(right, left))

Problem: p03378
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, M, X = map(int, input().split())
A = list(map(int, input().split()))

for i , a in enumerate(A):
    if X < a:
        break

if i > len(A) / 2:
    ans = len(A[:i])
else:
    ans = len(A[:i])

print(ans)

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()))

for i , a in enumerate(A):
    if X < a:
        break

if i > len(A) / 2:
    ans = len(A[i:])
else:
    ans = len(A[:i])

print(ans)

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l = input().split()
N = int(l[0])
M = int(l[1])
X = int(l[2])
cost1 = 0
cost2 = 0
j = 0
k = input().split()
for e in k:
    if int(e) >= X:
        j = k.index(e)
    cost1 = cost1 + 1

for i in range(j, M):
    cost2 = cost2 + 1
if cost1 > cost2:
    print(cost1)
else:
    print(cost2)


Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
3


Fixed submission (verdict: Accepted):
l = input().split()
N = int(l[0])
M = int(l[1])
X = int(l[2])
cost1 = 0
cost2 = 0
j = 0
k = input().split()
for e in k:
    if int(e) >= X:
        j = k.index(e)
        break
    cost1 = cost1 + 1

for i in range(j, M):
    cost2 = cost2 + 1
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())
if m > x:
  m, x = x, m

c = [i for i in (map(int, input().split())) if m < i < x]
print(sum(c))

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):
box_l, _, start = map(int, input().split())
arr = [0]*(box_l+1)
cost_arr = list(map(int, input().split()))
for num in cost_arr:
  arr[num] = 1
print(sum(min(arr[:start+1],arr[start+1:])))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
box_l, _, start = map(int, input().split())
cost_arr = list(map(int, input().split()))
left = len([num for num in cost_arr if num < start])
right = len([num for num in cost_arr if num > start])
print(min(left, right))
Problem: p03378
Buggy submission (Python (3.8.2), verdict: Wrong Answer):


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

goto_goal_0 = 0 
goto_goal_n = 0 


for i in range(x - 1, 0, -1):   
    if i in a:
        goto_goal_0 += 1
        


for i in range(x, n + 1):   
    if i in a:
        goto_goal_n += 1
        print("n is {}".format(goto_goal_n))

if goto_goal_0 < goto_goal_n:
    print(goto_goal_0)
else:
    print(goto_goal_n)


Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
n is 1
1


Fixed submission (verdict: Accepted):


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

goto_goal_0 = 0 
goto_goal_n = 0 


for i in range(x - 1, 0, -1):   
    if i in a:
        goto_goal_0 += 1
        


for i in range(x, n + 1):   
    if i in a:
        goto_goal_n += 1
        

if goto_goal_0 < goto_goal_n:
    print(goto_goal_0)
else:
    print(goto_goal_n)

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

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()))
c1,c2=0,0
for i in a:
  if i < x:
    c1+=1
  else:
    c2+=1
print(min(c1,c2))

Problem: p03378
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a = [input().split() for l in range(2)]
print(a)

N = int(a[0][0]) 
M = int(a[0][1]) 
X = int(a[0][2]) 

goal_len01 = N - X 
goal_len02 = X 

cost1 = 0
for i in range(goal_len01):
  if str(X+i+1) in a[1]:
    cost1 += 1

cost2 = 0
for i in range(goal_len02):
  if str(i+1) in a[1]:
    cost2 += 1

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

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
[['5', '3', '3'], ['1', '2', '4']]
1


Fixed submission (verdict: Accepted):
a = [input().split() for l in range(2)]

N = int(a[0][0]) 
M = int(a[0][1]) 
X = int(a[0][2]) 

goal_len01 = N - X 
goal_len02 = X 

cost1 = 0
for i in range(goal_len01):
  if str(X+i+1) in a[1]:
    cost1 += 1

cost2 = 0
for i in range(goal_len02):
  if str(i+1) in a[1]:
    cost2 += 1

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

Problem: p03378
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S_list = [input() for i in range(2)]
N, M, X= map(int,S_list[0].split())    
A_list = list(map(int,S_list[1].split()))

A_goal_N = [i for i in A_list if X < i and i < N]
A_goal_0 = [i for i in A_list if 0 < i and i < X]
result = min(A_goal_N,A_goal_0)
print(len(result))

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
S_list = [input() for i in range(2)]
N, M, X= map(int,S_list[0].split())    
A_list = list(map(int,S_list[1].split()))

A_goal_N = [i for i in A_list if X < i and i < N]
A_goal_0 = [i for i in A_list if 0 < i and i < X]
result = min(len(A_goal_N),len(A_goal_0))
print(result)
Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,X = (int(i) for i in input().split())
A = list(map(int,input().split()))
print(A)
small = 0
big = 0
for j in A:
    if j < X:
        continue
    else:
        small=small+1

for j in A:
    if j > X:
        continue
    else:
        big=big+1



if big>=small:
    print(small)
else:
    print(big)


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 = (int(i) for i in input().split())
A = list(map(int,input().split()))

small = 0
big = 0
for j in A:
    if j < X:
        continue
    else:
        small=small+1

for j in A:
    if j > X:
        continue
    else:
        big=big+1



if big>=small:
    print(small)
else:
    print(big)

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,X =(map(int,input().split()))
A =list(map(int,input().split()))
min(sum(a>X for a in A),sum(a<X for a in A))

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 =list(map(int,input().split()))
print(min(sum(a>X for a in A),sum(a<X for a in A)))

Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M, X = map(int, input().split(" "))
A = map(int, input().split(" "))
print(min([len([i for i in A if i >= X+1]), len([i for i in A if i <= 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(" "))
A = map(int, input().split(" "))
left, right = 0,0
for ai in A:
  if ai < X: left+=1
  else: right+=1
print(min(right, left))

Problem: p03378
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, M, X = map(int,input().split())
A = list(map(int,input().split()))
ans = []
z = 0
y = 0
for i in range(X + 1, N + 1):
    if  i in A:
        z += 1
    print(z)
ans.append(z)
for i in range(1,X):
    if  i in A:
        y += 1
    print(y)
ans.append(y)
ans = sorted(ans)
print(ans)
print(ans[0])

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
1
1
1
2
[1, 2]
1


Fixed submission (verdict: Accepted):
N, M, X = map(int,input().split())
A = list(map(int,input().split()))
ans = []
z = 0
y = 0
for i in range(X + 1, N + 1):
    if  i in A:
        z += 1
ans.append(z)
for i in range(1,X):
    if  i in A:
        y += 1
ans.append(y)
ans = sorted(ans)
print(ans[0])

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 in range(n):
    if(x < a[i]):
        print(min(i, len(a) - (i - 1)))
        exit()

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()))
for i in range(n):
    if(x < a[i]):
        print(min(i, m-i))
        exit()
Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M, X =map(int,input().split())
A = list(map(int,input().split()))

t= [i for i in A if i> 0 and i< X]
s= [i for i in A if i> X and i >N]

print(min(len(t),len(s)))

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()))

t= [i for i in A if i> 0 and i< X]
s= [i for i in A if i> X and i<N]

print(min(len(t),len(s)))

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

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())
l=[0for i in range(n+1)]
for i in map(int,input().split()):
  l[i]=1
for i in range(1,n+1):
  l[i]+=l[i-1]
print(min(l[x],l[n]-l[x]))

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 in range(m):
    if a[i]>x:
        p=i
        break
if x<a[0]:
    p=0
print(p)
print(min(p,m-p))
        


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 in range(m):
    if a[i]>x:
        p=i
        break
if x<a[0]:
    p=0
print(min(p,m-p))

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: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 = sorted([int(i) for i in input().split()] + [X])
start = A.index(X)
print(min((len(range(start, M+1, -1)), len(range(start, M+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())
a = {int(i) for i in input().split()}
l = set(range(0, X+1))
r = set(range(X, N+1))
print(min([len(a.intersection(l)) , len(a.intersection(r))]))
Problem: p03378
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,X = (int(i) for i in input().split())
places = input()
placelistchar = places.split(" ")

placelist = []
for k in range(M):
    placelist.append(int(placelistchar[k]))

print(placelist)


countbig = 0
countsmall = 0




for i in range(X+1,N):
    if (i in placelist == True):
        countbig = countbig +1
for j in range(0,X):
    if (j in placelist == True):
        countsmall = countsmall + 1

print(min(countsmall,countbig))
    
        

Failing test case input:
5 3 3
1 2 4

Expected output:
1

Actual output:
[1, 2, 4]
0


Fixed submission (verdict: Accepted):
N,M,X = (int(i) for i in input().split())
places = input()
placelistchar = places.split(" ")

placelist = []
for k in range(M):
    placelist.append(int(placelistchar[k]))


countbig = 0
countsmall = 0


for i in range(0,N):
    if(i in placelist):
        if i<X:
            countsmall += 1
        else:
            countbig += 1

print(min(countsmall,countbig))
Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
result=""
count=0
l=len(s)
if s[0]!="A":
  result="WA"
elif ord(s[1:2])<97 or ord(s[l-1])<97:
  result="WA"
for i in s[2:l-1]:
  if ord(i)<97:
    count+=1
  if count>1:
    result="WA"
    break
if count==0:
  result="WA"
print(result)


Failing test case input:
AtCoder

Expected output:
AC

Actual output:

Fixed submission (verdict: Accepted):
s=input()
result=""
count=0
l=len(s)
if s[0]!="A":
  result="WA"
elif ord(s[1:2])<97 or ord(s[l-1])<97:
  result="WA"
for i in s[2:l-1]:
  if ord(i)<97:
    count+=1
  if ord(i)<97 and i!="C":
    result="WA"
    break
  if count>1:
    result="WA"
    break
if count==0:
  result="WA"
if result!="WA":
  result="AC"
print(result)

Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) 


if __name__ == '__main__':
    s = input()
    count =0

    for i in range(len(s)):
        if s[0] != "A":
            count += 2
        if s[i] =="C" :
            if i < len(s)-1 and i >1:
                count +=1
            else:
                count+=2
        elif ord(s[i]) <=97 and ord(s[i]) >=122:
            count += 2

    if count == 1:
        print("AC")
    else:
        print("WA")



Failing test case input:
AtBnCo

Expected output:
WA


Actual output:
AC


Fixed submission (verdict: Accepted):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) 


if __name__ == '__main__':
    s = input()
    count =0

    for i in range(len(s)):
        if s[0] != "A":
            count += 2
        if s[i] =="C" :
            if i < len(s)-1 and i >1:
                count +=1
            else:
                count+=2
        elif i>0 and ( ord(s[i]) <97 or ord(s[i]) >122):
            count += 2

    if count == 1:
        print("AC")
    else:
        print("WA")

Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
    S2 = S[1] + S[2:-1].replace('C', '')
    if S2 == S.lower():
        print('AC')
        exit()
print('WA')

Failing test case input:
AtCoddr

Expected output:
AC


Actual output:
WA


Fixed submission (verdict: Accepted):
S = input()
if S[0] == 'A' and S[2:-1].count('C') == 1:
    S = S[1] + S[2:-1].replace('C', '') + S[-1]
    if S == S.lower():
        print('AC')
        exit()
print('WA')
Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
n = len(s)
cnt = 0
alpha = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
for i in range(n):
  if i == 0:
    if s[0] != 'A':
      print('WA')
      break
    s = 'a' + s[1:]
  if 2 <= i < n-1:
    if s[i] == 'C':
      cnt += 1
      if cnt == 2:
        print('WA')
        break
      s = s[:i] + 'c' + s[i+1:]
  if s[i] in alpha:
    print('WA')
    break
else:
  print('AC')

Failing test case input:
Accrteo

Expected output:
WA


Actual output:
AC


Fixed submission (verdict: Accepted):
s = input()
n = len(s)
cnt = 0
alpha = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
for i in range(n):
  if i == 0:
    if s[0] != 'A':
      print('WA')
      break
    s = 'a' + s[1:]
  if 2 <= i < n-1:
    if s[i] == 'C':
      cnt += 1
      if cnt == 2:
        print('WA')
        break
      s = s[:i] + 'c' + s[i+1:]
  if i == n-1:
    if cnt == 0:
      print('WA')
      break
  if s[i] in alpha:
    print('WA')
    break
else:
  print('AC')

Problem: p03289
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = list(input())
c = 0
flag = 0
if S[0] == "A":
    for i in range(len(S)-3):
        if S[2+i] == "C":
            c += 1
            this = 2+i
    if c == 1:
        S.pop(this)
        S.pop(0)

    for i in S:
        if ord(i) < 97:
            break
        else:
            flag = 1

if flag == 1:
    print("AC")
else:
    print("WA")

Failing test case input:
AtBnCo

Expected output:
WA


Actual output:
AC


Fixed submission (verdict: Accepted):
S = list(input())
c = 0
flag = 0
if S[0] == "A":
    for i in range(len(S)-3):
        if S[2+i] == "C":
            c += 1
            this = 2+i
    if c == 1:
        S.pop(this)
        S.pop(0)

    for i in S:
        if ord(i) < 97:
            flag = 0
            break
        else:
            flag = 1

if flag == 1:
    print("AC")
else:
    print("WA")

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

ac = True

if S[0] != "A":
    ac = False

cnt = 0
for s in S[2:-2]:
    if s == "C":
        cnt += 1
if cnt != 1:
    ac = False

for s in S[1:]:
    if s != "C" and s.isupper():
        ac = False

if ac:
    print("AC")
else:
    print("WA")

Failing test case input:
AtCoCo

Expected output:
WA

Actual output:
AC


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

ac = True

if S[0] != "A":
    ac = False

cnt = 0
for s in S[2:-1]:
    if s == "C":
        cnt += 1
if cnt != 1:
    ac = False

for s in S[1:]:
    if s != "C" and s.isupper():
        ac = False

if ac:
    print("AC")
else:
    print("WA")
Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
  s = list(input())

  print(s)

  if s[0] != 'A':
    print('WA')
    return

  C_counter = 0
  for n in s[2:-1]:    
    if n == 'C':
      C_counter += 1

  if C_counter != 1:
    print('WA')
    return

  for n in s:
    if n == 'A' or n == 'C':
      continue
    if not n.islower():
      print('WA')
      return
  print('AC')
  return




main()

Failing test case input:
AcycliC

Expected output:
WA

Actual output:
['A', 'c', 'y', 'c', 'l', 'i', 'C']
WA


Fixed submission (verdict: Accepted):
def main():
  s = list(input())

  if s[0] != 'A':
    print('WA')
    return

  C_counter = 0
  for n in s[2:-1]:    
    if n == 'C':
      C_counter += 1

  if C_counter != 1:
    print('WA')
    return

  for n in s:
    if n == 'A' or n == 'C':
      continue
    if not n.islower():
      print('WA')
      return
  print('AC')
  return




main()

Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import re; print('AC' if re.match(r'A[a-z]+C[a-z]+', input()) else 'WA');

Failing test case input:
AtCoCo

Expected output:
WA

Actual output:
AC


Fixed submission (verdict: Accepted):
import re; print('AC' if re.match(r'^A[a-z]+C[a-z]+$', input()) else 'WA');

Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
ss=s[1:-1]

if s[0]=="A" and  ss.count("C")==1:
      s=list(s)
      s.remove("A")
      s.remove("C")
      if ''.join(s).islower():
            print("AC")
else:
      print("WA")

Failing test case input:
ACoder

Expected output:
WA

Actual output:
AC


Fixed submission (verdict: Accepted):
s=input()
if s[0]!="A":
      print("WA")
      exit()
if s[2:-1].count("C")!=1:
      print("WA")
      exit()

s=list(s)
s[0]="a"
s.remove("C")
if "".join(s).islower():
      print('AC')
else:
      print("WA")

Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = False
for i in range(len(a)-1):
    if i == 0 and a[i] == "A":
        b = False
    elif not b and a[i] == "C" and 2 <= i <= len(a) - 2:
        b = not b
    elif b and (a[i] == "C" or a[i].isupper()):
        print("WA")
        exit()
    else:
        if a[i].isupper():
            print("WA")
            exit()
if b:
    print("AC")
else:
    print("WA")


Failing test case input:
CzclbhC

Expected output:
WA


Actual output:
WA


Fixed submission (verdict: Accepted):
a = input()
b = 0
if a[0] != "A":
    print("WA")
    exit()
for i in range(2,len(a)-1):
    if b == 0 and a[i] == "C":
        b = i
    elif b != 0 and [i] == "C":
        print("WA")
        exit()
if b == 0:
    print("WA")
    exit()
for i in range(len(a)):
    if i != 0 and i != b and a[i].isupper():
        print("WA")
        exit()
print("AC")
Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
ans='WA'
if S[0]=='A':
    if S[2:-1].count('C')==1:
        if S[1:S.index('C')].islower() and S[S.index('C')+1:].islower():
            ans='AC'
print('AC')

Failing test case input:
oetpcb@

Expected output:
WA


Actual output:
AC


Fixed submission (verdict: Accepted):
S=input()
ans='WA'
if S[0]=='A':
    if S[2:-1].count('C')==1:
        if S[1:S.index('C')].islower() and S[S.index('C')+1:].islower():
            ans='AC'
print(ans)

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

s = input()

flag = True

if s[0]!="A":
    print("WA")
    exit()

if "C" not in s[2:-1]:
    print("WA")
    exit()

idx = s[2:-1].find("C")+2

s = s[1:idx]+s[idx+1:]

if s == s.lower():
    print("AC")
else:
    print("WC")


Failing test case input:
AtBnCo

Expected output:
WA


Actual output:
WC


Fixed submission (verdict: Accepted):

s = input()

flag = True

if s[0]!="A":
    print("WA")
    exit()

if "C" not in s[2:-1]:
    print("WA")
    exit()

idx = s[2:-1].find("C")+2

s = s[1:idx]+s[idx+1:]

if s == s.lower():
    print("AC")
else:
    print("WA")

Problem: p03289
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()

if S[0] != "A":
  print("WA")
  exit()
if "C" not in S:
  print("WA")
  exit()
x = S.index("C")
if S[1:x]+S[x+1:] != (S[1:x]+S[x+1:]).lower():
  print("WA")
  exit()

print("AC")


Failing test case input:
ACoder

Expected output:
WA

Actual output:
AC


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

if S[0] != "A":
  print("WA")
  exit()
if S[1] == "C":
  print("WA")
  exit() 
if S[-1] == "C":
  print("WA")
  exit() 
if "C" not in S:
  print("WA")
  exit()
x = S.index("C")
if "C" in S[x+1:]:
  print("WA")
  exit()
if S[1:x]+S[x+1:] != (S[1:x]+S[x+1:]).lower():
  print("WA")
  exit()

print("AC")

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

if s[0] != "A":
    print("WA")
    exit()
if not s[2:-2].count("C" == 1):
    print("WA")
    exit()
for t in s:
    if t.isupper() and t != "A" and t != "C":
        print("WA")
        exit()

print("AC")



Failing test case input:
AtCodds

Expected output:
AC


Actual output:
WA


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

if s[0] != "A":
    print("WA")
    exit()
if s[2:-1].count("C") != 1:
    print("WA")
    exit()
for t in s:
    if t.isupper() and t != "A" and t != "C":
        print("WA")
        exit()

print("AC")

Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import re

s = input()
test = re.match(r"^A[a-z]{2,}C[a-z]+$", s)
if test:
    print('AC')
else:
    print('WA')


Failing test case input:
AtCoddt

Expected output:
AC


Actual output:
WA


Fixed submission (verdict: Accepted):
import re

s = input()
test = re.match(r"^A[a-z]+C[a-z]+$", s)
if test:
    print('AC')
else:
    print('WA')
Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())
mid = S[2:-1]
cnt = 0
if S[0] != "A":
    print("WA")
    exit()
for i in range(len(mid)):
    if mid[i] == "C":
        cnt += 1
        if cnt >= 2:
            print("WA")
            exit()
if cnt == 0:
    print("WA")
    exit()
print("AC")
    



Failing test case input:
AtBnCo

Expected output:
WA


Actual output:
AC


Fixed submission (verdict: Accepted):
S = str(input())
mid = S[2:-1]
cnt = 0
if S[0] != "A":
    print("WA")
    exit()
for i in range(len(mid)):
    if mid[i] == "C":
        cnt += 1
        if cnt >= 2:
            print("WA")
            exit()
if cnt == 0:
    print("WA")
    exit()
jud_S = S.replace("A","").replace("C","")
if not jud_S.islower():
    print("WA")
    exit()
print("AC")

Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import re
print("WA" if re.match('A[a-z]+C[a-z]+',input()) == None else "AC")

Failing test case input:
AtCoCo

Expected output:
WA

Actual output:
AC


Fixed submission (verdict: Accepted):
import re
print("WA" if re.match('^A[a-z]+C[a-z]+$',input()) == None else "AC")

Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
s = input()
judge = 1
if s[0] != "A":
    judge = 0

if not s[1] != "C" and s[len(s) -1] != "C" and s.count("C") == 1:
    judge = 0

s = s.replace("A","a").replace("C","c")

if s.islower() and judge == 1:
    print("AC")
else:
    print("WA")

Failing test case input:
Accqteo

Expected output:
WA


Actual output:
AC


Fixed submission (verdict: Accepted):
import sys
s = input()
judge = 0
if s[0] == "A":
    judge += 1

if s[1] != "C" and s[len(s) -1] != "C" and s.count("C") == 1:
    judge += 1

s = s.replace("A","a").replace("C","c")

if s.islower() and judge == 2:
    print("AC")
else:
    print("WA")

Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
if s[0] == 'A' and s[2:].count('C') == 1:
    i = s.index('C') 
    
    ss = s[1:i] + s[i+1:] 
    if ss.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Failing test case input:
AcycliC

Expected output:
WA

Actual output:
AC


Fixed submission (verdict: Accepted):
s = input()
if s[0] == 'A' and s[2:-1].count('C') == 1:
    i = s.index('C') 
    
    ss = s[1:i] + s[i+1:] 
    if ss.islower():
        print("AC")
    else:
        print("WA")
else:
    print("WA")

Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = a[2:-1]
if a.startswith("A"):
    if b.count("C") == 1:
        c = list(a)
        c.remove("A")
        c.remove("C")
        for i in c:
            if i.islower():
                print("AC")
                exit()
print("WA")


Failing test case input:
AtBoCo

Expected output:
WA


Actual output:
AC


Fixed submission (verdict: Accepted):
a = input()
b = a[2:-1]
if a.startswith("A"):
    if b.count("C") == 1:
        c = list(a)
        c.remove("A")
        c.remove("C")
        for i in c:
            if i.isupper():
                print("WA")
                exit()
        print("AC")
        exit()
print("WA")
Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
if s[0] == "A" and s[2:-2].count("C") == 1:
    s.remove("A")
    s.remove("C")
    for i in range(len(s)):
        if s[i].islower:
            continue
        else:
            print("WA")
            exit()
    print("AC")
else:
    print("WA")

Failing test case input:
AtCoCo

Expected output:
WA

Actual output:
AC


Fixed submission (verdict: Accepted):
s = list(input())
if s[0] == "A" and s[2:-1].count("C") == 1:
    s.remove("A")
    s.remove("C")
    for i in range(len(s)):
        if s[i].islower():
            continue
        else:
            print("WA")
            exit()
    print("AC")
else:
    print("WA")

Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import copy
s=list(input())
if s[0]=='A' and 'C' in s[2:len(s)] :
  t=copy.copy(s)
  s.remove('A')
  s.remove('C')
  result=''.join(s)
  if len(s)==len(t)-2 and result.islower()==True:
    print('AC')
  else:
    print('WA')
    
else:
  print('WA')


Failing test case input:
AcycliC

Expected output:
WA

Actual output:
AC


Fixed submission (verdict: Accepted):
import copy
s=list(input())
if s[0]=='A' and 'C' in s[2:len(s)] :
  t=copy.copy(s)
  s.remove('A')
  s.remove('C')
  result=''.join(s)
  if len(s)==len(t)-2 and result.islower()==True and t[-1]!='C':
    print('AC')
  else:
    print('WA')
    
else:
  print('WA')

Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S='AtCoder'
if S[0]=='A' and S[2:-1].count('C')==1:
    s=list(S)
    s.remove('C')
    S=''.join(s)
    if S.istitle()==True:
        print('AC')
        exit()
print('WA')

Failing test case input:
retpccA

Expected output:
WA


Actual output:
AC


Fixed submission (verdict: Accepted):
S=input()
if S[0]=='A' and S[2:-1].count('C')==1:
    s=list(S)
    s.remove('C')
    S=''.join(s)
    if S.istitle()==True:
        print('AC')
        exit()
print('WA')
Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
line = input()
WA_flag = 0
C_flag = 0
check_point = 0

for cnt, elm in enumerate(line):
    if cnt == 0:
        if elm != "A":
            WA_flag += 1
    if cnt > 1 and cnt < (len(line) - 2):
        if elm =="C":
            C_flag += 1
            check_point = cnt

if C_flag != 1:
    WA_flag += 1
else:
    for cnt, elm in enumerate(line):
        if cnt != 1 and cnt != check_point:
            if elm.isupper():
                WA_flag += 1

if WA_flag != 0:
    print("WA")
else:
    print("AC")

Failing test case input:
AtCoddr

Expected output:
AC


Actual output:
WA


Fixed submission (verdict: Accepted):
line = input()
WA_flag = 0
C_flag = 0
check_point = 0

for cnt, elm in enumerate(line):
    if cnt == 0:
        if elm != "A":
            WA_flag += 1
            
    if cnt > 1 and cnt < (len(line) - 1):
        if elm =="C":
            C_flag += 1
            check_point = cnt

if C_flag != 1:
    WA_flag += 1
    
else:
    for cnt, elm in enumerate(line):
        if cnt != 0 and cnt != check_point:
            if elm.isupper():
                WA_flag += 1
                

if WA_flag != 0:
    print("WA")
else:
    print("AC")

Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
if s.count("A")==1 and s.count("C")==1:
    if "C" in s[2:len(s)-1] and s[0]=="A":
        s=s.replace("A","")
        s=s.replace("C","")
        if s.lower()==True:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Failing test case input:
AtCodds

Expected output:
AC


Actual output:
WA


Fixed submission (verdict: Accepted):
s=input()
if s.count("A")==1 and s.count("C")==1:
    if "C" in s[2:-1] and s[0]=="A":
        s=s.replace("A","a")
        s=s.replace("C","b")
        t=s.lower()
        if s==t:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
if S[0] == 'A' and 'C' in S[2:-1] and S[1:].replace('C', '', 1).lower():
	print('AC')
else:
	print('WA')


Failing test case input:
AtCoCo

Expected output:
WA

Actual output:
AC


Fixed submission (verdict: Accepted):
S = input()
if S[0] == 'A' and 'C' in S[2:-1] and S[1:].replace('C', '', 1).islower():
	print('AC')
else:
	print('WA')

Problem: p03289
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
if S[0] == "A" and "C" in S[2:-1] and S.replace("A", "").replace("C", "").islower():
  print("AC")
else:
  print("WA")

Failing test case input:
AtCoCo

Expected output:
WA

Actual output:
AC


Fixed submission (verdict: Accepted):
S = input()
if S[0] == "A" and S[2:-1].count("C") == 1 and S.replace("A", "").replace("C", "").islower():
  print("AC")
else:
  print("WA")