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

N = int(input())
S = input()

position_L = []
position_R = []
for s in S:
    if s == 'W':
        position_R.append(0)
    else:
        position_R.append(1)
        
flips = sum(position_R[0:])
flips_temp = flips
i = 1
while i < N:
    flips_temp = flips_temp - position_R[i] + ((-1) * position_R[i-1] + 1)
    
    if flips_temp < flips:
        flips = flips_temp
    i = i + 1
print(flips)

Failing test case input:
12
EWEWEWWEWWEE

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):
import sys

N = int(input())
S = input()

position_L = []
position_R = []
for s in S:
    if s == 'W':
        position_R.append(0)
    else:
        position_R.append(1)
        
flips = sum(position_R[1:])
flips_temp = flips

i = 1
while i < N:
    
    flips_temp = flips_temp - position_R[i] + ((-1) * position_R[i-1] + 1)
    if flips_temp < flips:
        flips = flips_temp
    i = i + 1
print(flips)

Problem: p03341
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
S = input()
c = S.count("E") - S.startswith("E")
ans = c
for i in range(N-1):
    s = S[i]
    if s == "W":
        c += 1
    else:
        c -= 1
        ans = min(c,ans)
print(ans)

Failing test case input:
12
EWEWWWWEEWEE

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
c = S.count("E") - S.startswith("E")
ans = c
for i in range(N-1):
    s = S[i]
    if i<N-1 and S[i+1] == "E":
        c -= 1
    if s == "W":
        c += 1
    ans = min(c,ans)
print(ans)

Problem: p03341
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
s = input().strip()
d = {"W":0,"E":0}
x=[]
for i, c in enumerate(s):
    x.append(i - d[c])
    d[c]+=1
d = {"W":0,"E":0}
r = N
for i, c in enumerate(s[::-1]):
    r = min(r, x[N-i-1]+d[c])
    d[c]+=1
print(r)


Failing test case input:
8
WWWEWEEW

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
s = input().strip()
d = {"W":0,"E":0}
x=[]
for i, c in enumerate(s):
    x.append(d["W"])
    d[c]+=1
d = {"W":0,"E":0}
r = N
for i, c in enumerate(s[::-1]):
    r = min(r, x[N-i-1]+d["E"])
    d[c]+=1
print(r)

Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input()
S = input()
tmp = sum([1 for s in S[1:] if s == "E"])
ans = tmp
for i in range(1, len(S)):
    if S[i-1] == "W":
        tmp += 1
    else:
        tmp -= 1
    ans = min(ans, tmp)
print(ans)

Failing test case input:
8
EWEWWWEW

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
input()
S = input()
tmp = sum([1 for s in S[1:] if s == "E"])
ans = tmp
for i in range(1, len(S)):
    if S[i-1] == "W":
        tmp += 1
    if S[i] == "E":
        tmp -= 1
    ans = min(ans, tmp)
print(ans)
Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
S=input()
l=0
r=S[1:].count("E")
print(r)
answer=N

for i in range(N-1):
    if l+r<answer:
        answer=l+r
    if S[i]=="W":
        l+=1
    if S[i+1]=="E":
        r-=1
if l+r<answer:
    answer=l+r
print(answer)


Failing test case input:
12
EWWWEEEWWWEE

Expected output:
5


Actual output:
5
5


Fixed submission (verdict: Accepted):
N=int(input())
S=input()
l=0
r=S[1:].count("E")

answer=N

for i in range(N-1):
    if l+r<answer:
        answer=l+r
    if S[i]=="W":
        l+=1
    if S[i+1]=="E":
        r-=1
if l+r<answer:
    answer=l+r
print(answer)

Problem: p03341
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
from collections import Counter
n = int(input())
s = input()
c = Counter(s)
tmp = c['E']
best = tmp - (1 if s[0] == 'E' else 0)
for i in range(1, n):
    if s[i - 1] == 'W':
        tmp += 1
    else:
        tmp -= 1
    if tmp - (1 if s[0] == 'E' else 0) < best:
        best = tmp - (1 if s[0] == 'E' else 0)
print(best)


Failing test case input:
12
EEWEWEEWWWEW

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
from collections import Counter
n = int(input())
s = input()
c = Counter(s)
tmp = c['E']
best = tmp - (1 if s[0] == 'E' else 0)
for i in range(1, n):
    if s[i - 1] == 'W':
        tmp += 1
    else:
        tmp -= 1
    if tmp - (1 if s[i] == 'E' else 0) < best:
        best = tmp - (1 if s[i] == 'E' else 0)
print(best)

Problem: p03341
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
x=int(input())
s=input()

leftw=[0]*(x+1)
righte=[0]*(x+1)

for i in range(x):
    leftw[i+1]=leftw[i]
    righte[x-i-1]=righte[x-i]

    leftw[i+1]+=1 if s[i]=='W' else 0
    righte[x-i-1]+=1 if s[x-i-1]=='E' else 0
ans=10**6
for leader in range(x):
    ans=min(ans,leftw[leader-1]+righte[leader+1])

print(ans)

Failing test case input:
5
WEWWE

Expected output:
2


Actual output:
1


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

leftw=[0]*(x+1)
righte=[0]*(x+1)

for i in range(x):
    leftw[i+1]=leftw[i]
    righte[x-i-1]=righte[x-i]

    leftw[i+1]+=1 if s[i]=='W' else 0
    righte[x-i-1]+=1 if s[x-i-1]=='E' else 0
ans=10**6
for leader in range(x):
    ans=min(ans,leftw[leader]+righte[leader+1])

print(ans)

Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=str(input())


ans=10**100
c=s.count('E',1)
for i in range(1,n):
    if s[i-1]=='W':
        c+=1
    if s[i]=='E':
        c-=1
    ans=min(c,ans)
print(min(c,ans))


Failing test case input:
8
WWWEWEWE

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
n=int(input())
s=str(input())

l=[]
c=s.count('E',1)
for i in range(1,n):
    if s[i-1]=='W':
        c+=1
    if s[i]=='E':
        c-=1
    l.append(c)
