Problem:


Score : 100 points

Problem Statement

There are three houses on a number line: House 1, 2 and 3, with coordinates A, B and C, respectively.
Print Yes if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print No otherwise.

Constraints

0\leq A,B,C\leq 100

A, B and C are distinct integers.

Input

Input is given from Standard Input in the following format:

A B C

Output

Print Yes if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print No otherwise.

Sample Input 1

3 8 5

Sample Output 1

Yes

We pass the coordinate 5 on the straight way from the house at coordinate 3 to the house at coordinate 8.

Sample Input 2

7 3 1

Sample Output 2

No

Sample Input 3

10 2 4

Sample Output 3

Yes

Sample Input 4

31 41 59

Sample Output 4

No



Sample input:
3 8 5


Sample output:
Yes

Submission status: Runtime Error

Solution code:
from itertools import accumulate


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

black = [0]*N
white = [0]*N

for i, s in enumerate(S):
    if s == '#':
        black[i] = 1
    else:
        white[i] = 1

# 累積和
black = [0] + black
black = list(accumulate(black))
white = [0] + white[::-1]
white = list(accumulate(white))[::-1]

ans = []
for i in range(N+1):
    ans.append(black[i] + white[i])

print(min(ans))

Submission status: Runtime Error

Solution code:
N = int (input ())
S = str (input ())
 
def dot_num ():
    cnt = 0
    for i in range (N):
        if S [i] == '.':
            cnt += 1
    return cnt
 
def hash_num ():
    cnt = 0
    for i in range (N):
        if S [i] == '#':
            cnt += 1
    return cnt
 
dots = dot_num ()
hashes = hash_num ()
 
if S [0] == '.':
    dots -= 1
 
if S [N-1] == '#':
    hashes -= 1
    
print (min (dots, hashes))

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline

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

left = 0
right = s.count(".")
res = min(right, s.count("#"))
for i in range(n):
    if s[i] == "#":
        left += 1
    else:
        right -= 1
    res = min(res, left+right)

print(res)

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
w=b=0
mn=0
for sk in s:
    if sk=="#":
        b+=1
    else:
        w-=1
    if mn>b+w:
        mn=b+w
print(mn-w)

Submission status: Runtime Error

Solution code:
# -*- coding:utf-8 -*-

def solve():
    N = int(input())
    S = input()

    kuro_num = 0
    siro_num = 0
    for moji in S:
        if moji == "#":
            kuro_num += 1
        else:
            siro_num += 1

    if siro_num == N:
        print(0)
        exit()

    # ..........############ のパターン
    rest_kuro_num = kuro_num
    rest_siro_num = siro_num
    ans = siro_num
    for i in range(0, len(S)):
        num = rest_siro_num
        if S[i] == "#":
            num += 1 + (kuro_num - rest_kuro_num)
            rest_kuro_num -= 1
        else:
            num += kuro_num - rest_kuro_num
            rest_siro_num -= 1
        ans = min(ans, num)

    print(ans)

if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
N = int(input())
S = list(input())

count_list =[]
wc = 0

A=[0]*(N)

for i in list(range(N-1))[::-1]:
    if(S[i] == '#'):
        A[i] = A[i+1] + 1

for n in range(N-1):
    if(S[n] == '.'):
        num = n
        count_list.append(A[n+1] + wc)
        wc += 1

if(S[N-1] == '.'):
    count_list.append(wc+1)

count = min(count_list)
print(count)

Submission status: Runtime Error

Solution code:
N=input()
s=input()

N=int(N)
wn=[]
bn=[]
a=0
b=0

#各行間よりも前と後ろに何個白（黒）があるかをカウント
for i in range(N):
    j=N-(i+1)
    if(s[j]=="."):
        a+=1
    if(s[i]=="#"):
        b+=1
    bn.insert(0,a)
    wn.append(b)
bn.append(0)
wn.insert(0,0)
#print(bn)
#print(wn)

#各行間のscore算出
min=1000000
for i in range(N+1):
    score=bn[i]+wn[i]
    if(score<min):
        min=score

print(min)

Submission status: Runtime Error

Solution code:
N = int(input())
str = list(input())
K = int(input())
str_list = list(str)
for i in range(N):
    if str[i] != str[K]:
        str[i] = '*'
str_changed = ''.join(str)
print(str_changed)

