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:
input()
S=input()
k=int(input())
for s in S:print(s if s == S[k-1] else '*',sep='')

Submission status: Runtime Error

Solution code:
input()
S=input()
k=int(input())
for s in S:print(s if s == S[k-1] else '*',end='')

Submission status: Runtime Error

Solution code:
input()
S=input()
k=int(input())
for s in S:print(s if s == s[k+1] else '*',end='')

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
k = int(input())
for i in range(length(s))
	if s[i] != s[k]
  		s[i] = *
print(s)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
if c in list(range(min(a,b),max(a,b)):
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
l=list(map(int,input().split()))
if max[l]!=l[2] and min(l)!=l[2]:
  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:
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())
S=input()
b=0
w=S.count(".")
ans=b+w
for s in S:
    if s=="#":
        b+=1
    else:
        w-=1
    ans=min(ans, b+w)
print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
S=input()
b=0
w=S.count(".")
ans=b+w
for s in S:
  if s=="#":
    b+=1
  else:
    w-=1
  ans=min(ans, b+w)
print(ans)

Submission status: Runtime Error

Solution code:
    N=int(input())
    S=input()
    b=0
    w=S.count(".")
    ans=b+w
    for s in S:
      if s=="#":
        b+=1
      else:
        w-=1
      ans=min(ans, b+w)
    print(ans)

Submission status: Runtime Error

Solution code:
x = map(int, input().split())
x = x[0], x[2], x[1]
print("Yes" if all(map(lambda x, y: x==y, x, sorted(x))) else "No")

Submission status: Runtime Error

Solution code:
x = input().split()
x = x[0], x[2], x[1]
print("yes" all(map(lambda x, y: x==y, x, sorted(x))) else "No")

Submission status: Runtime Error

Solution code:
n = int(input())
S = input()
s = list(S)
j = list(S)
ans = 0
aans = 0
for i in range(n-2,-1,-1):
    if s[i] == "#" and s[i+1] == ".":
        ans += 1
        s[i+1] = "#"
for i in range(n-1):
    if j[i] == "#" and j[i+1] == ".":
        aans += 1
        j[i+1] == "#"
print(min(ans,aans))

Submission status: Runtime Error

Solution code:
A,B,C=map(int,input().split())
ans="No"
if A>B:
  if B<C and C<A:
    ans="Yes"
elif A<B:
    if A<C and C<B:
    ans="Yes"
print(ans)

Submission status: Runtime Error

Solution code:
def answer(B, C):
    if B > C:
        print("Yes")
    else:
        print("No")


def main():
    A, B, C = [int(x) for x in stdin.readline().split()]
    if A < B:
        answer(B, C)
    else:
        answer(C, B)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(input())
k=int(input())
l=s[k-1]
for i in range(n):
  if s[i]!=l:
    s[i]="*"
print("".join(s))

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())
if (a<b&&b<c)||(b<a&&c<b):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
#coding:utf-8

A, B, C = (int(x) for x in input().split())

if A <= C <= B || B <= C <= A:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

for i in range(a, b+1):
	if i=c:
		print("Yes")
		exit()
print("No")

Submission status: Runtime Error

Solution code:
a, b, c = [int(i) for i in input().split()]

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 = input()
B = input()
C = input()
if A > C > B :
    print("Yes")
elif B > C > A :
    print("Yes")
else :
    print("No")

Submission status: Runtime Error

Solution code:
A = input()
B = input()
C = input()
if A < B:
    D = B
    E = A
else :
    E = B
    D = A

if D > C > E :
    print("Yes")
else :
    print("No")

Submission status: Runtime Error

Solution code:
A = input()
B = input()
C = input()
if A < B:
    D = B
    E = A
else :
    E = B
    D = A
if D > C > E :
    print("yes")
else :
    print("no")

Submission status: Runtime Error

Solution code:
A = input()
B = input()
C = input()
if A < B:
    D = B
    E = A
else :
    E = B
    D = A

if D > C > E :
    print("yes")