print(min(min(l),s.count('E')))
Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
S=input()
DP=[0]*N
l=0
for i,x in enumerate(S):
  DP[i]+=l
  if x=="W":
    l+=1
r=0
for i,y in enumerate(S[::-1]):
  DP[N-1-i]+=r
  if y=="E":
    r+=1
print(N-1-max(DP))
  

Failing test case input:
12
WEWWWEEWEWEE

Expected output:
6


Actual output:
3


Fixed submission (verdict: Accepted):
N=int(input())
S=input()
DP=[0]*N
l=0
for i,x in enumerate(S):
  DP[i]+=l
  if x=="E":
    l+=1
r=0
for i,y in enumerate(S[::-1]):
  DP[N-1-i]+=r
  if y=="W":
    r+=1
print(N-1-max(DP))

Problem: p03341
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
S = input()
E = S.count("E")
W = 0
ans = N + 1
for s in S:
    if s == "E":
        E -= 1
    ans = min(W + E, ans)
    if s == "W":
        W -= 1
print(ans)

Failing test case input:
12
WWEEEEWWWWEE

Expected output:
4


Actual output:
-6


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
E = S.count("E")
W = 0
ans = N + 1
for s in S:
    if s == "E":
        E -= 1
    ans = min(W + E, ans)
    if s == "W":
        W += 1
print(ans)

Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()

s = S[::-1]
w = [0]*(N+1)
e = [0]*(N+1)
cnt_w = 0
cnt_e = 0

for i in range(N):
    if(S[i] == "W"):
        cnt_w += 1
        w[i+1] = cnt_w
    else:
        w[i+1] = cnt_w

for i in range(N):
    if(s[i] == "E"):
        cnt_e += 1
        e[i+1] = cnt_e
    else:
        e[i+1] = cnt_e

print(w)
print(e)
e = e[::-1]        
ans = 2*N

for i in range(N+1):
    ans = min(ans, e[i]+w[i])
print(ans)

Failing test case input:
8
WEWWWEEW

Expected output:
3


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


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

s = S[::-1]
w = [0]*(N+1)
e = [0]*(N+1)
cnt_w = 0
cnt_e = 0

for i in range(N):
    if(S[i] == "W"):
        cnt_w += 1
        w[i+1] = cnt_w
    else:
        w[i+1] = cnt_w

for i in range(N):
    if(s[i] == "E"):
        cnt_e += 1
        e[i+1] = cnt_e
    else:
        e[i+1] = cnt_e

e = e[::-1]        
ans = 2*N

for i in range(N+1):
    ans = min(ans, e[i]+w[i])
print(ans)
Problem: p03341
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
S = input()

east_count = [0]*(N+1)
west_count = [0]*(N+1)

for i in range(N):
    east_count[i+1] += east_count[i]
    west_count[i+1] += west_count[i]
    if S[i] == 'E':
        east_count[i+1] += 1
    else:
        west_count[i+1] += 1

ans = 2**64
for i in range(N):
    s = S[i]
    count = west_count[i-1]
    count += east_count[N] - east_count[i+1]
    ans = min(ans, count)

print(ans)
    


Failing test case input:
12
EWWWEEEWEWEW

Expected output:
5


Actual output:
4


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

east_count = [0]*(N+1)
west_count = [0]*(N+1)

for i in range(N):
    east_count[i+1] += east_count[i]
    west_count[i+1] += west_count[i]
    if S[i] == 'E':
        east_count[i+1] += 1
    else:
        west_count[i+1] += 1

ans = 2**64
for i in range(N):
    s = S[i]
    count = west_count[i]
    count += east_count[N] - east_count[i+1]
    ans = min(ans, count)

print(ans)

Problem: p03341
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
S = list(input())

EAST = []
WEST = []
e = 0
w = 0
for s in S:
  if s == "E":
    e += 1
  else:
    w += 1
  EAST.append(e)
  WEST.append(w)
  
ans = N - 1
for i in range(N):
  c = 0
  if i > 0:
    c += WEST[i-1]
  if i < N - 1:
    c += EAST[N-1] - EAST[i+1]
  
  ans = min(c,ans)

print(ans)
    

  


Failing test case input:
12
WEWWWEEWEWEE

Expected output:
6


Actual output:
5


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

EAST = []
WEST = []
e = 0
w = 0
for s in S:
  if s == "E":
    e += 1
  else:
    w += 1
  EAST.append(e)
  WEST.append(w)
  
ans = N - 1
for i in range(N):
  c = 0
  if i > 0:
    c += WEST[i-1]
  if i < N - 1:
    c += EAST[N-1] - EAST[i]
  
  ans = min(c,ans)

print(ans)

Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()

sum_w = [0]
sum_e = [0]

count = 0
for i in range(N-1):
  if S[i] == "W":
    count += 1
  sum_w.append(count)

count = 0
for i in range(N-1,1,-1):
  if S[i] == "E": 
    count += 1
  sum_e.append(count)
sum_e = sum_e[::-1]


sumu = [x+y for x, y in zip(sum_w, sum_e)]

print(min(sumu))

Failing test case input:
8
WEWWWEEW

Expected output:
3


Actual output:
2


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

sum_w = [0]
sum_e = [0]

count = 0
for i in range(N-1):
  if S[i] == "W":
    count += 1
  sum_w.append(count)

count = 0
for i in range(N-1,0,-1):
  if S[i] == "E": 
    count += 1
  sum_e.append(count)
sum_e = sum_e[::-1]


sumu = [x+y for x, y in zip(sum_w, sum_e)]

print(min(sumu))

Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=input()
e,w=s.count('E'),s.count('W')
le,lw=0,0
ans=10**6
for c in s:
	if c=='E':
		e-=1
		ans=min(ans,e+lw)		
	else:
		lw+=1
print(ans)

Failing test case input:
8
WWEWWEWE

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
n=int(input())
s=input()
e,w=s.count('E'),s.count('W')
le,lw=0,0
ans=e
for c in s:
	if c=='E':
		e-=1
		ans=min(ans,e+lw)		
	else:
		lw+=1