Submission status: Runtime Error

Solution code:
n = int(input())
s = str(input())
len_s = range(n)

for i in len_s:
    if s[i] == "#":
        s = s[i::]
        break
count_sharp = s.count("#")
count_dot = s.count(".")
if min(count_dot, count_sharp) == 0:
    print(0)
else:
    print(min(count_dot, count_sharp))

Submission status: Runtime Error

Solution code:
N = int(input())
S = list(input())

count_list =[]
wc = 0

A=[0]*(N+1)

for i in list(range(N))[::-1]:
    if(S[i] == '#'):
        A[i] = A[i+1] + 1

print(A)
for n in range(N-1):
    if(S[n] == '.'):
        num = n
        count_list.append(A[n+1] + wc)
        wc += 1

if(S[N-1] == '.'):
    count_list.append(wc+1)

count = min(count_list)
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
c = 0
A = int(S.count("."))
B = N - A
if len(S) == N:
    if 1 <= N <= 2 * 10 ** 5:
        if "." in S:
            if "#" in S:
                S.replace(".#","ee")
                D = S.find("e")
                C = N - D + 1                
                print(N - C + B + 1)
            else:
                print(0)
        else:
            print(0)

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    N = int(input())
    S = str(input())

    sharp_place = S.find("#")

    if sharp_place == -1:
        ok_pattern1 = "."*N
    else:
        ok_pattern1 = "."*sharp_place + "#" * (N-sharp_place)

    answer1 = 0

    for j in range(0, len(ok_pattern1)):
        if ok_pattern1[j] != S[j]:
            answer1 += 1

    print(answer1)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
print(['No','Yes'][b<=min(a,c) or b=>max(a,c)])

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
r = [S[:N].count("#") + S[N:].count(".") for _ in range(N)]  
print(min(r))

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
ans = s.count('.')
tmp = ans
for i in s:
    if i == '.':
        tmp -= 1
    else:
        tmp += 1
    ans = min(ans,tmp)
print(ans)

Submission status: Runtime Error

Solution code:
  A, B, C = map(int, input().split())
   
  if(A<C and C<B) or (B<C and C<A):
      print('Yes')
  else:
      print('No')

Submission status: Runtime Error

Solution code:
stone=input()
color=input()
a=int(stone)
counter=0
counter2=0
black = 0
white = 0
xxx=[]
yyy=[]
list=[]
list2=[]
for i in range(a):
    list.append(color[i])
for i in range(a):
    if list[i]=='#':
        xxx.append(i)
        black += 1
    if list[i]=='.':
        yyy.append(i)
        white += 1
if white ==0 or black==0:
    print('0')
else:
   i =0
for i in range(a):
    for j in range(0,i):
        if list[j]=='#':
            counter = counter+1
    for k in range(i,a):
        if list[k]=='.':
            counter = counter+1
    list2.append(counter)
print(min(counter))

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()

# the number of '#'
p0 = s.count('#')

# the number of '.'
p1 = n - p0

p_min = min(p0, p1)

wb_ = 0
bw_ = 0
for i in range(n):

    if s[i] == '.':
        bw = bw_ 
        wb = p1
    else:
        bw = bw_ + 1
        wb = p1 - 1
    
    p_min = min(p_min, (bw + wb))

print(p_min)

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(input())
sharp=[]
dot=[]
c=s[0]
if s[0]!=".":
    dot.append(0)
cnt=1
i=0
while i<n-1:
    while True:
        if s[i+1]==s[i]:
            cnt+=1
            i+=1
            if i>=n-1:
                if s[i-1]==".":
                    dot.append(cnt)
                else:
                    sharp.append(cnt)
                break
        else:
            if s[i]==".":
                dot.append(cnt)
            else:
                sharp.append(cnt)
            i+=1
            cnt=1
            break
if s[-2]!=s[-1]:
    if s[-1]==".":
        dot.append(1)
    else:
        sharp.append(1)
if len(dot)>len(sharp):
    sharp.append(0)
ans=sum(dot[1:])
tmp=0
for i in range(len(dot)-1):
    tmp=ans-dot[i+1]+sharp[i]
    ans=min(tmp,ans)
print(ans)

Submission status: Runtime Error

Solution code:

a,b,c=map(int,split(input()))
if (a<=c) and (c<=b):
	return "Yes"