else :
    print("no")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
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:
#include <bits/stdc++.h>
using namespace std;
int main( int argc, char *argv[] )
{int a,b,c;
cin>>a>>b>>c;
if((a<c&&c<b)||(b<c&&c<a)){cout<<"Yes"<<endl;}
else{cout<<"No"<<endl;}
	return 0;
}

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
count = 0
count_b = []
count_w = []
b_num = 0
w_num = 0
w_all = S.count('.')
for i in range(N):
  if S[i] == '#':
    b_num += 1
  if S[i] == '.':
    w_num += 1
  count_w.append(w_all-w_num)
  count_b.append(b_num)
ans = 100000
for i in range(N):
  if ans > count_b[i]+count_w[i]:
    ans = count_b[i]+count_w[i]

print(ans)

Submission status: Runtime Error

Solution code:
import math
import sys
a,b,c = map(int(input().split()))
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:
import math
import sys
a,b,c = int(input().split())
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()

print(a,b,c)

Submission status: Runtime Error

Solution code:
a,b.c = map(int,input().split())
if a < c < b or a > c > b:
    print("OK")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
a,b.c = map(int,input().split())
if a < b:
  if c < b:
    print("OK")
  else:
    print("NO")
else:
  if c < a:
    print("OK")
  else:
    print("NO")

Submission status: Runtime Error

Solution code:
a,b.c =map(int,input().split())
if a<b:
  if c<b:
    print("OK")
  else:
    print("NO")
else:
  if c<a:
    print("OK")
  else:
    print("NO")

Submission status: Runtime Error

Solution code:
N = int(input())
S = [1 if i == "." else 0 for i in input()]
# 黒は#,白が.
# 黒は0,白は1
# 黒の右に白は許されない
# ある場所を境に左は全部白、右は全部黒にするから、それの逆の個数を数える
# ある境より右にある白の数
rw = sum(S)
# ある境より左にある黒の数
lb = 0
min_temp = rw+lb
for idx,s in enumerate(S):
    # 黒の場合
    if s==0:
        # rw pass
        lb *= 1
    # 白の場合
    elif s==1:
        rw += 1
        lb -= 1
    # 小さい方を残す
    min_temp = min([min_temp,rw+lb])
    if min_temp == 0:break
print(min_temp)

Submission status: Runtime Error

Solution code:
A,B,C = [int(x) for x in input().split()]

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

Submission status: Runtime Error

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

if (a < b):
  return True if a < c and c < b else False

if (a > b):
  return True if b < c and c < a else False

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b, c = (int(x) for x in input().split())
 
 
def on_the_way(a, b, c):
    if a < b < c or a > b > c:
        print('No')
    elif c < b < a or c > b > a:
    else:
        print('Yes')
 
on_the_way(a, b, c)

Submission status: Runtime Error

Solution code:
x = int(input().split())
if x[0]<x[2]<x[1]:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
A,B,C=(int(i) for i in input().split())
2.if B<=C<=A or A<=C<=B:
3.  print("Yes")
4.else:
5.  print("No")

Submission status: Runtime Error

Solution code:
A,B,C=(int(i) for i in input().split())
2.if A<=C and C<=B:
3.  print("Yes")
4.else:
5.  print("No")

Submission status: Runtime Error

Solution code:
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:
if and(A<C, C<B):
  print("Yes")
elif and(B<C, C<A):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
if and(A<C, C<B):
  print("Yes")
elif and(B<C, C<A):
  print("Yes")