print(ans)
Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()
left = 0
right = S[1:].count('E')
MIN = left + right
for i in range(1,N):
  if S[i] == 'W':
    left += 1
  else:
    right -= 1
  
  if i==N-1:
    MIN = min(MIN,S[:i].count('W'))
  else:
    MIN = min(left+right,MIN)
print(MIN)
  

Failing test case input:
12
WEWEWWEEEWEW

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
left = 1 if S[0] == 'W' else 0
right = S[1:].count('E')
MIN =  right 
for i in range(1,N):
  if S[i] == 'W':
    MIN = min(MIN,left+right)
    left += 1
  else:
    MIN = min(MIN,left+right)
    right -= 1
  
  if i==N-1:
    MIN = min(MIN,S[:i].count('W'))

print(MIN)

Problem: p03341
Buggy submission (Python (3.8.2), verdict: Wrong Answer):




n = int(input())
s = input()


acme = list()
acmw = list()
acme.append(0)
acmw.append(0)
ans = n+1


for i in range(n):
    if s[i] == 'E':
        acme.append(acme[i] + 1)
        acmw.append(acmw[i])
    elif s[i] == 'W':
        acme.append(acme[i])
        acmw.append(acmw[i] + 1)


for i in range(1, n+1):
    ecnt = acme[n] - acme[i]
    wcnt = acmw[i]
    wcnt = ecnt + wcnt
    if i == 1 or i == n:
        wcnt = wcnt - 1
    ans = min(ans, wcnt)


print(ans)

Failing test case input:
12
WWEWWWWEEEEE

Expected output:
6


Actual output:
5


Fixed submission (verdict: Accepted):




n = int(input())
s = input()


acme = list()
acmw = list()
acme.append(0)
acmw.append(0)
ans = n+1


for i in range(n):
    if s[i] == 'E':
        acme.append(acme[i] + 1)
        acmw.append(acmw[i])
    elif s[i] == 'W':
        acme.append(acme[i])
        acmw.append(acmw[i] + 1)

acme.append(acme[n])
acmw.append(acmw[n])


for i in range(1, n+1):
    ecnt = acme[n] - acme[i]
    wcnt = acmw[i-1]
    wcnt = ecnt + wcnt
    ans = min(ans, wcnt)


print(ans)

Problem: p03341
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
S = input()

ans_temp = 0
ans = 3*10**5+1
for i in range(1, N):
    if S[i] == 'E':
        ans_temp += 1

for i in range(1, N):
    if S[i] == 'E':
        ans_temp -= 1
    if S[i-1] == 'W':
        ans_temp += 1
    ans = min(ans, ans_temp)

print(ans)

Failing test case input:
8
WWEWWEEW

Expected output:
3


Actual output:
4


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

ans_temp = 0
for i in range(1, N):
    if S[i] == 'E':
        ans_temp += 1
ans = ans_temp

for i in range(1, N):
    if S[i] == 'E':
        ans_temp -= 1
    if S[i-1] == 'W':
        ans_temp += 1
    ans = min(ans, ans_temp)

print(ans)
Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()

left = 0
right = N - 1

DP = [0] * N

DP[0] = S[1:].count("E")

for i in range(1, N):
    if S[i - 1] == "W":
        a = 1
    else:
        a = -1
    DP[i] = DP[i - 1] + a

print(min(DP))


Failing test case input:
8
EWEWEWWW

Expected output:
2


Actual output:
1


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

left = 0
right = N - 1

DP = [0] * N

DP[0] = S[1:].count("E")

for i in range(1, N):
    if S[i - 1] == "W":
        a = 1
    else:
        a = 0
    if S[i] == "E":
        b = -1
    else:
        b = 0
    DP[i] = DP[i - 1] + a + b

print(min(DP))

Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
S = [int(c == 'W') for c in list(input())]
L = [0]
for i in range(n):
    L.append(L[-1]+S[i])
R = [0]
for i in range(n-1, 0, -1):
    R.append(R[-1]+S[i])
R.reverse()
print(min([L[i]+R[i] for i in range(n)]))


Failing test case input:
12
WEWWWEWEWEEE

Expected output:
6


Actual output:
5


Fixed submission (verdict: Accepted):
n = int(input())
S = [int(c == 'W') for c in list(input())]
L = [0]
for i in range(n):
    L.append(L[-1]+S[i])
R = [0]
for i in range(n-1, 0, -1):
    R.append(R[-1]+1-S[i])
R.reverse()
print(min([L[i]+R[i] for i in range(n)]))

Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input()
ss = input()
loss = ss[1:].count("E")
min_loss = loss
ss_before = ss[:-1]
ss_after = ss[1:]
for b, a in zip(ss_before, ss_after):
    if b == "E":
        loss -=1
    else:
        loss +=1
    if a == "W":
        loss -=1
    else:
        loss +=1
    if loss < min_loss:
        min_loss = loss
print("{}".format(min_loss))
    

Failing test case input:
12
WEWEWEEWEEWW

Expected output:
4


Actual output:
6


Fixed submission (verdict: Accepted):
input()
ss = input()
loss = ss[1:].count("E")
min_loss = loss
ss_before = ss[:-1]
ss_after = ss[1:]
for b, a in zip(ss_before, ss_after):
    loss += b == "W"
    loss -= a == "E"
    if loss < min_loss:
        min_loss = loss
print("{}".format(min_loss))

Problem: p03341
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
l = list(input())

ans = 100000000
east = 0
west = 0
for i in range(1, n):
    if l[i] == 'E':
        east+=1
ans = east

for i in range(1, n):
    if l[i-1] == 'W':
        west+=1
    elif l[i-1] == 'E':
        east-=1
    ans = min(ans, west + east)
print(ans)


Failing test case input:
8
EWWWWEWE

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
l = list(input())

ans = 100000000
east = 0
west = 0
for i in range(1, n):
    if l[i] == 'E':
        east+=1
ans = east

if l[0] == 'E':
    east+=1

for i in range(1, n):
    if l[i-1] == 'W':
        west+=1
    elif l[i-1] == 'E':
        east-=1
    if l[i] == 'E':
        ans = min(ans, west + east-1)
    else:
        ans = min(ans, west + east)