else:
	return "No"

Submission status: Runtime Error

Solution code:
def chec(s):
    llis = []
    rlis = []
    clis = 0
    lef = 1
    rig = 1
    rtmp = 0
    ltmp = 0
    flg = 0
    na = len(s)
    for i in range(na):
        if na - i != 1 and s[na-i-1] == '#' and s[na-i] == '.' :
            #clis+= 1
            #print(i)
            rtmp = na - i
            ltmp = na - i-1
            while ltmp != 0 and s[ltmp] == s[ltmp-1]:
                lef += 1
                ltmp -= 1
            llis.append(lef)
            while rtmp != na and s[rtmp] == s[rtmp+1]:
                rig += 1
                rtmp += 1
            rlis.append(rig)
            lef = 1
            rig = 1
            rtmp = 0
            ltmp = 0
    #print(llis)
    #print(rlis)

    clis = min(sum(llis),sum(rlis))
    return clis


n = int(input())
s = list(input())
print(chec(s))

Submission status: Runtime Error

Solution code:
N = int(input())
stones = input().rstrip()
pre_word = stones[0]
stones_list =[]
counter = 0

for i in range(N):
    stones_list.append(stones[i])

for i in range(N):
    present_word = stones_list[i]
    if pre_word == '#' and present_word =='.':
        counter += 1
    pre_word = stones_list[i]

print(counter)

Submission status: Runtime Error

Solution code:
n=int(input())
s = input()
n=len(s)

post = ''
ans=0
data=[]

left=[]
right=[]

tmp=0
for i in range(n):
    if s[i]=='#':
        tmp+=1
    elif tmp!= 0:
        left.append(tmp)
        tmp=0


tmp=0
for i in range(n):
    if s[n-i-1]=='.':
        tmp+=1
    if n-i-1-1 >=0 and s[n-i-1-1]=="#" and tmp!=0:
        right.append(tmp)
        tmp=0

right.reverse()
# print(s)
# print(left)
# print(right)

for i in range(len(left)):
    if i == len(left)-1:
        ans+=min(left[i],right[i])
        break
    l = left[i]
    r = right[i]
    if l >= r:
        ans+=r
        left[i+1]=l+r+left[i+1]
    else:
        ans+=l


print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
S = lisr(input())
cnt = 0
for i in range(1, N-1):
    if S[i-1] == "#" and S[i] == ".":
        s[i] = "."
         cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
A, B, C  =  map(int, input().sprt))

Submission status: Runtime Error

Solution code:
N=int(input())
s=input()
tmp=N
for i in range(N+1) :
  k=s[:i].count("#")+s[i:N].count(".")
  if tmp>k:
    tmp=k
print(tmp)

Submission status: Runtime Error

Solution code:
N = int(input())
S = lisr(input())
cnt = 0
for i in range(1, N-1):
    if S[i-1] == "#":
        for j in range(i, N-1):
             if S[j] ==  ".":
                 cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
count = 0
bunki = N
countb = 0
l = N-1
for i in range(0, N):
	if(S[i] == '#'):
		bunki = i
		break
if(bunki != N):
	for j in range(bunki, N):
		if(S[j] == '.'):
			count += 1
		else:
			countb += 1 
	while(0 < l):
		if(S[l] == '#'):
			countb -= 1
		else:
			break
		l -= 1
if(countb < count):
	print(countb)
else:
	print(count)

Submission status: Runtime Error

Solution code:
import re
n = int(input())
s = input()
if not '#' in s:
    print(0)
else:
    s = '#.' + s.split('#.', 1)[-1] if '#.' in s else  s
    ptn = re.search(re.compile('\.#+?$'), s)
    if ptn:
        s = s[:ptn.end()]
    print(min(s.count('.'), s.count('#')))

Submission status: Runtime Error

Solution code:
a = input()
b = a.split()
N = int(b[0])
S = list(b[1])
K = int(b[2])
lit = S[K-1]
for i in range(N):
    if S[i] != lit:
        S[i] = "*"
        
print("".join(S))

Submission status: Runtime Error

Solution code:
import sys

import numpy as np

readInt = lambda: int(sys.stdin.readline())
readIntN = lambda: [int(v) for v in sys.stdin.readline().split(" ")]