else:
  print("No)

Submission status: Runtime Error

Solution code:
if a<b:
	if a<c and c<b:
		print("Yes")
	else:
		print("No")
elif b<a:
	if b<c and c<a:
		 print("Yes")
	else:
		 print("No")
else:
	 print("No")

Submission status: Runtime Error

Solution code:
>>> a,b,c=map(int,input().split())
 
>>> if a<b:
      if a<c and c<b:
          print("Yes")
      else:
          print("No")
    
	elif b<a:
		if b<c and c<a:
			print("Yes")
        else:
        	print("No")
	else:
		print("No")

Submission status: Runtime Error

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

>>> if a<b:
      if a<c and c<b:
          print("Yes")
      else
          print("No")
    
	elif b<a:
		if b<c and c<a:
			print("Yes")
        else
        	print("No")
	else:
		print("No")

Submission status: Runtime Error

Solution code:
>>> a,b,c=map(int,input().split())
>>> 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=map(int,input().split())
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=map(int,input().split())
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=map(int,input().split())
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:
n = int(input())
s = input()
s_list = list(s)
count1 = 0
count2 = 0

for i in range(n):
    if(s_list[i] == '#'):
        for j in range(0,n-i-1):
            #print(s_list[j+i])
            #print(j)
            if(s_list[j+i+1] == '.'):
                #print("count")
                count1 = count1 + 1
        break


for i in range(n):
    if(s_list[i] == '#'):
        count2 = count2 + 1


if(count1 < count2):
    print(count1)
else:
    print(count2)

Submission status: Runtime Error

Solution code:
a, b, c = (int(i) for i in input().split())
if (a < c && c < b) || (b < c && c < a):
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
  a,b,c = map(int, input().spilt())
  if(a>b):
    a,b = b,a
  if(c > a and c < b):
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

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

for i in range(N):
  if S[i] != S[K-1]:
    S[i] = "*"
S_changed = "".join(S)
print(S_changed)

Submission status: Runtime Error

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

for i in range(N):
	if S[i] != S[K-1]:
		S[i] = "*"
S_changed = "".join(S)
print(S_changed)

Submission status: Runtime Error

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

yoru = 1    ＃寄り道する
if a < c and b > c:
	yoru = 1
else:
	yoru = 0
if yoru == 1:
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:
a,b,c = map(int(), input().split())
print("Yes" if (a-c)*(b-c) < 0 else "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:
!/usr/bin/env python 
# -*- coding:utf-8 -*-
# from time import time
# t1=time()
rules, goal = map(int, input().split(" "))
inc = []
dec = []
for i in range(int(rules)):
    a, b = map(int, input().split(" "))
    if a < b:
        inc.append([a, b - a])
    elif a > b:
        dec.append([a, b - a])
inc.sort(key=lambda x: x[1], reverse=True)
dec.sort(key=lambda x: x[1])

history=[]

success = False
noPrint=False
breakNext=False
counter = 1
num = 1

while (num != goal):

    gap = []
    for i in inc:
        gap.append([i[0], goal - (i[1] + num)])
    for i in dec:
        gap.append([i[0], goal - (i[1] + num)])
    gap.sort(key=lambda x: abs(x[1]))
    for j in gap:

        if j in history:
            print(-1)
            noPrint = True
            breakNext=True
            break
        if (num >= j[0]):
            history.append(j)
            num = num + goal - num - j[1]
            counter = counter + 1
            success = True
            break
    if success != True:
        print(-1)
        noPrint=True
        break
    if breakNext==True:
        break

if(noPrint==False):
    print(counter)
# t2=time()
# print(t2-t1)

# 5 1000
# 12 3
# 1 2
# 4 9
# 23 90
# 24 12

Submission status: Runtime Error

Solution code:
a,b,c = (int(i) for i in input().split())
if (a-c)(b-c)<0: print("Yes")
else: print("No")

Submission status: Runtime Error

Solution code:
a, b, c = map(int,input().split())
if b>a and c>a: 
  if c>b:
    print("No")
  else:
    print("Yes")
 
elif a>b and c>b:
  if a>c:
    print("Yes")
  else c<a:
    print("No)
          
 else:
   print("No")

Submission status: Runtime Error

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

dot = S.count(".")
sha = 0
res = 10**9
for i in range(1,N):
    if i == "#":
        sha += 1
    else:
        dot -= 1
    tmp = sha + dot
    res = min(res, tmp)

print(res)

Submission status: Runtime Error

Solution code:
N=int(input())
S=str(input())
m=1000
for  i in range(N):
  a=S[:i].count("#")
  b=S[i:].count(".")
  c=a+b
  if m>=c:
    m=c
print(m)

Submission status: Runtime Error

Solution code:
n = int(input())
S = input()
b = 0
w = S.count('.')
res = w
for s in S:
	if s == '.':
		w -= 1
	else:
		b += 1
	res = min(res,b+w)
print(res)

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(input())
n=len(s)
if s[1]=='.'
  li=[]
  if s[0]=='.':
    a=0
    s.insert(0,"あ")
    for i in range (1,n+1):
      if s[i]==s[i-1]:
        a=a+1
      else:
        li.append(a)
        a=1
    li.append(a)
  else:
    a=1
    for i in range (0,n-1):
      if s[i+1]==s[i]:
        a=a+1
      else:
        li.append(a)
        a=1
    if s[n-2]==s[n-1]:
      a=a+1
      li.append(a)
    else:
      li.append(a)
  if s[0]=="あ":
    s.pop(0)
  if s[n-1]==".":
    li.append(0)
  len_li=len(li)
  import math
  t=math.floor(len_li/2)+1
  l=[]
  m=0
  for j in range (0,t-1):
    m=m+li[2*j+1]
  x=0
  y=0
  for k in range (0,t):
    l.append(m+y-x)
    y=y+li[2*k]
    if k!=t-1:
      x=x+li[2*k+1]
  l.sort()
  print(l[0])
else:
  print(1)

Submission status: Runtime Error

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 998244353

def power(x, y):
   if y == 0:
       return 1
   elif y == 1:
       return x % mod
   elif y % 2 == 0:
       return power(x, y/2) ** 2 % mod
   else:
       return power(x, (y-1)/2) ** 2 * x % mod

N = INT()
a = [INT() for _ in range(N)]

sum_a = sum(a)
dp = [[0]*(sum_a+1) for _ in range(N+1)]
dp[0][0] = 1

dp2 = [[0]*(sum_a+1) for _ in range(N+1)]
dp2[0][0] = 1

for i, x in enumerate(a):
	for j in range(sum_a+1):
		if j+x >= sum_a+1:
			continue
		dp[i+1][j] = (dp[i+1][j] + dp[i][j]*2)%mod # 赤以外に塗り分ける
		dp[i+1][j+x] = (dp[i+1][j+x] + dp[i][j])%mod # 赤に塗り分ける
		dp2[i+1][j] = (dp2[i+1][j] + dp2[i][j])%mod
		dp2[i+1][j+x] = (dp2[i+1][j+x] + dp2[i][j])%mod
# print(dp)
# print(dp2)
if sum_a%2 == 0:
	print((power(3, N)-3*sum([dp[N][i] for i in range(sum_a+1) if i >= sum_a//2])+3*dp2[N][sum_a//2])%mod)
else:
	print((power(3, N)-3*sum([dp[N][i] for i in range(sum_a+1) if i >= sum_a//2+1]))%mod)

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
ret = 1
n = readInt()
aa = []
for i in range(n):
    v = readInt()
    aa.append(v)
    total += v
    ret = (ret * 3) % 998244353

memo0 = [[-1] * 100000 for _ in range(300)]
def dfs0(i, c):
    if 0 <= memo0[i][c]:
        return memo0[i][c]

    if i == len(aa):
        memo0[i][c] = 3 if total <= (2 * c) else 0
        return memo0[i][c]

    acc = max(0, memo0[i][c])
    acc = (acc + dfs0(i + 1, c)) % 998244353
    acc = (acc + dfs0(i + 1, c)) % 998244353
    acc = (acc + dfs0(i + 1, c + aa[i])) % 998244353
    memo0[i][c] = acc
    return memo0[i][c]

memo1 = [[-1] * 100000 for _ in range(300)]
def dfs1(i, c):
    if 0 <= memo1[i][c]:
        return memo1[i][c]

    if i == len(aa):
        memo1[i][c] = 3 if total == (2 * c) else 0
        return memo1[i][c]

    acc = max(0, memo1[i][c])
    acc = (acc + dfs1(i + 1, c)) % 998244353
    acc = (acc + dfs1(i + 1, c + aa[i])) % 998244353
    return memo1[i][c]

ret = (ret - dfs0(0, 0)) % 998244353
ret = (ret + dfs1(0, 0)) % 998244353
print(ret)

Submission status: Runtime Error

Solution code:
n = int(input())
s = list(input())
lis = []
rtmp = 0
ltmp = 0
tmp = 0
l,r = 0,0

for i in range(n-1):
    if (s[i] != s[i+1]):
        #clis+= 1
        #print(i)
        rtmp = i+1
        ltmp = i
        for j in range(ltmp):
            if s[j] == '#':
                tmp += 1
        for j in range(rtmp,n):
            if s[j] == '.':
                tmp += 1
        lis.append(tmp)
        #print(lis)
    tmp = 0
    l,r = 0,0

if len(lis) == 0: 
    print(0)
else:
    print(min(lis))

Submission status: Runtime Error

Solution code:
from numpy import*
from itertools import*
n=int(input())
s=input()
t=s.count("#")
r=s.count(".")

l=[t,r]
x=[len(list(v))for k,v in groupby(s)if k=="#"]
y=[len(list(v))for k,v in groupby(s)if k=="."]
if len(x)>len(y):
    y=[0]+y
elif len(x)<len(y):
    x=[0]+x
else:
    y=y+[0]
    x=[0]+x

x=array([0]+list(accumulate(x)))
y=array(list(accumulate(y[::-1]))[::-1]+[0])
print(min(x+y))

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
start = s[0]
pattern = []

prev = ''
b = 0
w = 0
for i in s:
    if (i == '#' and prev == '#') or (i == '#' and prev ==''):
        b += 1
    elif (i == '.' and prev == '.') or (i == '.' and prev == ''):
        w += 1
    elif i == '#':
        b += 1
        pattern.append(w)
        w = 0
    else:
        w += 1
        pattern.append(b)
        b = 0
    prev = i
    
if prev == '#':
    pattern.append(b)
else:
    pattern.append(w)

totalb = 0
totalw = 0
for i in range(len(pattern)):
    if start == '.':
        if i % 2 == 0:
            totalw += pattern[i]
        else:
            totalb += pattern[i]
    else:
        if i % 2 == 0:
            totalb += pattern[i]
        else:
            totalw += pattern[i]
        
if len(pattern) == 1 or (len(pattern) == 2 and start == '.'):
    print(0)
elif (len(pattern) == 2 and start == '#'):
    print(min(totalw, totalb))
elif start == '.' and prev == "#":
    print(min(totalw - pattern[0], totalb - pattern[-1]))
elif start == '.':
    print(min(totalw - pattern[0], totalb))
else:
    print(min(totalw, totalb))

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
  int A, B, C;
  cin >> A >> B >> C;
  if(A < C && C < B)
    cout << "Yes" << endl;
  else if(A > C && C > B)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}

Submission status: Runtime Error

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

index = 0
counter = 0
while index < N:
    if S[index] == '#':
        offset = 1
        while index + offset < N and S[index + offset] == '#':
            offset += 1

        if index + offset >= N:
            break
        else:
            count = 1
            memory = offset
            offset += 1
            while index + offset < N and S[index + offset] == '.':
                count += 1
                offset += 1
            counter += count if count < memory else memory
            index += offset-1
    else:
        index += 1
print(str(counter))

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int A, B, C;
  cin >> A >> B >> C;
  if (A > C) {
    if (A > B && B > C) {
      cout << 'Yes';
    }
    else {
      cout << 'No';
    }
  }
  else {
    if (C > B && B > A) {
      cout << 'Yes';
    }
    else {
      cout << 'No';
    }
  }
}

Submission status: Runtime Error

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

shiro_num = s.count(".")
kuro_num = n - shiro_num

right_kuro_num = kuro_num
right_siro_num = shiro_num

result = shiro_num

for e in s:
    if e == '.':
        right_siro_num -= 1
    else:
        right_kuro_num -= 1
    num = right_siro_num + kuro_num - right_kuro_num
    result = min(num,result)

print(result)

Submission status: Runtime Error

Solution code:
def func(A, B, C):
	if A < C and C < B:
  		return 'Yes'
	elif B < C and C < A:
  		return 'Yes'
	else:
  		return 'No'


print(func(A, B, C))

Submission status: Runtime Error

Solution code:
def func(A, B, C):
	if A < C and C < B:
  		return 'Yes'
	elif B < C and C < A:
  		return 'Yes'
	else:
  		return 'No'


func(A, B, C)

Submission status: Runtime Error

Solution code:
if A < C and C < B:
  return Yes
elif B < C and C < A:
  return Yes
else:
  return No

Submission status: Runtime Error

Solution code:
/*
    Converted from Scratch by scratch2cpp (https://github.com/yos1up/scratch2cpp).
*/
#include <iostream>
#include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#define debug cerr << "--" << __LINE__ << "--" << "\n"
typedef long long ll;
using namespace std;

class Var{ // NOTE: immutable
public:
    mutable string sval;
    mutable long double dval;
    enum NumericState {UNKNOWN = -1, STRINGY = 0, NUMERIC = 1};
    mutable NumericState numericState;
    mutable bool svalValid, dvalValid; // TODO: initialize at here?

    Var(){
        *this = Var("");
    }
    Var(string s){
        sval = s;
        svalValid = true; dvalValid = false;
        numericState = UNKNOWN;
    }
    Var(long double d){
        dval = d;
        svalValid = false; dvalValid = true;
        numericState = NUMERIC;
    }
    Var(const Var &v){
        sval = string(v.sval); dval = v.dval;
        svalValid = v.svalValid; dvalValid = v.dvalValid;
        numericState = v.numericState;
    }
    void fillDval() const{
        if (dvalValid) return;
        double d;
        bool numeric = isNumericString(sval, &d);
        if (numeric){
            numericState = NUMERIC;
            dval = d;
        }else{
            numericState = STRINGY;
            dval = 0.0;
        }        
        dvalValid = true;
    }
    static bool isNumericString(const string &s, double *ptr) {
        char* ep;
        // cause side-effect: errno can be ERANGE after calling strtod
        *ptr = strtod(s.c_str(), &ep);
        // TODO: support long double (with strtold)
        // Scratch 3.0 recognize the string cause underflows or overflows as Numeric
        return NULL != ep && '\0' == ep[0] && s[0] != '\0';
    }
    bool isNumeric() const{
        fillDval();
        return numericState == NUMERIC;
    }    
    void fillSval() const{
        if (svalValid) return;
        sval = (floor(dval) == dval) ? to_string((ll)dval) : to_string(dval);
        svalValid = true;
    }       
    long double asNumber() const{
        fillDval();
        return dval;
    } 
    string asString() const{
        fillSval();
        return sval;
    }
    Var operator+(const Var &y) const{
        return Var(this->asNumber() + y.asNumber());
    }
    Var operator+=(const Var &y){
        *this = *this + y;
        return *this;
    }
    Var operator-(const Var &y) const{
        return Var(this->asNumber() - y.asNumber());
    }
    Var operator*(const Var &y) const{
        return Var(this->asNumber() * y.asNumber());
    }
    Var operator/(const Var &y) const{
        return Var(this->asNumber() / y.asNumber());
    }
    Var operator%(const Var &y) const{
        return Var(fmod(this->asNumber(), y.asNumber()));
    }
    bool operator<(const Var &y) const{
        if (this->isNumeric() && y.isNumeric()){
            return this->asNumber() < y.asNumber();
        } // compare as number if both can be interpreted as numeric
        return this->asString() < y.asString();
    }
    bool operator>(const Var &y) const{
        return y < *this;
    }
    bool operator==(const Var &y) const{
        if (this->isNumeric() && y.isNumeric()){
            return this->asNumber() == y.asNumber();
        } // compare as numeric if both are numeric
        return this->asString() == y.asString();
    }
    friend ostream& operator << (ostream& os, const Var& p);
    friend istream& operator >> (istream& is, const Var& p);
};
ostream& operator << (ostream& os, const Var& p){
    os << p.asString();
    return os;
}
istream& operator >> (istream& is, Var& p){
    string s; is >> s; p = Var(s);
    return is;
}


Var letterOf(Var index, Var sourceString){
    /* index: 1-origined */
    string str = sourceString.asString();
    int idx = (int)(index.asNumber() - 1);
    // seem to be dirty but Scratch seems to do like this.
    // ex. letterOf(0.01, "world") == "w", letterOf(1.99, "world") == "w", letterOf(5.99, "world") == "d"
    if (0 <= idx && idx < str.size()) return Var(str.substr(idx, 1));
    return Var();
}

class VarList{
public:
    vector<Var> data;
    VarList(const vector<Var> &x) { data = x; }
    void push_back(const Var &x){ data.push_back(x); }
    void pop_back(){ data.pop_back(); }
    void clear(){ data.clear(); }
    int size(){ return (int) data.size(); }
    Var getLineOfList(const Var &index) const{
        /* index: 1-origined */
        int idx = (int)index.asNumber() - 1;
        // (unlike 'letterOf', index==0.9 does not work.)
        if (0 <= idx && idx < data.size()) return data[idx];
        return Var();
    }
    void setLineOfListTo(const Var &index, const Var &v){
        /* index: 1-origined */
        int idx = (int)index.asNumber() - 1;
        if (0 <= idx && idx < data.size()) data[idx] = v;
    }
    void deleteLineOfList(const Var &index){
        /* index: 1-origined */
        string kwd = index.asString();
        if (kwd == "all"){
            data.clear();
        }else if (kwd == "last"){
            data.pop_back();
        }else{
            int idx = (int)index.asNumber() - 1;
            if (0 <= idx && idx < data.size()) data.erase(data.begin() + idx);
        }
    }
    void insertAtIndexOfList(const Var &item, const Var &index){
        /* index: 1-origined */
        int idx = (int)index.asNumber() - 1;
        if (0 <= idx && idx <= data.size()) data.insert(data.begin() + idx, item);   
    }
    void insertAtRandomOfList(const Var &item){
        int idx = rand() % (data.size() + 1);
        data.insert(data.begin() + idx, item);
    }
    string asString() const{
        /* concatenate elements of list with space */
        // TODO: concatenated without spaces only if all elements are single characters.
        // (Is it an official bug? (or feature?))
        string ret;
        for(int i=0;i<data.size();i++){
            if (i > 0) ret += ' ';
            ret += data[i].asString();
        }
        return ret;        
    }
    int itemNumOfList(const Var &item) const{
        auto itr = find(data.begin(), data.end(), item);
        if (itr == data.end()) return 0;
        return 1 + (int)(itr - data.begin());
        /* index: 1-origined */
    }
    friend ostream& operator << (ostream& os, const VarList& p);
};
ostream& operator << (ostream& os, const VarList& p){
    os << p.asString();
    return os;
}

long double randUniform(const long double x, const long double y){
    if (x > y) return randUniform(y, x);
    if (floor(x) == x && floor(y) == y){
        ll xi = (ll)round(x), yi = (ll)round(y);
        return xi + rand() % (yi - xi + 1);
    }else{
        return x + (y - x) * (0.0 + rand()) / RAND_MAX;
    }
}

Var buf_answer; // for "answer"

// ============================= Scripts =============================

// variable declaration
Var var_A(7);
Var var_B(3);
Var var_C(1);

// list declaration

// prototype declaration of functions
int main();

// contents of functions
int main(){
    cin >> buf_answer;
    var_A = buf_answer;
    cin >> buf_answer;
    var_B = buf_answer;
    cin >> buf_answer;
    var_C = buf_answer;
    if ((((var_A < var_C) && (var_C < var_B)) || ((var_B < var_C) && (var_C < var_A)))){
        cout << Var("Yes") << endl;
    } else {
        cout << Var("No") << endl;
    }
    return 0;
}

Submission status: Runtime Error

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

count_list =[]
wc = 0

A=[0]*(N)
bc = 0

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

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() + 'a'

count = min(s.count('#'), s.count('.'))

for i in range(n):
  if s[i] != s[i+1]:
  	count = min(count, s[:i+1].count('#') + s[i+1:].count('.'))
    
print(count)

Submission status: Runtime Error

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
s = stdin.readline().rstrip()
sum = 0
cnt = 0
for itr in range(N):
    if s[itr] == '#':
        cnt += 1
        continue
    if cnt > 0:
        sum += 1
        cnt = 0
print(sum)

Submission status: Runtime Error

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
s = stdin.readline().rstrip()
sum = 0
wh = s.count('.')
cnt = 0
for itr in range(N):
    if s[itr] == '#':
        cnt += 1
        continue
    if cnt > 0:
        sum += 1
        cnt -= 1
print(sum)