Problem:


Score : 100 points

Problem Statement

Given is a string S representing the day of the week today.

S is SUN, MON, TUE, WED, THU, FRI, or SAT, for Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday, respectively.

After how many days is the next Sunday (tomorrow or later)?

Constraints

S is SUN, MON, TUE, WED, THU, FRI, or SAT.

Input

Input is given from Standard Input in the following format:

S

Output

Print the number of days before the next Sunday.

Sample Input 1

SAT

Sample Output 1

1

It is Saturday today, and tomorrow will be Sunday.

Sample Input 2

SUN

Sample Output 2

7

It is Sunday today, and seven days later, it will be Sunday again.



Sample input:
SAT


Sample output:
1

Submission status: Runtime Error

Solution code:
input_line = int(input())
for i in range(input_line):
  s = input().rstrip().split(' ')
  return 7 - ['SUN','MON','TUE','WED','THU','FRI','SAT'].index(s[0])

Submission status: Runtime Error

Solution code:
A,B,X = list(map(int,input().split()))

for i in reversed(range(len(str(A)))):
    num = int("1"+"0"*i)-1
    for N in reversed(range(num)):
        if X > A*N+B*i:
            print(A*N+B*i)

Submission status: Runtime Error

Solution code:
from collections import deque

N, AB = map(int, open(0).read().split())
B = AB[1::2]

E = [[] for _ in range(N + 1)]
for a, b in zip([iter(AB)] * 2):
    E[a].append(b)

Q = deque([1])
C = [0] * (N + 1)
while Q:
    v = Q.popleft()
    c = 0
    for u in E[v]:
        c += 1 + (c + 1 == C[v])
        C[u] = c
        Q.append(u)

print(max(C))
for b in B:
    print(C[b])

Submission status: Runtime Error

Solution code:
# v1

import time
st_time=time.time()

from heapq import heappush, heappop, heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
ts=time.time()
#sys.setrecursionlimit(10**6)
#input=sys.stdin.readline

show_flg=False
#show_flg=True

drop_probability=1

def dijkstra(edge,st):
    # initialize: def: d=dist(st,i), prev=[previous vertex in minimum path], q[]
    n=len(edge)
    d=[(0 if st==i else inf,i) for i in range(n)]
    prev=[0]*n
    q=[i for i in d]
    heapify(q)
    
    # calc
    while q:
        dist,cur=heappop(q)
        for dst,dist in edge[cur]:
            alt=d[cur][0]+dist
            if alt<d[dst][0]:
                d[dst]=(alt,dst)
                prev[dst]=cur
                heappush(q,(alt,dst))
    dist=[i for i,j in d]
    return dist,prev

V,E=MI()
g=[[] for _ in range(V+1)]
c=[]
neighber=[set() for _ in range(V+1)]
d_map=[{} for _ in range(V+1)]
for i in range(E):
    u,v,d,e1,e2=MI()
    g[u].append((v,d))
    g[v].append((u,d))
    c.append((u,v,d))
    neighber[u].add(v)
    neighber[v].add(u)
    d_map[u][v]=d
    d_map[v][u]=d

mins=[[] for _ in range(V+1)]
prevs=[[] for _ in range(V+1)]
for i in range(1,V+1):
    min_dist,prev=dijkstra(g,i)
    mins[i]=min_dist
    prevs[i]=prev

f=LI()
t=[LI() for i in range(4)]
P=I()
tw=I()
T=I()
order=[0]*T
accor=[0]*T
order_time=[]

#show('order',order)
order_at_shop=[] # stock (vertex, order_time)
item_at_car=[[] for _ in range(V+1)] # stock order time at each vertex
num_item_at_car=0

moves=[]
def move(v):
    global moves
    print(v)
    sys.stdout.flush()
    moves.append(v)
    return v

def ship():
    global num_item_at_car
    while order_at_shop:
        v,t=order_at_shop.pop()
        item_at_car[v].append(t)
        num_item_at_car+=1
##    show('item_at_car',item_at_car)

def deliver(v,deliver_t):
    global num_item_at_car
    d_p=0
    while item_at_car[v]:
        or_t=item_at_car[v].pop()
        num_item_at_car-=1
        d_p+=T**2-(deliver_t-or_t)**2
##    show("delivered to",v,"deliverPoint",d_p)
    return d_p

def stat_init():
    global order_at_shop
    global item_at_car
    global num_item_at_car
    order_at_shop=[] # stock (vertex, order_time)
    item_at_car=[[] for _ in range(V+1)] # stock order time at each vertex
    num_item_at_car=0