total = 0
n = readInt()
aa = []
for i in range(n):
    v = readInt()
    aa.append(v)
    total += v

memo = {}
def dfs(a, b, c, i):
    if i == len(aa):
        ret = 1 if c < a + b else 0
        memo[(a, b, c)] = ret
        return ret
    if total < (2 * c):
        memo[(a, b, c)] = 0
        return 0
    if (a, b, c) in memo:
        return memo[(a, b, c)]

    ret = 0
    v0 = sorted([a + aa[i], b, c])
    ret = (ret + dfs(v0[0], v0[1], v0[2], i + 1)) % 998244353

    v1 = sorted([a, b + aa[i], c])
    ret = (ret + dfs(v1[0], v1[1], v1[2], i + 1)) % 998244353

    v2 = sorted([a, b, c + aa[i]])
    ret = (ret + dfs(v2[0], v2[1], v2[2], i + 1)) % 998244353

    memo[(a, b, c)] = ret
    return ret

print(dfs(0, 0, 0, 0))

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()

s = S.lstrip('.').rstrip('#')

w = s.count('.')
b = n - w

if w < b:
    print(w)
else:
    print(b)

Submission status: Runtime Error

Solution code:
kazu = int(input())
isi = input()
isilst = []
count=0
for i in range(kazu-1):
    if isi[i] =="#" and isi[i + 1] == ".":
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
def remove_fwhite(S):
    fwhite = 0
    for fw in S:
        if fw == '.':
            fwhite += 1
        else:
            break
    return fwhite

def remove_fblack(S):
    fblack = 0
    for fb in S[::-1]:
        if fb == '#':
            fblack += 1
        else:
            break
    return fblack

def count_stone(S):
    black = 0
    white = 0
    for stone in S:
        if stone == '#':
            black += 1
        else:
            white += 1
    print(min(black,white))

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


fw = remove_fwhite(S)
fb = remove_fblack(S)
#print('fw:')
#print(fw)
#print('fb:')
#print(fb)
#print(S[fw:N-fb])
if fw == 0 or fb == 0:
    count_stone(S)
elif fw == N:
    print('0')
else:
    count_stone(S[fw:N-fb])

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(str(input()))
lis = []
for i in range(1,n):
    lis.append(s[:i:].count("#") + s[i::].count("."))
lis.append(s.count("#"))
lis.append(s.count("."))
lis.sort()
print(lis[0])

Submission status: Runtime Error

Solution code:
N=int(input())
S=input()
cnt1 = 0
cnt2 = 0
for idx,s in enumerate(S):
    if s == "#" and idx < N-1:
        cnt1+=1
    if s=="." and N!=0:
        cnt2+=1
if cnt1 < cnt2:
    print(cnt1)
else:
    print(cnt2)

Submission status: Runtime Error

Solution code:
stone=input()
color=input()
a=int(stone)
counter=0
counter2=0
black = 0
white = 0
xxx=[]
yyy=[]
list=[]
for i in range(a):
    list.append(color[i])
for i in range(a):
    if list[i]=='#':
        xxx.append(i)
        black += 1
    if list[i]=='.':
        yyy.append(i)
        white += 1
if white ==0 or black==0:
    print('0')
else:
    s = min(xxx)
    t = max(yyy)
    for k in range(s,a):
        if list[k]=='.' :
            counter = 1+ counter
    for j in range(0,t):
        if list[j]=='#':
            counter2 = 1 +counter2
    if counter < counter2:
        print(counter)
    else:
        print(counter2)

Submission status: Runtime Error

Solution code:
N=int(input())
# S=input()
S = ["#" for i in range(200000)]
S[0] = "."
S = "".join(S)
cnt1 = 0
cnt2 = 0
for idx,s in enumerate(S):
    if s == "#" and idx < N-1:
        cnt1+=1
    if s=="." and N==0:
        cnt2+=1
if cnt1 < cnt2:
    print(cnt1)
else:
    print(cnt2)

Submission status: Runtime Error

Solution code:
a = input()
b = a.split()
N = int(b[0])
S = list(b[1])
K = int(b[2])
lit = S[K-1]
for i in range(N):
    if S[i] != lit:
        S[i] = '*'
print(''.join(S))

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()


ini_w = 0
for i in range(len(S)):
    if S[i] == '.':
        ini_w = ini_w + 1
    else:
        break
    