print(ans)
Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
line = input()

ans = line.count('E')
tmp = ans
for i in range(1,N):
 if line[i] == 'E':
  tmp -= 1
 if line[i-1] == 'W':
  tmp += 1
 if ans>tmp:
  ans = tmp


print(ans)

Failing test case input:
12
EWEWWEEEWEWW

Expected output:
4


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())
line = input()

ans = line[1:N].count('E')
tmp = ans
for i in range(1,N):
 if line[i] == 'E':
  tmp -= 1
 if line[i-1] == 'W':
  tmp += 1
 if ans>tmp:
  ans = tmp

print(ans)

Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()

W = [0 for _ in range(N + 2)]
E = [0 for _ in range(N + 2)]

for i, s in enumerate(S):
    if s == 'W':
        W[i + 1] = W[i] + 1
        E[i + 1] = E[i]
    else:
        W[i + 1] = W[i]
        E[i + 1] = E[i] + 1
W[N + 1] = W[N]
E[N + 1] = E[N]

ret = 10 ** 6
for i in range(1, N):
    w = W[i - 1] - W[0]
    e = W[N + 1] - W[i + 1]
    ret = min(ret, w + e)

print(ret)


Failing test case input:
8
EWWWWEEW

Expected output:
2


Actual output:
3


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

W = [0 for _ in range(N + 1)]
E = [0 for _ in range(N + 1)]

for i, s in enumerate(S):
    if s == 'W':
        W[i + 1] = W[i] + 1
        E[i + 1] = E[i]
    else:
        W[i + 1] = W[i]
        E[i + 1] = E[i] + 1

ret = 10 ** 6
for i in range(1, N+1):
    w = W[i - 1]
    e = E[N] - E[i]
    ret = min(ret, w + e)

print(ret)

Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()
left = 0
right = S[1:].count('E')
MIN = left + right
for i in range(0,N):
  if S[i] == 'W':
    MIN = min(MIN,left+right)
    left += 1
  else:
    MIN = min(MIN,left+right)
    right -= 1
  
  if i==N-1:
    MIN = min(MIN,S[:i].count('W'))

print(MIN)

Failing test case input:
8
EWEWWWEW

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
left = 1 if S[0] == 'W' else 0
right = S[1:].count('E')
MIN =  right 
for i in range(1,N):
  if S[i] == 'W':
    MIN = min(MIN,left+right)
    left += 1
  else:
    MIN = min(MIN,left+right)
    right -= 1
  
  if i==N-1:
    MIN = min(MIN,S[:i].count('W'))

print(MIN)

Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()

rcost = 0
lcost = S.count('E')
ans = lcost

for i in range(N):
        if S[i] == 'W':
            rcost += 1
        if i < N-1:
            if S[i+1] == 'E':
                lcost -= 1
        ans = min(ans, rcost+lcost)
    
print(ans)

Failing test case input:
12
EEEWEWEWWWEW

Expected output:
3


Actual output:
4


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

rcost = 0
lcost = S.count('E')
if S[0] == 'E':
    lcost -= 1
ans = lcost

for i in range(N-1):
        if S[i] == 'W':
            rcost += 1
        if S[i+1] == 'E':
            lcost -= 1
        ans = min(ans, rcost+lcost)
    
print(ans)
Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=str(input())


ans=10**100
a=0
b=s.count('E',1,n)
for i in range(n):
    if a+b<=ans:
        ans=a+b
    if s[i]=='W':
        a+=1
    if s[i]=='E':
        b-=1
print(ans)


Failing test case input:
12
EEWWEEEEWWWW

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n=int(input())
s=str(input())

l=[]
c=s.count('E',1)
for i in range(1,n):
    if s[i-1]=='W':
        c+=1
    if s[i]=='E':
        c-=1
    l.append(c)
print(min(min(l),s.count('E')))

Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(input())
for i in range(n):
    if a[i] == 'E':
        a[i] = 1
    else:
        a[i] = 0

ans = 99999999999999999999

l = 0
r = sum(a)
for i in range(n):

    if i == 0:
        if a[i] == 1:
            r -= a[i]
            a[i] = 0
        else:
            a[i] = 1
        l = 0
    else:
        if a[i] == 1:
            a[i] = 0
            r -= 1
        else:
            a[i] = 1
        l += a[i-1]

    ans = min(l+r,ans)
    print(i,l,r,ans)
print(ans)



Failing test case input:
12
WWWWEEEEWWEE

Expected output:
6


Actual output:
0 0 6 6
1 1 6 6
2 2 6 6
3 3 6 6
4 4 5 6
5 4 4 6
6 4 3 6
7 4 2 6
8 4 2 6
9 5 2 6
10 6 1 6
11 6 0 6
6


Fixed submission (verdict: Accepted):
n = int(input())
a = list(input())
for i in range(n):
    if a[i] == 'E':
        a[i] = 1
    else:
        a[i] = 0

ans = 99999999999999999999

l = 0
r = sum(a)
for i in range(n):

    if i == 0:
        if a[i] == 1:
            r -= a[i]
            a[i] = 0
        else:
            a[i] = 1
        l = 0
    else:
        if a[i] == 1:
            a[i] = 0
            r -= 1
        else:
            a[i] = 1
        l += a[i-1]

    ans = min(l+r,ans)
    
print(ans)

Problem: p03341
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
line = input()

ans = line[1:N].count('E')
tmp = ans
for i in range(1,N):
 if line[i] == 'E':
  tmp -= 1
 if line[i-1] == 'W':
  tmp += 1
 if ans>tmp:
  ans = tmp
 print(i)


print(ans)

Failing test case input:
12
WWEEEEWWWWEE

Expected output:
4


Actual output:
1
2
3
4
5
6
7
8
9
10
11
4


Fixed submission (verdict: Accepted):
N = int(input())
line = input()

ans = line[1:N].count('E')
tmp = ans
for i in range(1,N):
 if line[i] == 'E':
  tmp -= 1
 if line[i-1] == 'W':
  tmp += 1
 if ans>tmp:
  ans = tmp