def root_valuator(current,now,root,f_info=True):
    if len(root)==0:
        return 0,0
    global item_at_car
    cur=current
    point=0
    rt=now
    for next_dest,dist in root[::-1]:
        if len(item_at_car[next_dest])>0:
            rt+=dist
            for j in item_at_car[next_dest]:
                point+=T**2-(rt-j)**2
        cur=next_dest
    return point,rt-now
    

def neighber_search(cur,next_dest,effc,best_p,best_d,f_info=True):
    global item_at_car
    drop=[]
    n_item=0
    for nb,dist in g[cur]:
        if nb==next_dest:continue
        if len(item_at_car[nb])>n_item:
            n_item=len(item_at_car[nb])
            drop_effc=(best_p+n_item*(T**2))/(mins[cur][nb]*2+best_d)
            #if random.random()<drop_effc/effc:
            if drop_effc>=effc:
                drop=[(cur,mins[nb][cur]),(nb,mins[cur][nb])]
    return drop

def optimizer_drop(current,now,root,effc,best_p,best_d,f_info=True):
##    show('!Optimizing',root)
    global item_at_car
    opt_root=[]
    cur=current
    org_now=now
    org_effc=effc
    n=len(root)
    
    for i in range(1,n+1):
        next_dest,dist=root[-i]
        drop=[]
        alt=0
        n_item=0
        for nb,d_nb in g[cur]:
            if nb==next_dest:continue
            if len(item_at_car[nb])>n_item:
                #n_item=len(item_at_car[nb])
                rt=now+d_nb
                for j in item_at_car[nb]:
                    alt+=T**2-(rt-j)**2
                if prevs[nb][next_dest]==nb: # nb connected to next_dest ( possible enhancement mins[prevs[nb][next_dest]][next_dest]==mins[nb][next_dest] )
                    drop_time=mins[cur][nb]+mins[nb][next_dest]-dist
                    drop_effc=(best_p+alt)/(drop_time+best_d)
                    if drop_effc>=effc:
                        effc=drop_effc
                        #effc=drop_effc
                        drop.append((nb,mins[cur][nb]))
                        drop.append((next_dest,mins[nb][next_dest]))
                elif 0==1:
                    drop_time=mins[cur][nb]*2
                    drop_effc=(best_p+alt)/(drop_time+best_d)
                    if drop_effc>=effc:
                        effc=drop_effc
                        #effc=drop_effc
                        drop.append((nb,mins[cur][nb]))
                        drop.append((cur,mins[nb][cur]))
                        drop.append((next_dest,mins[cur][next_dest]))
        
        if drop:
            opt_root+=drop
            now+=drop_time
##            show('#yorimichi',drop)
        else:
            opt_root.append((next_dest,dist))
            now+=dist
        cur=next_dest
    
    # opt_root validation
    opt_valid=True
    cur=current
    for next_dest,dist in opt_root:
        if next_dest in neighber[cur]:
            if d_map[cur][next_dest]!=dist:
                opt_valid=False
            else:
                0 # validation ok
        else:
            opt_valid=False
        
        cur=next_dest
    
    if opt_valid:
        p,t=root_valuator(current,org_now,opt_root,f_info=False)
        opt_effc=p/t if t!=0 else 0
        if org_effc<=opt_effc:
            rt=opt_root[::-1]
        else:
            rt=root
    else:
##        show('!!optimization failed')
        rt=root
    
    return rt


def best_deliver(cur,now,f_info=True):
    global order_at_shop
    global item_at_car
    global num_item_at_car
    effc=0
    best_p,best_d=0,inf
    deliver_point=1
    # direct go
    for dest in range(2,V+1):
        if dest==cur:continue
        d=mins[cur][dest]
        rt=now+d
        alt=0
        for j in item_at_car[dest]:
            alt+=T**2-(rt-j)**2
        if alt/d>effc:
            effc,best_p,best_d=alt/d,alt,d
            deliver_point=dest
    # turn to shop and go
    if cur!=1:
        db=mins[cur][1]
        nx_item_at_car=[[] for i in range(1+V)]
        for order_v,t in order_at_shop:
            nx_item_at_car[order_v].append(t)
        for i in range(2,1+V):
            for t in item_at_car[i]:
                nx_item_at_car[i].append(t)
        if f_info:
            for t in range(min(now+1,T-1),min(now+db+1,T)):
                v=order[t]
                if v!=0:
                    nx_item_at_car[v].append(t)
        for dest in range(2,V+1):
            if cur==1:break
            if dest==cur:continue
            dg=mins[1][dest]
            rt=now+db+dg
            d=db+dg
            alt=0
            for j in nx_item_at_car[dest]:
                alt+=T**2-(rt-j)**2
            if alt/d>effc:
                effc,best_p,best_d=alt/d,alt,d
                deliver_point=1
            
    # generate root
    root=[]
    p=deliver_point
    while p!=cur:
        prev_p=prevs[cur][p]
        root.append((p,mins[p][prev_p]))
        p=prev_p
    
    # optimize
    if deliver_point==1:
        0
    else:
        root=optimizer_drop(cur,now,root,effc,best_p,best_d,f_info=False)
    # opt end

    return deliver_point,root,effc