if ini_w >= len(S)-1:
    print(0)
    exit()
    


last_b = 0

for i in range(len(S)):
    if S[len(S)-i-1] == '#':
        last_b = last_b + 1
    else:
        break

S = S[ini_w:len(S)-last_b]

if S == '':
    print(0)

all_w = len(S) - S.count(".")
all_b = len(S) - all_w

print(min(all_w,all_b))

Submission status: Runtime Error

Solution code:
N = int(input())
S = lisr(input())
cnt = 0
for i in range(1, N):
    if S[i-1] == "#" and S[i] == ".":
        s[i] = "#"
         cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
import sys

def solve(N, S, K):
    char = S[K]

    ans = ''
    for i in xrange(len(S)):
        ans += S[i] if S[i] == char else '*'
    return ans

if __name__ == '__main__':

    N = sys.stdin.readline().strip()
    S = sys.stdin.readline().strip()
    K = sys.stdin.readline().strip()
    ans = solve(int(N), S, int(K))
    print ans

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
s = str(input())
s = s.replace(".", "0").replace('#', "1")
b = s.find("1")
a = 0
for i in range(b, n):
    a+=int(s[i])
s = [int(n) for n in s]
sums = sum(list(s))
print(min(sums, n-sums, n-b-a))

Submission status: Runtime Error

Solution code:
N=int(input())
s=input()
tmp=[s[:i].count("#")+s[i:N].count(".") for i in range(N+1)]
print(min(tmp)+1)

Submission status: Runtime Error

Solution code:
N = int(input())
S = lisr(input())
cnt = 0
for i in range(1, N):
    if S[i-1] == "#" and S[i] == ".":
        s[i-1] = "."
         cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
import re
n = int(input())
s = input()
if not '#' in s:
    print(0)
else:
    s = s.rsplit('.#', 1)[0] + '.#' if '.#' in s else  s
    ptn = re.search(re.compile('\.#+?$'), s)
    if ptn:
        s = s[:ptn.start()]
    print(min(s.count('.'), s.count('#')))

Submission status: Runtime Error

Solution code:
N=int(input())
s=input()
tmp=[s[:i].count("#")+s[i:N].count(".") for i in range(N+1)]
print(min(tmp))

Submission status: Runtime Error

Solution code:
N = int(input())
S = lisr(input())
cnt = 0
for i in range(1, N):
    if S[i-1] == "#" :
        s[i] = "."
         cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
ia, ib, ic = map(int, input().split())

if ia > ib > ic:
    print("No")
elif ia < ib < ic:
    print("No")
else
    print("Yes")

Submission status: Runtime Error

Solution code:
def solve():
  N = int(input())
  S = input()
  stones = []
  look = S[0]
  cnt = 0

  if S[0] == '.': stones.append(0)
  for s in S:
    if look == s: cnt += 1
    else:
      stones.append(cnt)
      cnt = 1
      look = s
  stones.append(cnt)
  if S[N - 1] == '#': stones.append(0)

  count = sum(stones[1::2])
  ans = count

  for i in range(0, len(stones), 2):
    count = count + stones[i] - stones[i + 1]
    if ans > count: ans = count
  return ans

print(solve())

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
count = 0
for i, s in enumerate(S.split("#")):
     if i == 0:
         continue
     else:
         count += s.count(".")
if count > S.count("#"):
    count = S.count("#")
print(count)

Submission status: Runtime Error

Solution code:
    import sys
     
    args = list(map(int, input().split()))
         
    if (args[0] < args[1] and args[1] < args[2]) or (args[2] < args[1] and args[1] < args[0]):
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
N=int(input())
s=input()
tmp=N
for i in range(N+1):
    a=s[:i].count("#")
    b=s[i:N].count(".")
    if tmp>a+b:
        tmp=a+b
print(tmp)

Submission status: Runtime Error

Solution code:
a, b, c = input().split()
if a < b and b < c:
  print 'No'
elif a < c and c < b:
  print 'Yes'
elif b < c and c < a:
  print 'Yes'
elif b < a and a < c:
  print 'No'
elif c < a and a < b:
  print 'Yes'
elif c < b and b < a:
  print 'No'

Submission status: Runtime Error

Solution code:
import re

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

keychar = s[k-1]
mask = "*"
mask2 = "1"