print(ans)
Problem: p03341
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
s = input()
a = [str(c) for c in s]

x = a.count('E')
if a[0] == 'E':
    y = x-1
else:
    y=x
for i in range(n-1):
    if a[i] == 'W':
        if a[i+1] == 'W':
            x += 1
        else:
            x = x
    else:
        if a[i+1] == 'W':
            x = x
        else:
            x -= 1
    if y > x:
        y = x
        



print(y)
        

Failing test case input:
8
EEEWWWWW

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
a = [str(c) for c in s]

x = a.count('E')
if a[0] == 'E':
    x -= 1
y = x
for i in range(n-1):
    if a[i] == 'W':
        if a[i+1] == 'W':
            x += 1
        else:
            x = x
    else:
        if a[i+1] == 'W':
            x = x
        else:
            x -= 1
    if y > x:
        y = x
        



print(y)
Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, x = map(int, input().split())

start = a if a % x == 0 else a 
if b - start >= 0:
    ans = (b - start) 
else:
    ans = 0

print(ans)


Failing test case input:
16 9 2

Expected output:
-3


Actual output:
0


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

start = a if a % x == 0 else x * (a 
if b - start >= 0:
    ans = (b - start) 
else:
    ans = 0

print(ans)

Problem: p03861
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,x=map(int,input().split())
k=(a-1)
l=b
print(l-k)


Failing test case input:
-2 1010010100000101000 3

Expected output:
336670033333367001


Actual output:
1010010100000101003


Fixed submission (verdict: Accepted):
a,b,x=map(int,input().split())
print(b

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, x = map(int, input().split())

def f(n, x):
    if n >= 0:
        return int(n/x) + 1
    else:
        return 0

print(f(b, x) - f(a, x))

Failing test case input:
0 0001000111001100000 2

Expected output:
500055500550001


Actual output:
500055500550000


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

def f(n, x):
    if n >= 0:
        return (n
    else:
        return 0

print(f(b, x) - f(a-1, x))

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, x = map(int, input().split())
print(int(b/x) - int((a-1)/x))

Failing test case input:
0 1010110111001100000 3

Expected output:
336703370333700001


Actual output:
336703370333699968


Fixed submission (verdict: Accepted):
a, b, x = map(int, input().split())
print(int(b

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, x = map(int, input().split())
print((b+1)/x - a/x)

Failing test case input:
1 1011110111001100000 3

Expected output:
337036703667033333


Actual output:
3.3703670366703334e+17


Fixed submission (verdict: Accepted):
a, b, x = map(int, input().split())
print(int(b

Problem: p03861
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math
a, b, x = map(int, input().split())

xa = math.ceil(a / x)
xb = b 
print(xb - xa + 1)

Failing test case input:
0 1000010100000100001 6

Expected output:
166668350000016667


Actual output:
1000010100000100002


Fixed submission (verdict: Accepted):
import math
a, b, x = map(int, input().split())

xa = -(-a 
xb = b 
print(xb - xa + 1)

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

numbers = sys.stdin.readline().split(' ')

a = int(numbers[0])
b = int(numbers[1])
c = int(numbers[2])


if a > 0:
    print(b/c - (a-1)/c)
else:
    print(b/c)

Failing test case input:
1 1000010100000000000 1

Expected output:
1000010100000000000


Actual output:
1.0000101e+18


Fixed submission (verdict: Accepted):
import sys


numbers = sys.stdin.readline().split(' ')

a = int(numbers[0])
b = int(numbers[1])
c = int(numbers[2])


if a > 0:
    print(b
else:
    print(b
Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, x = map(int, input().split())

i = a
j = b
while i % x != 0:
  i+= 1

while j % x != 0:
  j-= 1
  
ans = (j- i)/ x+ 1

if(ans<= 0):
  print(0)
else:
  print(int(ans))

Failing test case input:
16 9 1

Expected output:
-6


Actual output:
0


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

i = a
j = b
p = i* x
q = j* x
while i* x < a:
  i+= 1
  p = i* x
while j* x < b:
  j+= 1
  q = (j- 1)* x

ans = int((q- p)

if(ans<= 0):
  print(0)
else:
  print(ans)

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, x = map(int, input().split())

start = a if a % x == 0 else a 
ans = max(0, b - start) 

print(ans)


Failing test case input:
0 1010010100000100000 1

Expected output:
1010010100000100001


Actual output:
1010010100000100000


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

start = a if a % x == 0 else x * (a 
if b - start >= 0:
    ans = (b - start) 
else:
    ans = 0

print(ans)

Problem: p03861
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a, b, x = map(int, input().split())
c1 = a 
c2 = b 
if a == b:
  if a % x == 0:
    print(1)
  else:
    print(0)
  exit()
print(c2-c1+1)

Failing test case input:
0 2 4

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
a, b, x = map(int, input().split())
m1 = a % x
m2 = b % x
if a == b:
  if a % x == 0:
    print(1)
  else:
    print(0)
  exit()
if m1 != 0:
  a = (a
if m2 != 0:
  b = (b

print((b

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
abx = input().split()
a, b, x = int(abx[0]), int(abx[1]), int(abx[2])
print(int(b/x - (a-1)/x))

Failing test case input:
0 0001000111001100000 2

Expected output:
500055500550001


Actual output:
500055500550000


Fixed submission (verdict: Accepted):
abx = input().split()
a, b, x = int(abx[0]), int(abx[1]), int(abx[2])
print(int(b

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,n = map(int,input().split())
if a%n==0:
    k=1
else:
    k=0
print(int((b-a)/n)+k)


Failing test case input:
0 1000010100000100001 6

Expected output:
166668350000016667


Actual output:
166668350000016673


Fixed submission (verdict: Accepted):
a,b,x = map(int,input().split())
if a%x==0:
    k=1
else:
    k=0
print(b

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,x = map(int,input().split())
if a - b != 0:
    print(int(abs(a - b) / x + 1))
else:
    print(0)

Failing test case input:
2 1011010111001000000 1

Expected output:
1011010111000999999


Actual output:
1011010111000999936


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

if a != 0:
    print((b 
else:
    print(b
Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

a,b,x = map(int, input().split())
ans = (b-a) 
if a % x == 0 or b % x == 0: ans += 1
  
print(ans)

Failing test case input:
-1 1010000110000100000 2

Expected output:
505000055000050001


Actual output:
1010000110000100002


Fixed submission (verdict: Accepted):

a,b,x = map(int, input().split())
ans = (b-a) 
if a!= 0:
  ans = (b 
else:
  ans = (b 
  
print(ans)

Problem: p03861
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,x = map(int, input().split())

c = b - a

d = c 

print(d)

Failing test case input:
1 0011010111001100000 4

Expected output:
2752527750275000


Actual output:
11010111001099999


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

c = (b 
d = c

print(d)

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, x = map(int, input().split())

if a == b and a % x != 0:
  result = 0
  print(result)
  exit()
elif a == b and a % x == 0:
  result = 1
  print(result)
  exit()
else:
  B = divmod(b, x)
  A = divmod(a, x)
  result = B[0] - A[0]
  if a == 0 or (A[1] == 0 and B[1] == 0): result += 1
  print(result)
  

Failing test case input:
16 9 2

Expected output:
-3


Actual output:
-4


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

if a == b and a % x != 0:
  result = 0
  print(result)
  exit()
elif a == b and a % x == 0:
  result = 1
  print(result)
  exit()
else:
  B = divmod(b, x)
  A = divmod(a, x)
  result = B[0] - A[0]
  if A[1] == 0: result += 1
  print(result)

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

numbers = sys.stdin.readline().split(' ')

a = int(numbers[0])
b = int(numbers[1])
c = int(numbers[2])

if a > 0:
    print(int(b/c) - int((a-1)/c))
else:
    print(int(b/c))


Failing test case input:
0 1010010100000100000 3

Expected output:
336670033333366667


Actual output:
336670033333366656


Fixed submission (verdict: Accepted):
import sys


numbers = sys.stdin.readline().split(' ')

a = int(numbers[0])
b = int(numbers[1])
c = int(numbers[2])


if a > 0:
    print(b
else:
    print(b

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



import sys

input = sys.stdin.readline

def main():
    a, b, c = map(int, input().split())
    print(int((b-a)/c + 1 if a != b else 0))

main()


Failing test case input:
0 1010010111000101000 2

Expected output:
505005055500050501


Actual output:
505005055500050496


Fixed submission (verdict: Accepted):



import sys

input = sys.stdin.readline

def main():
    a, b, c = map(int, input().split())
    print(b 

main()

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,x=map(int,input().split())
if a!=0:
  
  print(b%x - (a-1)%x)

else:
  print(b%x+1)


Failing test case input:
1 1000000000000000000 3

Expected output:
333333333333333333

Actual output:
1


Fixed submission (verdict: Accepted):
a,b,x=map(int,input().split())
if a!=0:
  
  print((b

else:
  print((b
Problem: p03861
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math
(a,b,x)=map(int, input().split(" "))
print(math.floor(b/x)-math.ceil(a/x)+1)

Failing test case input:
1 1000000000000000000 3

Expected output:
333333333333333333

Actual output:
333333333333333312


Fixed submission (verdict: Accepted):
import math
from decimal import Decimal
(a,b,x)=map(Decimal, input().split(" "))
print(math.floor(b/x)-math.floor((a-1)/x))

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,x=map(int,input().split())
ans=0
if (b-a+1)>=x:
    if a%x==0 and b%x==0:
        ans=((b-a)/x)+1
    elif not a%x==0 and not b%x==0:
        a=a+x-a%x
        b=b-b%x
        ans=((b-a)/x)+1
    elif not a%x==0 and b%x==0:
        a=a+x-a%x
        ans=((b-a)/x)+1
    elif a%x==0 and not b%x==0:
        b=b-b%x
        ans=((b-a)/x)+1
else:
    if a%x==0:
        ans=1
    else:
        if a+x-a%x<=b:
            ans=1
        else:
            ans=0
print(ans)


Failing test case input:
-1 1010000100000100000 2

Expected output:
505000050000050001


Actual output:
5.0500005000005e+17


Fixed submission (verdict: Accepted):
a,b,x=map(int,input().split())
ans=0
if (b-a+1)>=x:
    if a%x==0 and b%x==0:
        ans=((b-a)
    elif not a%x==0 and not b%x==0:
        a=a+x-a%x
        b=b-b%x
        ans=((b-a)
    elif not a%x==0 and b%x==0:
        a=a+x-a%x
        ans=((b-a)
    elif a%x==0 and not b%x==0:
        b=b-b%x
        ans=((b-a)
else:
    if a%x==0:
        ans=1
    else:
        if a+x-a%x<=b:
            ans=1
        else:
            ans=0
print(ans)

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



import sys

input = sys.stdin.readline

def main():
    a, b, c = map(int, input().split())
    print((b-a)/c + 1 if a != b else 0)

main()


Failing test case input:
1 1000010000000000000 1

Expected output:
1000010000000000000


Actual output:
1.00001e+18


Fixed submission (verdict: Accepted):



import sys

input = sys.stdin.readline

def main():
    a, b, c = map(int, input().split())
    print(b 

main()

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
a, b, x = map(int, input().split())

count = 0
i = 0
min_bai = math.ceil(a/x)  
max_bai = math.floor(b/x)  
x_bai = max_bai - min_bai + 1

print(x_bai)

Failing test case input:
-1 1010010110000100000 3

Expected output:
336670036666700001


Actual output:
336670036666700033


Fixed submission (verdict: Accepted):
import math
from decimal import Decimal
a, b, x = map(int, input().split())
a, b, x = Decimal(a), Decimal(b), Decimal(x)

min_bai = math.ceil(a/x)  
max_bai = math.floor(b/x)  
x_bai = max_bai - min_bai + 1



print(x_bai)

Problem: p03861
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math
(a,b,x)=map(float, input().split(" "))
print(math.floor(b/x)-math.floor((a-1)/x))

Failing test case input:
1 1011010111001000000 1

Expected output:
1011010111001000000


Actual output:
1011010111000999936


Fixed submission (verdict: Accepted):
import math
from decimal import Decimal
(a,b,x)=map(Decimal, input().split(" "))
print(math.floor(b/x)-math.floor((a-1)/x))
Problem: p03861
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,x = map(int, input().split())

count=0
for i in range(b-a+1):
    if b<x :
        break
    if i<x-a :
        i=x-a
    if (a+i)%x == 0 :
        count+=1
        count+=(b-a-i)
        break
print(count)


Failing test case input:
1 0011010111001100000 4

Expected output:
2752527750275000


Actual output:
11010111001099997


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

count=0
if a==0 :
    count+=1

if a<=x :
    ai = x
else:
    ai = (a
    if ai<a :
        ai +=x
if ai<=b :
    count+=1
    count+=(b-ai)

print(count)

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





if __name__ == '__main__':
    a, b, x = list(map(int, input().split()))

    result = (b - a) 

    if (a != b) and ((a % x == 0) or (b % x == 0)):
        result += 1

    print(result)


Failing test case input:
0 1011010111011100000 2

Expected output:
505505055505550001


Actual output:
1011010111011100001


Fixed submission (verdict: Accepted):





if __name__ == '__main__':
    a, b, x = list(map(int, input().split()))

    
    
    fb = (b 
    fa = ((a - 1) 

    if a == 0:
        print(fb)
    else:
        print(fb - fa)

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, X = list(map(int, input().split()))
C = (int(A/X)+(1 if A%X else 0))*X
if B < C:
	print(0)
else:
	print(1+int((B-C)/X))
	


Failing test case input:
1 0011010111001000000 1

Expected output:
11010111001000000


Actual output:
11010111001000001


Fixed submission (verdict: Accepted):
A, B, X = list(map(int, input().split()))
C = (A
if B < C:
	print(0)
else:
	print(1+(B-C)

Problem: p03861
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math
(a,b,x)=map(float, input().split(" "))
print(math.floor(b/x)-math.ceil(a/x)+1)

Failing test case input:
0 1011010111011100000 1

Expected output:
1011010111011100001


Actual output:
1011010111011100033


Fixed submission (verdict: Accepted):
import math
from decimal import Decimal
(a,b,x)=map(Decimal, input().split(" "))
print(math.floor(b/x)-math.floor((a-1)/x))

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
ss = input()
a,b,x = ss.split()
ans = (int(b)-int(a)+1)

print(ans)

Failing test case input:
-2 7 2

Expected output:
5


Actual output:
10


Fixed submission (verdict: Accepted):
ss = input()
a,b,x = ss.split()
ans = (int(b)

print(ans)

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, x = map(int, input().split())








    


        


def f(n):
    if n == -1:
        return 0
    else:
        return int(n / x) + 1




print(f(b) - f(a - 1))



Failing test case input:
0 1010010100000100000 1

Expected output:
1010010100000100001


Actual output:
1010010100000099969


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








    


        


def f(n):
    if n == -1:
        return 0
    else:
        return (n 






print(f(b) - f(a - 1))
Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,x = [int(i) for i in input().split()]


print(int(b/x) - int((a-1)/x))

Failing test case input:
0 0001000111001100000 2

Expected output:
500055500550001


Actual output:
500055500550000


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

res = int(b
print(res)

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, x = map(int, input().split())
a_max = (a-1) 
b_max = b 
if a == 0:
    b_max += 1
print(b_max-a_max)

Failing test case input:
1 1000110100000000000 3

Expected output:
333370033333333333


Actual output:
1000110100000000000


Fixed submission (verdict: Accepted):
a, b, x = map(int, input().split())
a_max = max(((a-1) 
b_max = b 
if a == 0:
    b_max += 1
print(b_max-a_max)

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

a,b,x = map(int, input().split())
ans = (b-a) 
if a % x == 0: ans += 1
  
print(ans)

Failing test case input:
0 1010110111000100000 5

Expected output:
202022022200020001


Actual output:
1010110111000100001


Fixed submission (verdict: Accepted):

a,b,x = map(int, input().split())
ans = (b-a) 
if a!= 0:
  ans = (b 
else:
  ans = (b 
  
print(ans)

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, x = map(int, input().split())

ans = int(b/x) - int(a/x)
if a % x == 0:
  print(ans+1)
else:
  print(ans)

Failing test case input:
0 1011010111011100000 1

Expected output:
1011010111011100001


Actual output:
1011010111011100033


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

ans = (b 
if a % x == 0:
  print(ans+1)
else:
  print(ans)

Problem: p03861
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a,b,x = map(int,input().split())

b = b-(b%x)
a = a if a%x == 0 else a+(x-(a%x))

ans = max(0,(b/x)+1  -(a/x))

print(ans)

Failing test case input:
1 1000000000000000000 3

Expected output:
333333333333333333

Actual output:
3.333333333333333e+17


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

b = b-(b%x)
a = a if a%x == 0 else a+(x-(a%x))

ans = max(0,(b

print(ans)

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

a, b, x = map(int, input().split())
minNum = math.ceil(a / x) * x
print(math.floor((b - minNum)/x) + 1 if minNum <= b else 0)


Failing test case input:
2 1011010111001000000 1

Expected output:
1011010111000999999


Actual output:
1011010111000999937


Fixed submission (verdict: Accepted):
import math

a, b, x = map(int, input().split())
minNum = a 
maxNum = b 
print((maxNum - minNum) if a % x != 0 else b
Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

a, b, x = map(int, input().split())

aan = math.floor(a / x)
ban = math.floor(b / x)

ans = ban - aan
if a % x == 0:
    ans += 1
print(ans)


Failing test case input:
1 1011010111001000000 1

Expected output:
1011010111001000000


Actual output:
1011010111000999936


Fixed submission (verdict: Accepted):
import math

a, b, x = map(int, input().split())

aan = math.floor(a 
ban = math.floor(b 

ans = ban - aan
if a % x == 0:
    ans += 1
print(ans)

Problem: p03861
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
print(int(b/c - ((a-1)/c)))


Failing test case input:
0 1010110111000100000 5

Expected output:
202022022200020001


Actual output:
202022022200020000


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
print(int(b
Problem: p02817
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S ,T = input().split()
print(S+T)

Failing test case input:
ohqc ]sc

Expected output:
]scohqc


Actual output:
ohqc]sc


Fixed submission (verdict: Accepted):
S ,T = input().split()
print(T+S)

Problem: p02817
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(map(str, input().split()))

O = "".join(S)

print(O)



Failing test case input:
qfdp c_r

Expected output:
c_rqfdp


Actual output:
qfdpc_r


Fixed submission (verdict: Accepted):
S,T = map(str, input().split())

O = T+S 

print(O)

Problem: p02817
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b= input().split()

print(a+b)

Failing test case input:
redo atb

Expected output:
atbredo


Actual output:
redoatb


Fixed submission (verdict: Accepted):
a,b= input().split()

print(b+a)

Problem: p02817
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = input().split()
print(a, b)

Failing test case input:
smtf ltgu

Expected output:
ltgusmtf


Actual output:
smtf ltgu


Fixed submission (verdict: Accepted):
a, b = input().split()
print(b + a)

Problem: p02817
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s,t = input().split()
print(s+t)

Failing test case input:
tkue tflu

Expected output:
tflutkue


Actual output:
tkuetflu


Fixed submission (verdict: Accepted):
s,t = input().split()
print(t+s)

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

a,b=map(str,input().split())


print(a+b)

Failing test case input:
fqdo s`b

Expected output:
s`bfqdo


Actual output:
fqdos`b


Fixed submission (verdict: Accepted):

a,b=map(str,input().split())


print(b+a)

Problem: p02817
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=input().split()
print(a[0]+a[1])

Failing test case input:
pqfc sc^

Expected output:
sc^pqfc


Actual output:
pqfcsc^


Fixed submission (verdict: Accepted):
a=input().split()
print(a[1]+a[0])

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


a, b = input().split()
print(a+b)

Failing test case input:
redo atb

Expected output:
atbredo


Actual output:
redoatb


Fixed submission (verdict: Accepted):


a, b = input().split()
print(b+a)

Problem: p02817
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
s,r=input().split()
print(s+r)

Failing test case input:
sltf gtlu

Expected output:
gtlusltf


Actual output:
sltfgtlu


Fixed submission (verdict: Accepted):
s,t=input().split()
print(t+s)

Problem: p02817
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = list(input().split())
print(s[0]+s[1])

Failing test case input:
gums luhu

Expected output:
luhugums


Actual output:
gumsluhu


Fixed submission (verdict: Accepted):
s = list(input().split())
print(s[1]+s[0])

Problem: p02817
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s, t = input().rstrip().split()
print(s + t)

Failing test case input:
tkve tglu

Expected output:
tglutkve


Actual output:
tkvetglu


Fixed submission (verdict: Accepted):
s, t = input().rstrip().split()
print(t + s)
Problem: p02817
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s, t = input().split()
print(s+t)

Failing test case input:
pdfq b_r

Expected output:
b_rpdfq


Actual output:
pdfqb_r


Fixed submission (verdict: Accepted):
s, t = input().rstrip().split()
print(t + s)

Problem: p02817
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
print(''.join(input().split()))

Failing test case input:
sltf ultg

Expected output:
ultgsltf


Actual output:
sltfultg


Fixed submission (verdict: Accepted):
print(''.join(reversed(input().split())))

Problem: p02817
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s,t=input().split()
print(s+t)


Failing test case input:
smtf ltgu

Expected output:
ltgusmtf


Actual output:
smtfltgu


Fixed submission (verdict: Accepted):
s,t=input().split()
print(t+s)

Problem: p02817
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s, t = map(str, input().split())
print(t,s)

Failing test case input:
etlu tglu

Expected output:
tgluetlu


Actual output:
tglu etlu


Fixed submission (verdict: Accepted):
s, t = map(str, input().split())
print(t+s)

Problem: p02817
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
a,b = input().split()

print(a+b, sep = "", end="")

Failing test case input:
teuk uluf

Expected output:
ulufteuk


Actual output:
teukuluf

Fixed submission (verdict: Accepted):
a,b = input().split()

print(b+a, sep = "", end="")

Problem: p02817
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
a,b = input().split()

print(a+b, sep = "")

Failing test case input:
slte ulht

Expected output:
ulhtslte


Actual output:
slteulht


Fixed submission (verdict: Accepted):
a,b = input().split()

print(b+a, sep = "", end="")

Problem: p02817
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
k=input().split()
p=k[0]+k[1]
print(p)


Failing test case input:
odfq c_r

Expected output:
c_rodfq


Actual output:
odfqc_r


Fixed submission (verdict: Accepted):
k=input().split()
p=k[1]+k[0]
print(p)

Problem: p02817
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def func(S, T):
    ans = ''
    for s, t in zip(S, T):
        ans += (t + s)
    return ans
 
 
if __name__ == "__main__":
    S, T = input().split()
    print(func(S, T))

Failing test case input:
odqf r_b

Expected output:
r_bodqf


Actual output:
ro_dbq


Fixed submission (verdict: Accepted):
def func(S, T):
    ans = T + S
    return ans


if __name__ == "__main__":
    S, T = input().split()
    print(func(S, T))

Problem: p02817
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    [s, t] = input().split()
    print(s + t)

if __name__ == "__main__":
	main()

Failing test case input:
cqhp ]tc

Expected output:
]tccqhp


Actual output:
cqhp]tc


Fixed submission (verdict: Accepted):
def main():
    [s, t] = input().split()
    print(t + s)

if __name__ == "__main__":
	main()

Problem: p02817
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s,t = input().split()
print(s+t)

Failing test case input:
smtf ltgu

Expected output:
ltgusmtf


Actual output:
smtfltgu


Fixed submission (verdict: Accepted):
s,t = input().split()
print(t+s)