# recieve info
def interactive(wait_num):
    stat_init()
    state=0 # 0 on vertex, 1 on road
    final_dest=1
    dest=1
    cur=1
    point=0
    effc=0
    wait_status=False
    current_action=-1
    
    for t in range(T):
        car_status=input()
        j=LI()
        Ncan=I()
        for j in range(Ncan):
            can_id=I()
        
        Nnew=I()
        v=0
        for j in range(Nnew):
            new_id,v=MI()
        Nput=I()
        for j in range(Nput):
            put_id=I()

        order[t]=v
        
        if car_status=='BROKEN':
            current_action=move(-1)
        elif wait_status:
            current_action=move(-1)
        else:
            current_action=move(-1)

        vardict = input()
        
        if vardict == 'NG':
            #import everything_
            exit()
        elif vardict=='JAM':
            current_action=-1
            wait_status=False
        elif vardict[0]=='W': # WAIT
            wait_time=int(vardict[5:])
            wait_status=True
        else:
            wait_status=False

        Nachive = int(input())
        for j in range(Nachive):
            achive_id=I()

    return point


mode='rand'
mode='greed'
if mode=='rand':
    time_limit=29.5 # 1 = 1 sec
elif mode=='greed':
    point=interactive(wait_num=0)

Submission status: Runtime Error

Solution code:
a=["SUN","MON","TUE","WED","THU","FRI","SAT"]
s=input()
print(7-a.index(str))

Submission status: Runtime Error

Solution code:
weekday = [SUN,MON,TUE,WED,THU,FRI,SAT]
s = input()

if(s == "SUN"):
    print("7")
if(s == "MON"):
    print("6")
if(s == "TUE"):
    print("5")
if(s == "WED"):
    print("4")
if(s == "THU"):
    print("3")
if(s == "FRI"):
    print("2")
if(s == "SAT"):
    print("1")

Submission status: Runtime Error

Solution code:
 weeks = {'MON': '1', 'TUE': '2',
          'WED': '3', 'THU': '4',
          'FRI': '5', 'SAT': '6',
          'SUN': '0'
         }
  s = input()
  print(7-int(weeks.get(s)))

Submission status: Runtime Error

Solution code:
weeks = {'MON': '1', 'TUE': '2',
    ...: 'WED': '3', 'THU': '4',
    ...: 'FRI': '5', 'SAT': '6',
    ...: 'SUN': '0'^M
    ...: }
    ...: S = input('')
    ...: print(7-int(weeks.get(S)))

Submission status: Runtime Error

Solution code:
 weeks = {'MON': '1', 'TUE': '2',
    ...:  'WED': '3', 'THU': '4',
    ...:  'FRI': '5', 'SAT': '6',
    ...:  'SUN': '0'
    ...:  }
    ...: S = input('today:')
    ...: print(7-int(weeks.get(S)))

Submission status: Runtime Error

Solution code:
s = input()
if s = 'SUN':
	print('7')
elif s = 'MON':
	print('6')
elif s = 'TUE':
	print('5')
elif s = 'WED':
	print('4')
elif s = 'TUE':
	print('3')
elif s = 'FRI':
	print('2')
elif s = 'SAT':
	print('1')

Submission status: Runtime Error

Solution code:
s=input()

if s='SUN':
    ans='7'
elif s='MON':
    ans='6'
elif s='TUE':
    ans='5'
elif s='WED':
    ans='4'
elif s='THU':
    ans='3'
elif s='FRI':
    ans='2'
elif s='SAT':
    ans='1'

print(ans)

Submission status: Runtime Error

Solution code:
a, b, x = map(int, input().split())
if a * 1e9 + b * 10 <= x:
    print(int(1e9))
elif a * 1 + b * 1 > x:
    print(0)