masked = re.sub(r'%s'%keychar, mask2, s)
masked = re.sub(r'[a-z]', mask, masked)
masked = re.sub(r'%s'%mask2, keychar, masked)
print(masked)

Submission status: Runtime Error

Solution code:
a = input()
b = input()
c = input()
if a < b and b < c:
  print 'No'
elif a < c and c < b:
  print 'Yes'
elif b < c and c < a:
  print 'Yes'
elif b < a and a < c:
  print 'No'
elif c < a and a < b:
  print 'Yes'
elif c < b and b < a:
  print 'No'

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
count = 0
count2 = 0
flag = False
for x in range(N):
    if S[x] == '#':
        flag = True
    if S[x] == '.' and flag == True:
        count += 1

flag = False

for x in range(N)[::-1]:
    if S[x] == '.':
        flag = True
    if S[x] == '#' and flag == True:
        count2 += 1

print(min(count,count2))

Submission status: Runtime Error

Solution code:
N = int(input())
S = lisr(input())
cnt = 0
for i in range(1, N):
     if S[i-1] == "#":
         if S[i] == ".":
             S[i] = "#"
             cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
r_str = r_str.split()
r = [int(s) for s in r_str]
a = 'Yes'
 
if r[0] <= r[1]:
    if r[0] <= r[2] and r[2] <= r[1]:
        a = 'Yes'
    else:
        a = 'No'
else:
    if r[1] <= r[2] and r[2] <= r[0]:
        a = 'Yes'
    else:
        a = 'No'
 
print(a)

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())
c = 0
b = s[:n-1].count('#')
w = s[1:].count('.')
for i in range(n-1):
 if s[i] == '#' and s[i + 1] == '.':
  c += 1
  s[i +1] = '#'

print(min(c,b,w))

Submission status: Runtime Error

Solution code:
a,b,c=map(int,split(input()))
if (a<=c)and(c<=b):
	print("yes")
else:
	print("no")

Submission status: Runtime Error

Solution code:
n = int(input())
s = input().rstrip()
s = s.rstrip('#')
if len(s) == 0:
    print(0)
    exit()

start = s.find('#.')
if start == -1:
    print(0)
    exit()
print(s.count('.', start))

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
C = int(input())

A, B, C = map(int, input().split())
if A < C < B:
    print('Yes')
else:
   print('No')

Submission status: Runtime Error

Solution code:
import sys


def count(split_haichi):
    black_count = sum([x == '#' for x in split_haichi])
    white_count = len(split_haichi) - black_count
    return min(black_count, white_count)


a = []
for l in sys.stdin:
    a.append(l)

num = int(a[0])
haichi = a[1]
count_list = []

black_all_count = sum([x == '#' for x in haichi])
white_all_count = num - black_all_count
for i in range(num-1):
    if haichi[i] == '#':
        split_haichi_1 = haichi[:i+1]
        split_haichi_2 = haichi[i+1:]

        black_count_1 = sum([x == '#' for x in split_haichi_1])
        white_count_1 = len(split_haichi_1) - black_count_1

        black_count_2 = black_all_count - black_count_1
        white_count_2 = white_all_count - white_count_1

        count_list.append(min(black_count_1, white_count_1) + min(black_count_2, white_count_2))

print(min(count_list))

Submission status: Runtime Error

Solution code:
a, b, c = input().split()
if a < b and b < c:
  print 'No'

if a < c and c < b:
  print 'Yes'

if b < c and c < a:
  print 'Yes'

if b < a and a < c:
  print 'No'
  
if c < a and a < b:
  print 'Yes'
  
if c < b and b < a:
  print 'No'

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()

black_start = s.find("#")
black_end = s.rfind("#")

white_start = s[black_start:].find(".")
white_end = s[black_start:].rfind(".")

black = s[black_start:].count("#")
white = s[black_start:].count(".")

if black == 0 or white ==0:
    print(0)
else:
    if white_end < black_end:
        print(black-1)
    else:
        print(min(black, white))

Submission status: Runtime Error

Solution code:
a, b, c = input().split()

if a < b and b < c:
  print 'No'

if a < c and c < b:
  print 'Yes'

if b < c and c < a:
  print 'Yes'

if b < a and a < c:
  print('No')
  
if c < a and a < b:
  print('Yes')
  
if c < b and b < a:
  print('No')

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
S = list(S)

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

if S[0] == '.':
    tmp[0] = 1

for i in range(N):
    if S[i] == '.':
        tmp[i+1] = tmp[i] + 1
    else:
        tmp[i+1] = tmp[i]
  
res1 = 10 ** 9
for i in range(N):
    res1 = min((i+1) - tmp[i] + tmp[N] - tmp[i+1], res1)
        
b = 0
w = 0
for i in range(N):
    if S[i] == '#':
        b += 1
    else:
        w += 1

res3 = N - max(b, w)

print(min(res1, res3))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3

a,b,c = map(int,input().spliy())

if a < c and c < b:
    print("Yes")

elif b < c and c < a:
    print("Yes")

else:
    print("No")

Submission status: Runtime Error

Solution code:
a, b, c = input().split()

if a < b and b < c:
  print 'No'

if a < c and c < b:
  print('Yes')

if b < c and c < a:
  print('Yes')

if b < a and a < c:
  print('No')
  
if c < a and a < b:
  print('Yes')
  
if c < b and b < a:
  print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
flag = 0
location1 = 0
location2 = n
for i in range(n):
    #    print(s[i])
    if s[i] == '#':
        location1 = i
        flag = 1
        break

i = 0

for i in range(n):
    #    print(s[n-i-1])
    if s[n-i-1] == '.':
        location2 = n - i - 1
        flag = 2
        break


if flag == 0:
    print(0)
else:
    print(min(s[location1:n].count('.'), s[0:location2].count('#')))

Submission status: Runtime Error

Solution code:
a, b, c = input().split()

if a < b and b < c:
  return 'No'

if a < c and c < b:
  print('Yes')

if b < c and c < a:
  print('Yes')

if b < a and a < c:
  print('No')
  
if c < a and a < b:
  print('Yes')
  
if c < b and b < a:
  print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())
c = 0
b = s[:n-1].count('#')
w = s[:n-1].count('.')
for i in range(n-1):
 if s[i] == '#' and s[i + 1] == '.':
  c += 1
  s[i +1] = '#'

print(min(c,b,w))

Submission status: Runtime Error

Solution code:
N=int(input())
ls_S=list(input())
i=0
I=0
cnt_1=0
cnt_2=0


while ls_S[i]==".":
    i+=1
    I+=1

for x in range(I,N):
    if ls_S[x]==".":
        ls_S[x]="#"
        cnt_1+=1
for x in range(I,N):
    if ls_S[x]=="#":
        ls_S[x]="."
        cnt_2+=1
if cnt_1>cnt_2:
    print(cnt_2)
else:
    print(cnt_1)

Submission status: Runtime Error

Solution code:
a, b, c = input().split()

if a < b and b < c:
  print('No')

if a < c and c < b:
  print('Yes')

if b < c and c < a:
  print('Yes')

if b < a and a < c:
  print('No')
  
if c < a and a < b:
  print('Yes')
  
if c < b and b < a:
  print(No)

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
n=int(input())
l=list(input())
m=0
b_ans=n
for i in range(len(l)-1):
    if (l[i]=="#" and l[i+1]=="."):
        b=l[m:].count(".")+l[:m].count("#")
        if(b<b_ans):
            b_ans=b
        #print(lm)

a=l.count("#")
c=l.count(".")
ans=min(a,b_ans,c)
print(ans)
#print(lm)

Submission status: Runtime Error

Solution code:
import sys

def count(split_haichi):
    black_count = sum([x == '#' for x in split_haichi])
    white_count = sum([x == '.' for x in split_haichi])
    return min(black_count, white_count)

a = []
for l in sys.stdin:
    a.append(l)

num = int(a[0])
haichi = a[1]
count_list = []
for i in range(num-1):
    split_haichi_1 = haichi[:i+1]
    split_haichi_2 = haichi[i+1:]
    count_1 = count(split_haichi_1)
    count_2 = count(split_haichi_2)
    count_list.append(count_1 + count_2)

print(min(count_list))

Submission status: Runtime Error

Solution code:
A, B, C = input().split()

if a < b and b < c:
  print('No')

if a < c and c < b:
  print('Yes')

if b < c and c < a:
  print('Yes')

if b < a and a < c:
  print('No')
  