else:
    atari = x // a
    price = atari * a + b * len(str(atari))
    if atari > 100:
        while price > x:
            atari -= 100
            atari = max(0, atari)
            price = atari * a + b * len(str(atari))
        atari_bottom = atari
        while price < x:
            atari_bottom += 1
            price = atari_bottom * a + b * len(str(atari_bottom))
        print(atari_bottom-1)
    else:
        while price > x:
            atari -= 1
            price = atari * a + b * len(str(atari))
        print(atari)

Submission status: Runtime Error

Solution code:
a, b, x = map(int, input().split())
if a * 1e9 + b * 10 <= x:
    print(int(1e9))
elif a * 1 + b * 1 > x:
    print(0)
else:
    atari = x // a
    price = atari * a + b * len(str(atari))
    while price > x:
        atari -= 100
        atari = max(0, atari)
        price = atari * a + b * len(str(atari))
    atari_bottom = atari
    while price < x:
        atari_bottom += 1
        price = atari_bottom * a + b * len(str(atari_bottom))
    print(atari_bottom-1)

Submission status: Runtime Error

Solution code:
week_cicle = ["SUN, "MON", "TUE", "WED", "THU", "FRI", "SAT"]
day_of_week = input()
first = week_cicle.index(day_of_week)
print(7 - first)

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
s=list(s)
for i in range(len(s)):
    a=ord(s[i])+n
    if a>90:
        a-=26
    s[i]=chr(a)
print(''.join(s))

Submission status: Runtime Error

Solution code:
s=input()
a={
'SUN':0
'MON':1
'TUE':2
'WED':3
'THU':4
'FRI':5
'SAT':6
}
print(7-a[s])

Submission status: Runtime Error

Solution code:
S = {'MON':6, 'TUE':5, 'WED':4, 'THU':3, 'FRI':2, 'STA':1, 'SUN':7}

s = input()
print(S[s])

Submission status: Runtime Error

Solution code:
S = {'MON':6, 'TUE':5, 'WED':4, 'THU':3, 'FRI':2, 'STA':1, 'SUN':7}

s = (input())
print(S[s])

Submission status: Runtime Error

Solution code:
S = {'MON':6, 'TUE':5, 'WED':4, 'THU':3, 'FRI':2, 'STA':1, 'SUN':7}

s = str(input())
print = S[s]

Submission status: Runtime Error

Solution code:
S = input()
if S == "SUN":
  return 7
elif S == "MON":
  return 6
elif S == "TUE":
  return 5
elif S == "WED":
  return 4
elif S == "THU":
  return 3
elif S == "FRI":
  return 2
elif S == "SAT":
  return 1

Submission status: Runtime Error

Solution code:
S = {'MON':6, 'TUE':5, 'WED':4, 'THU':3, 'FRI':2, 'STA':1, 'SUN':7}

s = input()
print = S[s]

Submission status: Runtime Error

Solution code:
a = (input())
if a == "SUN":
    print(7)
elif a == "MON":
    print(6)
elif a == "TUE":
    print(5)
elif a == "WED":
    print(4)
elif a == "THU":
    print(3)
elif a == "FRI":
    print(2)
elif a == "SAT":
     print(1)

Submission status: Runtime Error

Solution code:
while True:
    try:
        a = (input())
    except EOFError:
        break
    if a == "SUN":
        print(7)
    elif a == "MON":
        print(6)
    elif a == "TUE":
        print(5)
    elif a == "WED":
        print(4)
    elif a == "THU":
        print(3)
    elif a == "FRI":
        print(2)
    elif a == "SAT":
        print(1)

Submission status: Runtime Error

Solution code:
l = [SUN, MON, TUE, WED, THU, FRI, SAT]
day = input()
for i in range(len(l)):
  if day = l[i]:
    print(7-i)

Submission status: Runtime Error

Solution code:
day = input()

if day == 'SUN :
    print(7)
elif day == 'MON' :
    print(6)
elif day == 'TUE' :
    print(5)
elif day == 'WED' :
    print(4)
elif day == 'THU' :
    print(3)
elif day == 'FRI' :
    print(2)
elif day == 'SAT' :
    print(1)

Submission status: Runtime Error

Solution code:
from enum import Enum
  
  class Day(Enum):
    SAT = 1
    FRI = 2
    THU = 3
    WED = 4
    TUE = 5
    MON = 6
    SUN = 7


def next_sunday(day):
    today = Day[day]
    return today.value
    
print(next_sunday(input))

Submission status: Runtime Error

Solution code:
from enum import Enum
  
  class Day(Enum):
    SAT = 1
    FRI = 2
    THU = 3
    WED = 4
    TUE = 5
    MON = 6
    SUN = 7


def next_sunday(day):
    today = Day[day]
    return today.value
    

def main():
	in = input()
    print(next_sunday(in))
      
      
main()

Submission status: Runtime Error

Solution code:
a = input()
b = 0
if a == "SAT"
    b = 1
if a == "SUN"
    b = 7
if a == "MON"
    b = 6
if a == "TUE"
    b = 5
if a == "WED"
    b = 4
if a == "THU"
    b = 3
if a == "FRI"
    b = 2
print(b)

Submission status: Runtime Error

Solution code:
a = input()
b = ""
if a == "SAT"
    b = 1
if a == "SUN"
    b = 7
if a == "MON"
    b = 6
if a == "TUE"
    b = 5
if a == "WED"
    b = 4
if a == "THU"
    b = 3
if a == "FRI"
    b = 2
return b

Submission status: Runtime Error

Solution code:
usrInput = input()

if usrInput == "SUN":
    DayPlace = 0
elif usrInput == "MON":
    DayPlace = 1
elif usrInput == "TUE":
    DayPlcae = 2
elif usrInput == "WED":
    DayPlace = 3
elif usrInput == "THU":
    DayPlace = 4
elif usrInput == "FRI":
    DayPlace = 5
elif usrInput == "SAT":
    DayPlace = 6

finalOutput = 7 - DayPlace
print(finalOutput)

Submission status: Runtime Error

Solution code:
from collections import deque
n = int(input())
list = []
for i in range(n-1): #因数注意！
    M = input()    
    m = M.split()
    p = [int(i) for i in m] #1列の数列をリスト化
    p = p + [i]
    list.append(p) #list(行列)
color = [0 for i in range(n-1)] #各辺の色
maxcolor = 1
N = deque([[1,0]]) #頂点と使用されている色
delete = deque() #listから探索済みの辺を削除する
while len(list) != 0:
    a = N.popleft()
    b = 0
    for i, value in enumerate(list):
        if value[0] == a[0]:
            b = b + 1
            if b == a[1]:
                b = b + 1
            N.append([value[1],b])
            color[value[2]] = b
            delete.append(i)
            if maxcolor < b:
                maxcolor = b
        elif value[1] == a[0]:
            b = b + 1
            if b == a[1]:
                b = b + 1
            N.append([value[0],b])
            color[value[2]] = b
            delete.append(i)
            if maxcolor < b:
                maxcolor = b
    else:
        c = 0
        while len(delete) != 0:
            c = c + 1
            d = delete.popleft()
            del list[d-c+1]
print(maxcolor)
for i in color:
    print(i)

Submission status: Runtime Error

Solution code:
s = input()
v = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
i = 7
for w in v:
  if s != v[i]:
    i -= 1
  else:
    print(i)
    break

Submission status: Runtime Error

Solution code:
 dic = {"SUN":7,"MON":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}
print(dic[str(input())])

Submission status: Runtime Error

Solution code:
A, B, X = map(int,input().split())

little = 0
large = 10**9

while large-little > 1:
    n = (little + large) // 2
    if A*n + B*len(str(n)) > X:
        large = n
    else:
        little = n

print(little)

Submission status: Runtime Error

Solution code:
s = input()
r = ['SUN','MON','TUE','WED','THU','FRI','SAT']

for i in len(r):
  if s == r[i]:
    print(7-i)

Submission status: Runtime Error

Solution code:
import chainer

Submission status: Runtime Error

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

list_S = list(S)

for i in range(len(list_S)):
    list_S[i] = chr( ord(list_S[i]) + N )

    if ord(list_S[i]) > ord('Z'):
        list_S[i] = chr( ord('A') + ( ord(list_S[i])- ord('Z') ) -1 )

print("".join(list_S))

Submission status: Runtime Error

Solution code:
S = input()
WEEK = {'SUN':7,'MON':6,'TUE':5,'WEN':4,'THU':3,'FRI':2,'SAT':1}
print(WEEK[S])

Submission status: Runtime Error

Solution code:

n = int(input())
vs = [[] for i in range(n)]
out = [0]*n


for i in range(n-1):
    a, b = [i+0,i+1]
    vs[a].append([b,i+1])
    vs[b].append([a,i+1])

nex = [[0,-1]]

def coloring(index,defColor):
    i=0
    for v in vs[index]:
        if i==defColor:
           i+=1
        out[v[1]]=i
        vs[v[0]].remove([index,v[1]])
        nex.append([v[0],i])
        i+=1
    out[0] = max(out[0],i-1)

while nex.__len__()>0:
    c,d = nex.pop()
    coloring(c,d)

for i in range(n):
    print(out[i]+1)

Submission status: Runtime Error

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

for i in s:
    print(chr((ord(i)-65+n)%26+65),end="")

Submission status: Runtime Error

Solution code:
s = input()
week = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
for i in len(s):
    if s == week[i]:
        print(7 - i)
        break

Submission status: Runtime Error

Solution code:
import math
A, B, X = map(int, input().split())
L = []
for ln_N in range(17):
    N = math.floor((X - B * ln_N) / A)
    if N <= 0:
        L.append(0)
    else:
        if math.floor(math.log10(N)+1) == ln_N:
            L.append(N)
print(min(1000000000,max(L)))

Submission status: Runtime Error

Solution code:
s = int(input())
if s =="SUN":
  print(7)
elif s =="MON":
  print(6)
elif s=="TUE":
  print(5)
elif s =="WED":
  print(4)
elif s=="THU":
  print(3)
elif s=="FRI":
  print(2)
else:print(1)

Submission status: Runtime Error

Solution code:
S = input()

if S == SUN:
    print('7')

if S == MON:
    print('6')
    
if S == TUE:
    print('5')
    
if S == WED:
    print('4')
    
if S == THU:
    print('3')
    
if S == FRI:
    print('2')
    
if S == SAT:
    print('1')

Submission status: Runtime Error

Solution code:
s={'SAT':1,'FRI':2,'THU':3,'WED':4,'TUE':5,'MON':6,'SUN':7}
print({}.format(s[input()]))

Submission status: Runtime Error

Solution code:
s = input()
week = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
i = 0
for num,day in enumerate(weeK):
  if s == day:
    i = 7 - num
print(i)

Submission status: Runtime Error

Solution code:
week_list = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
rweek_list = reversed(week_list)

print(rweek_list.index(input()) + 1)

Submission status: Runtime Error

Solution code:
def bin_search(l, r, x):
	if x > 1e9:
		return 1e9
	mid = (l+r)//2
	if r-l == 1:
		if a*r+ b*len(str(r)) <= x:
			return int(r)
		elif a*l+ b*len(str(l)) <= x:
			return int(l)
		else:
			return 0
	elif a*mid+b*len(str(mid)) > x:
		return bin_search(l, mid-1, x)
	else:
		return bin_search(mid+1, r, x)


a, b, x = map(int, input().split())
if a+b > x:
	print(0)
else:
	print(bin_search(1, 1e9, x))

Submission status: Runtime Error

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

signed main(void){
    string S;
    cin >> S;
    vector<string> day = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
    cout << 7 - (find(day.begin(), day.end(), S) - day.begin()) << endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
 ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
s = input()
for num, i in enumerate(w):
  if i == s:
    print(num+1)

Submission status: Runtime Error

Solution code:
 ['SAT', 'FRY', 'TUE', 'WED', 'THU', 'MON', 'SAN']
s = input()
for num, i in enumerate(w):
  if i == s:
    print(num+1)

Submission status: Runtime Error

Solution code:
day = input()
if day == "SUN":
  return 7
elif day == "MON":
  return 1
elif day == "TUE":
  return 2
elif day == "WED":
  return 3
elif day == "THU":
  return 4
elif day == "FRI":
  return 5
elif day == "SAT":
  return 6
else:
  return -1

Submission status: Runtime Error

Solution code:
print 2

Submission status: Runtime Error

Solution code:
day = ["SUN","MON","TUE","WED","THU","FRY","SAT"]
num = [7,6,5,4,3,2,1]
dic = {x:y for x,y in zip(day,num)}
s = input()
print(dic[s])

Submission status: Runtime Error

Solution code:
import sys
def nextHoliday(day):
    days={'SUN':7,'MON':6,'TUE':5,'WED':4,'THU':3,'FRI':2,'SAT':1}
    return days[day.upper()]
  
day = sys.stdin.readline()
output=nextHoliday(day)
print(output)

Submission status: Runtime Error

Solution code:
a,b,x = map(int,input().split())
syo = -1
dai = 10**9+1
ans = 0
while abs(dai-syo)!=1:
    n = (dai+syo)//2
    en = a*n+b*len(str(int(n)))
    if en > x:
        dai = n
    else:
        ans = syo = n
print(ans)

Submission status: Runtime Error

Solution code:
s_list=['SUN','MON','TUE','WED','THU','FRI','SAT']
s=input()
ans=""
for i in range(len(s_list)):
  if s==slist[i]:
    if i+1==len(s_list):
      ans=s_list[0]
    else:
      ans=s_list[i+1]
print(ans)

Submission status: Runtime Error

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

a = [chr(i) for i in range(65, 65+26)]
b = [chr(i) for i in range(65+N, 65+26)]
for i in range(N):
    b.append(a[i])

a_dict = {}
for i in range(len(a)) :
    a_dict[a[i]] = b[i]
for i in range(len(S)) :
    S[i] = a_dict[S[i]]

print(''.join(S))

Submission status: Runtime Error

Solution code:
L = ['SAT','FRI','THU','WED','TUE','MON','SUN']

for i,l in enumerate(L):
  if S == l:
    print(i+1)
    break

Submission status: Runtime Error

Solution code:
import math as ma
inputs = input().split(" ")
A = int(inputs[0])
B = int(inputs[1])
X = int(inputs[2])

# １桁
max_num = 0
for x in range(1, 19):
    k = ma.floor((X - x*B) / A)
    # print(x, k)
    if len(list(str(k))) == x:
        max_num = k
        break
    elif len(list(str(k))) < x:
        break
    elif len(list(str(k))) > x:
        pass
if max_num > 1000000000:
    max_num = 1000000000
print(max_num)

Submission status: Runtime Error

Solution code:
from itertools import accumulate
from math import factorial as fc

def cmb_2(n):
    return n*(n-1)//2

N,K = map(int, input().split(' '))
A = list(map(int, input().split(' ')))
A = [i-1 for i in A]

sumA = list(accumulate(A))
sumA = [0]+[i % K for i in sumA]
x = sumA[:K]
modmap = [0]*K
for i in x:
    modmap[i] += 1

ans = 0
for i in range(K):
    ans += cmb_2(modmap[i],2)

for i in range(N-K+1):
    modmap[sumA[K+i]] += 1
    modmap[sumA[i]] -= 1
    ans += modmap[sumA[K+i]]-1

print(ans)

Submission status: Runtime Error

Solution code:
import math
A,B,X = map(int,input().strip().split())
res = 0
high = 1000000000
low = 0
while( True ):
    mid = (high + low)//2
    #print(high,mid,low)
    res = A * mid + B * len(str(mid))
    # print(i,res,i-prei)
    if res > X:
        high = mid - 1
    else:
        ans = mid
        low = mid + 1
    #print(high,low)
    if low >= high:
        break
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
s = ""
for m in input():
    s += chr((ord(m)+n-ord("A"))%26+ord("A"))
print(s)

Submission status: Runtime Error

Solution code:
week = ['SUN','MON','TUE','WED','THU','FRI','SAT']
x = input()
week.index(x)
print(7-x)

Submission status: Runtime Error

Solution code:
A,B,X=map(int,input().split())
a=[]
for i in range(1,11):
  rest=X-B*i
  if rest>0 and len(str(int(rest/A)))==i:
      a.append(rest//A)
a.sort()
if a==[]:
    print(0)
else:
    print(a[len(a)-1])

Submission status: Runtime Error

Solution code:
A,B,X=map(int,input().split())
a=[]
for i in range(1,10):
  rest=X-B*i
  if rest>0 and len(str(int(rest/A)))==i:
      a.append(rest//A)
a.sort()
if a==[]:
    print(0)
else:
    print(a[len(a)-1])

Submission status: Runtime Error

Solution code:
d=input()
if(d=="SAT"):
  print(1)
elif(d=="FRI")
  print(2)
elif(d=="THU")
  print(3)
elif(d=="WED")
  print(4)
elif(d=="TUE")
  print(5)
elif(d=="MON")
  print(6)
else:
  print(7)

Submission status: Runtime Error

Solution code:
d=str(input())
if(d="SAT"):
   print(1)
elif(d="FRI"):
  print(2)
elif(d="THU"):
  print(3)
elif(d="WED"):
  print(4)
elif(d="TUE"):
  print(5)
elif(d="MON"):
  print(6)
else:
  print(7)

Submission status: Runtime Error

Solution code:
d=input()
if(d="SAT"):
   print(1)
elif(d="FRI"):
  print(2)
elif(d="THU"):
  print(3)
elif(d="WED"):
  print(4)
elif(d="TUE"):
  print(5)
elif(d="MON"):
  print(6)
else:
  print(7)

Submission status: Runtime Error

Solution code:
s = input()
if s == 'SUN':
    return 7
if s == 'MON':
    return 1
if s == 'TUE':
    return 2
if s == 'WED':
    return 3
if s == 'THU':
    return 4
if s == 'FRI':
    return 5
if s == 'SAT':
    return 6

Submission status: Runtime Error

Solution code:
S = str(input())
D = ["SUN","MUN","TUE","WED","THU","FRI","SAT"] 
print(7-D.index(S))

Submission status: Runtime Error

Solution code:
s = input()

if s == "SUN":
  return 7
if s == "MON":
  return 6
if s == "TUE":
  return 5
if s == "WED":
  return 4
if s == "THU":
  return 3
if s == "FRI":
  return 2
if s == "SAT":
  return 1

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!

S = input()
if S == "MON":
    print(6)
elif S == "TUE":
    print(5)
elif S == "WED":
    print(4)
elif S == "THU":
    print(3)
elif S == "FRI":
    print(2)
elif S == "SAT":
    print(1)
else:
    print(7)

Submission status: Runtime Error

Solution code:
S=input()
if S="SUN":
  print(7)
elif S="MON":
  print(6)
elif S="TUE":
  print(5)
elif S="WED":
  print(4)
elif S="THU":
  print(3)
elif S="FRI":
  print(2)
elif S="SAT":
  print(1)

Submission status: Runtime Error

Solution code:
A, B, X = map(int,input().split())

min_num = 0
max_num = 10 ** 9
#２分探索
# まず、最大値の10**9が購入できるか判定
if A * max_num + B * 9 <= X:
    print(max_num)
    exit()

while(1):
    ave_num = (min_num + max_num)//2 # get a center number
    price = A * ave_num + B * len(str(ave_num)) # price = f(ave_num)
    #print(ave_num,"_",min_num, "_", max_num)
    if min_num + 1 == max_num:
        print(min_num)
        break
    elif min_num == max_num:
        print(min_num)
        break

    elif X >= price:         # bottom down 
        min_num = ave_num
    else:                   # top up
        max_num = ave_num

Submission status: Runtime Error

Solution code:
# -*- coding utf-8 -*-
hash = {'SUN':7, 'MON':6, 'TUE':5, 'WED':4, 'THU':3, 'FRI':2,'STA':1}
s = input()
print(hash[s])

Submission status: Runtime Error

Solution code:
def next_sunday():
	today = input()
	days = dict("MON":1,"TUE":2,"WED":3,"THU":4,"FRI":5,"SAT":6,"SUN":7)
	try:
      ans = days[today]
    
    except KeyError:
      print("This days does not exist!")
    
    return ans

Submission status: Runtime Error

Solution code:
s = input() 
day = ['SUN','MON','TUE','WED','THU','FRI','SAT'][::-1]
dic = {d:i+1 in i,d zip(range(len(day),day))}
print(dic[s])

Submission status: Runtime Error

Solution code:
week = {'SUN':7,'MON':6,'TUE':5,'WED':4,'THU':3,'FRI':2,'SAT':1}
a=Input()
print(week[a])

Submission status: Runtime Error

Solution code:
s = input()
mapping = {'SUN':, 'MON':1, 'TUE':2, 'WED':3, 'THU':4
           , 'FRI':5, 'SAT':6}
if s == 'SUN':
  print(7)
else:
  print(7-mapping[s])

Submission status: Runtime Error

Solution code:
s = input()
lst = ['SUN','MON','TUE','WED','THU','FRI','SAT']

for i in range(len(lst)):
  if lst[i] = s:
    print(7 - i)

Submission status: Runtime Error

Solution code:
def D(x):
    return str(x).__len__()

def price(x):
    return D(x)*b + a*x

d = 1

if price(1)>x:
    print(0)
else:
    while True:
        if price(d*10) <= x:
            d*=10
            if(d==1000000000):
                print(d)
                break
            continue
        else:
            print(max(d + (x-price(d))//a,d*10-1))
            break

Submission status: Runtime Error

Solution code:
yobi = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
yobi = yobi.reverse()
s = input()
for i in range(7):
  if s == yobi[i]:
    print(i+1)

Submission status: Runtime Error

Solution code:
yobi = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
yobi = yobi.reverse
s = input()
for i in range(7):
  if s == yobi[i]:
    print(i+1)

Submission status: Runtime Error

Solution code:
yobi = [MON,TUE,WED,THU,FRI,SAT,SUN]
s = input()
for i in range(7):
  if s == yobi[i]:
    print(i+1)