if c < a and a < b:
  print('Yes')
  
if c < b and b < a:
  print(No)

Submission status: Runtime Error

Solution code:
l = list(map(int, input().split()))

if l[0] < l[2] && l[1] < l[2]:
 print('No')
elif l[2] < l[0] && l[2] < l[0]:
 print('No')
else:
 print('Yes')

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
n=int(input())
l=list(input())
m=0
b_ans=n
for i in range(len(l)-1):
    if (l[i]=="#" and l[i+1]=="."):
        b=l[m:].count(".")+l[:m].count("#")
        b_ans=min(b,b_ans)
        #print(lm)

a=l.count("#")
c=l.count(".")
ans=min(a,b,c)
print(ans)
#print(lm)

Submission status: Runtime Error

Solution code:
n = int(input())
s = str(input())


def func(input_s):
    count = input_s.count(".")
    for c, i in enumerate(s):
        if c == "." and i != 0 and input_s[i - 1] == "#":
            tmp_str = input_s
            tmp_str[i - 1] = "."
            tmp_count = func(tmp_str[i:])
            count = min(tmp_count + 1, count)
    return count


pre = ""
print(func(s))

Submission status: Runtime Error

Solution code:
a = int(input())

b = int(input())

c = int(input())

d = max([ a , b ])

e = c - d

if e > 0 :
    print("No")

print("Yes")

Submission status: Runtime Error

Solution code:
N = int(input())
word = input()
word_list=[]
word_num = int(input())

for i in range(len(word)):
    word_list.append(word[i])
    if str(word[i]) != str(word[word_num -1]):
         word_list[i] = '*'

print(" ".join(list(map(str,word_list))))

Submission status: Runtime Error

Solution code:
input_str = input()
homes = input_str.split(" ")
for home in homes:
    home = int(home)
print(homes)
if ((homes[2] - homes[1]) * (homes[2] - homes[0]) < 0):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N=int(input())
S=input()
S=S+'#'
sc=0
tc=0
ans=0
for i in range(N+1):
    if(tc!=0 and S[i]=='#'):
        if(sc>tc):
            ans+=tc
            sc+=tc
        else:
            ans+=sc
            sc=0
        tc=0

    if(sc!=0 and S[i]=='.'):
        tc+=1
    elif(tc==0 and S[i]=='#'):
        sc+=1
print(str(ans))

Submission status: Runtime Error

Solution code:

a,b,c=[int(imput()).split for i in range(3)]

if (a < b < c) or (c < b < a):
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
#C - Stones
n = int(input())
s = list(input())
isFound = False
cnt = 0
right = 0
#一番右の白を見つける
for i in range(n):
    if s[i] == '.':
        right = max(right, i)
#rightまでの黒を数える
for i in range(right+1):
    if s[i] == '#':
        cnt += 1
print(min(s.count('.'), s.count('#'), cnt))

Submission status: Runtime Error

Solution code:
a = int(input())

b = int(input())

c = int(input())

d = max( a , b )

e = c - d

if e > 0 :
    print("No")

print("Yes")

Submission status: Runtime Error

Solution code:
input_str = input()
homes = input_str.split(" ")
for home in homes:
    home = int(home)
print(homes)
if ((homes[3] - homes[1]) * (homes[3] - homes[2]) < 0):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N = int(input())
S = [i for i in input()]
for i in range(N):
    if(S[i]=='#'):
        break
s = S[i:]
if(i==0):
    print(0)
else:
    a = s.count('#')
    print(min(a,len(s)-a))

Submission status: Runtime Error

Solution code:
a,b,c = list(map(int,input().split()))

if b-c > 0 and c-a > 0:
    print("Yes")
else if a-b > 0 and b-c > 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
a,b,c = map(int, input().split())

if a<c<b or b<c<a:
  print('Yes)
else:
  print('No)

Submission status: Runtime Error

Solution code:
N = int(input())
a = [int(input()) for i in range(N)]

sum_ = sum(a)
count = 0
for j in range(2,N):
    for i in list(itertools.combinations(a,j)):
        if(2*sum(i)>sum_):
            for m in range(1,len(i)):
                for k in list(itertloos.combinations(i,m)):
                    if(sum_>2*sum(k) and sum_>2*(sum(i)-sum(k))):
                        count += 1
count = count * 6