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:
if input()='SUN':
	print(7)
elif input()='MON':
  print(6)
elif input()='TUE':
  print(5)
elif input()='WED':
  print(4)
elif input()='THU':
  print(3)
elif input()='FRI':
  print(2)
elif input()='SAT':
  print(1)
end

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def main():
   n = input()
   data = list(input())
   for i in data:
      a = ord(i) + int(n)
      if a > ord("Z"):
         a = a + ord("A") - ord("Z")
      print(chr(a),end = "")

if __name__==  "__main__":
   main()

Submission status: Runtime Error

Solution code:
s = int(input())
f = input()
a = "ABCDEFGHIJKLNMOPQRSTUVWXYZ"
ans = ""
for i in f:
  ans += a[a.index(i)+s]

print(ans)

Submission status: Runtime Error

Solution code:
s = str(input('曜日を入力：'))
  
elif s == 'SAT':
  print('1')
  
elif s == 'FRI':
  print('2')
  
elif s == 'THU':
  print('3')
  
elif s == 'WED':
  print('4')

elif s == 'TUE':
  print('5')
  
elif s == 'MON':
  print('6')

else:
  print('7')

Submission status: Runtime Error

Solution code:
s= int(input())

print(s**2)

Submission status: Runtime Error

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

print(dic[s])

Submission status: Runtime Error

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

print(s[dic])

Submission status: Runtime Error

Solution code:
s = input()
list = ['SUN','MON','TUE','WED','THU','FRY','SAT']
index = 0
for i in list:
    if s == i:
        ans = 7 - index
    index += 1
print(ans)

Submission status: Runtime Error

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


def is_ok(N):
    return A * N + B * len(str(N)) <= X


ok = 0
ng = 10 ** 9 + 1
while ng - ok > 1:
    m = (ok + ng) // 2
    if is_ok(m):
        ok = m
    else:
        ng = m
print(ok)

Submission status: Runtime Error

Solution code:
S=input()

A=["SAT","FRI","THU","WED","TUE","MON","SUM"]

print(A.index(S)+1)

Submission status: Runtime Error

Solution code:
import sys, os
import collections

MOD = 10 ** 9 + 7

def solve(input_stream):
  pass

def read_ints(input_stream):
  return [i for i in map(int, input_stream.readline().strip().split())]

def read_int(input_stream):
  return int(input_stream.readline().strip())


if __name__ == "__main__":
    outputs = solve(sys.stdin)
    for line in outputs:
      print(line)

Submission status: Runtime Error

Solution code:
S = str(input())

if S == "SUN":
    cmd = 0
elif S == "MON":
    cmd = 1
elif S == "TUE":
    cmd = 2
elif S == "WED":
    cmd = 3
elif S == "THU":
    cmd = 4
elif S == "FRY":
    cmd = 5
elif S == "SAT":
    cmd = 6

print(7-cmd)

Submission status: Runtime Error

Solution code:
S = str(input())

if S == "SUN":
    cmd = 0
elif S == "MON":
    cmd = 1
elif S == "TUE":
    cmd = 2
elif S == "WED":
    cmd = 3
elif S == "THU":
    cmd = 4
elif S == "FRY":
    cmd = 5
elif S == "SAT":
    cmd = 6

if cmd == 0:
    print(7)
else:
    print(7-cmd)

Submission status: Runtime Error

Solution code:
S = str(input())

if S == "SUN":
    cmd = 0
elif S == "MON":
    cmd = 1
elif S == "TUE":
    cmd = 2
elif S == "WED":
    cmd = 3
elif S == "THU":
    cmd = 4
elif S == "FRY":
    cmd = 5
elif S == "SAT":
    cmd = 6

if cmd == 0:
    print(7)
else:
    print(cmd)

Submission status: Runtime Error

Solution code:
S = input()

if S == "SUN":
    cmd = 0
elif S == "MON":
    cmd = 1
elif S == "TUE":
    cmd = 2
elif S == "WED":
    cmd = 3
elif S == "THU":
    cmd = 4
elif S == "FRY":
    cmd = 5
elif S == "SAT":
    cmd = 6

if cmd == 0:
    print(7)
else:
    print(cmd)

Submission status: Runtime Error

Solution code:
S = input("")

if S == "SUN":
    cmd = 0
elif S == "MON":
    cmd = 1
elif S == "TUE":
    cmd = 2
elif S == "WED":
    cmd = 3
elif S == "THU":
    cmd = 4
elif S == "FRY":
    cmd = 5
elif S == "SAT":
    cmd = 6

if cmd == 0:
    print(7)
else:
    print(cmd)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input(S)
if s = "SUN":
    print("7")
elif s = "NON":
    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:
S=input()
S_dic={"sun":7,"MON":1,"TUE":2,"WED":3,"THU":4,"FRI":5,"SAT":6}
print(7-S_dic[S])

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(input())
out_str=''
for i in s:
  m=ord(i)+n
  if m>90:
    m-=26
  out_str+=chr(m)

print(out_str)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(1000000)

N = int(input())
G = [[] for i in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    a,b = a-1,b-1
    G[a].append([b, i])

ans = [None]*(N-1)
def rec(cur, color):
    cnt = 1
    for (to, j) in G[cur]:
        if cnt == color:
            cnt += 1
        ans[j] = cnt
        rec(to, cnt)
        cnt += 1

rec(0,0)
print(max(ans))
[print(a) for a in ans]

Submission status: Runtime Error

Solution code:
a,b,x=map(int,input().split())
def binary_search(start,end):
    if end-start<=1:return start
    else:
        i=(start+end)//2
        s = a * (i) + b * len(str(i))
        if s<=x:return binary_search(i,end)
        else:return binary_search(start,i)
print(binary_search(0,10**9+1))

Submission status: Runtime Error

Solution code:
day = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

in_day = input();

if in_day == day[x]:
  print(7 - x)

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
else s == 'SAT':
  return 1

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()

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

Submission status: Runtime Error

Solution code:
S = input()

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

Submission status: Runtime Error

Solution code:
S = input()

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

Submission status: Runtime Error

Solution code:
S = input()

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

Submission status: Runtime Error

Solution code:
S = input()

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

Submission status: Runtime Error

Solution code:
S=input()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def rem_of_sum(n, k, arr):
    count = 0
    for i in range(n):
        for j in range(i + 1, min(n + 1, i + k)):
            part = arr[i:j]
            if sum(part) % k == len(part):
                count += 1
    return count
 
 
n, k = map(int, input().split())
arr = list(map(int, input().split()))
print(rem_of_sum(n, k, arr))

Submission status: Runtime Error

Solution code:
s = input()
if s = "SUN":
  print(0)
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 = "SUT":
  print(1)

Submission status: Runtime Error

Solution code:
d = ["-","SAT","FRI","THU","WED","TUR","MON","SUN"]
input()
for n,s in enumerate(d):
    if s == S:
        print(n)

Submission status: Runtime Error

Solution code:
S = str(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()

dict = {
  'SUN': 0
  'MON': 1,
  'TUE': 2,
  'WED': 3,
  'THU': 4,
  'FRI': 5,
  'SAT': 6,
}

print(7 - dict[S])

Submission status: Runtime Error

Solution code:
n = int(input())
ki = [[]for j in range(n)]
for i in range(n-1):
	    a,b=map(int,input().split())
	    a-=1
	    b-=1
	    ki[a].append([b,i])
	    ki[b].append([a,i])


a=[0]*n
for i in range(n):
	    a[i]= len(ki[i])
print(max(a))
clist=[-1]*(n-1)
visited=[[0]for i in range(n)]
def dfs(now,last,ban_color=-1):
	    color =1
	    for next,id in ki[now]:
	    	    
                     
	    	    if next == last:continue
	    	    if color == ban_color:
	    	    	    color+=1
	    	    clist[id] = color
	    	    dfs(next,now,color)
	    	    
	    	    color+=1
	    	    
dfs(0,-1)
for i in range(n-1):
    print(clist[i])

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:
wd = {
  "SUN":7
  "MON":6
  "TUE":5
  "WED":4
  "THU":3
  "FRI":2
  "SAT":1
  }
line = input()
 
print(wd[line])

Submission status: Runtime Error

Solution code:
s = input()
if s == 'Sun':
  s = 0
elif s == 'MON':
  s = 1
elif s == 'TUE':
  s = 2
elif s == 'WED':
  s = 3
elif s =='THU':
  s = 4
elif s == 'FRI':
  s = 5
elif s == 'SAT':
  s = 6
print(int(s) - 0)

Submission status: Runtime Error

Solution code:
s = input()
if s == 'Sun':
  s = 0
elif s == 'MON':
  s = 1
elif s == 'TUE':
  s = 2
elif s == 'WED':
  s = 3
elif s =='THU':
  s = 4
elif s == 'FRI':
  s = 5
elif s == 'SAT':
  s = 6
print(s - 0)

Submission status: Runtime Error

Solution code:
def binary_search(A, B, X):
    intial_N = 0
    end_N = 10**20
    while (end_N - intial_N > 1):
        mid_N = round((intial_N + end_N) / 2)
        digits = len(str(mid_N))
        temp_value = A*mid_N + B*digits
        if (temp_value > X):
            end_N = mid_N
        elif (temp == X):
            return mid_N
        else:
            intial_N = mid_N 
    return intial_N
            
A, B, X = map(int, input().split())
int_N = binary_search(A, B, X)
print(int_N)

Submission status: Runtime Error

Solution code:
def m_d(n):
  return int(len(str(n)))
def m_N(A,B,n):
  return int((A * n) + (B * m_d(n)))
A,B,X = map(int,input().split())
l = 0
m = 10**9+1
while m-l>1:
  n=(l+m)//2
  if m_N(A,B,n)<=X:
    l=n
  else:
    m=n
print(l)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
days = ['SUN','MON','TUE','WED','THU','FRI','SAT']
S = input()
if days.get(S) == 0:
  print(7)
else:
  print(days.get(S))

Submission status: Runtime Error

Solution code:
days = {"SUN:0", "MON:1"," TUE:2", "WED:3", "THU:4","FRI:5","SAT:6"}
week = raw_input()
t = 7 - days[week] 
print(t)

Submission status: Runtime Error

Solution code:
# changed as follows: line 380
#移動判定
#        #if current_action!=-1 and not wait_status:
#        if current_action!=-1:
        
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()
roads=[]
for i in range(E):
    roads.append(MI())

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

#g=[[] for _ in range(V+1)]
g=[[[] for _ in range(V+1)] for d in range(5)]
c=[]
neighber=[set() for _ in range(V+1)]
d_map=[{} for _ in range(V+1)]

for u,v,d,e1,e2 in roads:
    g[0][u].append((v,d+(1+P//4 if e1==5 else 0)))
    g[0][v].append((u,d+(1+P//4 if e2==5 else 0)))
    for dd in range(1,5):
        g[dd][u].append((v,(10 if e1==dd else 1)*d+(1+P//4 if e1==5 else 0)))
        g[dd][v].append((u,(10 if e2==dd else 1)*d+(1+P//4 if e2==5 else 0)))
    
    c.append((u,v,d,e1,e2))
    neighber[u].add(v)
    neighber[v].add(u)
    d_map[u][v]=d
    d_map[v][u]=d


mins=[[[] for _ in range(V+1)] for d in range(5)]
prevs=[[[] for _ in range(V+1)] for d in range(5)]

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


#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():
    show(order_at_shop)
    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,jam_d=0):
    global item_at_car
    drop=[]
    n_item=0
    for nb,dist in g[jam_d][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[jam_d][cur][nb]*2+best_d)
            #if random.random()<drop_effc/effc:
            if drop_effc>=effc:
                drop=[(cur,mins[jam_d][nb][cur]),(nb,mins[jam_d][cur][nb])]
    return drop

def optimizer_drop(current,now,root,effc,best_p,best_d,f_info=True,jam_d=0):
    ##    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[jam_d][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[0][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[jam_d][cur][nb]+mins[jam_d][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[jam_d][cur][nb]))
                        drop.append((next_dest,mins[jam_d][nb][next_dest]))
                elif 0==1:
                    drop_time=mins[jam_d][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[jam_d][cur][nb]))
                        drop.append((cur,mins[jam_d][nb][cur]))
                        drop.append((next_dest,mins[jam_d][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 root_generator(cur,deliver_point,jam_d=0):# generate root
    root=[]
    p=deliver_point
    while p!=cur:
        prev_p=prevs[jam_d][cur][p]
        root.append((p,mins[jam_d][p][prev_p]))
        p=prev_p

    root.append((cur,0))
    no_jam_root=[]
    for i in range(len(root)-1):
        p,x=root[i]
        nx,x=root[i+1]
        no_jam_root.append((p,d_map[p][nx]))
    return no_jam_root

def best_deliver(cur,now,item_at_car,f_info=True,optimize_mode=True,sim_mode=False,jam_d=0):
    global order_at_shop
    #global item_at_car
    global num_item_at_car
    if sim_mode:
        item_at_car=[[i for i in order] for orders in sim_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[jam_d][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[jam_d][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[jam_d][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=root_generator(cur,deliver_point,jam_d=jam_d)
    
    # optimize
    if deliver_point==1:
        0
    else:
        if optimize_mode:
            root=optimizer_drop(cur,now,root,effc,best_p,best_d,f_info=False,jam_d=jam_d)
    # opt end
 
    return deliver_point,root,effc

def rand_move(cur,now,jam_d=0):
    n=len(g[0][cur])
    x=random.randint(0,n-1)
    dest,dist=g[0][cur][x]
    root=[(dest,dist)]
    return 0,root,0

# recieve info
def interactive(wait_num):
    global item_at_car
    stop_flag=False
    stat_init()
    state=0 # 0 on vertex, 1 on road
    final_dest=1
    dest=1
    cur=1
    point=0
    effc=0
    cur_jam=0
    wait_status=False
    current_action=-1
    root=[]
    dist=inf
    
    for t in range(T):
        car_status=input()
        jam_info=LI()
        if sum(jam_info)==0:
            cur_jam=0
        else:
            for i in range(4):
                if jam_info[i]==1:
                    cur_jam=i+1
        Ncan=I()
        for j in range(Ncan):
            can_id=I()
        
        Nnew=I()
        v=0
        for j in range(Nnew):
            new_id,v=MI()
            order_at_shop.append((v,t))# stock (vertex, order_time)
        Nput=I()
        for j in range(Nput):
            put_id=I()

        order[t]=v
        
        ##show('state',state,'cur',cur,'dest',dest,'dist',dist,'final_dest',final_dest,'root',root)

        if car_status=='BROKEN':
            current_action=move(-1)
            show('Stay due to broken at',cur)
        elif wait_status:
            current_action=move(-1)
            show('waiting at ',cur)
        else:
            if state==0: # at vertex
                if cur==1:
                    ship()
                else:
                    point+=deliver(cur,t)
                    
                if final_dest==cur:
                    deliver_point,root,effc=best_deliver(cur,t,item_at_car,optimize_mode=False,f_info=False,jam_d=cur_jam)
                    #deliver_point,root,effc=rand_move(cur,t,jam_d=cur_jam)
                    ##show('bd',root,item_at_car,order_at_shop)
                    if root:
                        final_dest=root[0][0]
                    else:
                        deliver_point,root,effc=rand_move(cur,t,jam_d=cur_jam)
                        final_dest=root[0][0]
                        ##show('random',root)

                dest,dist=root.pop() # not to do in waiting or jam
                state=1
                current_action=move(dest)

            else:
                current_action=move(dest)

        vardict = input()
        
        if vardict == 'NG':
            #import everything_
            exit()
        elif vardict=='JAM':
            show('Jam in going to',current_action)
            current_action=-1
            wait_status=False
        elif vardict[0]=='W': # WAIT
            wait_time=int(vardict[5:])
            wait_status=True
            #stop_flag=True # stop if wait status
        else:
            wait_status=False
        
        #移動判定
        #if current_action!=-1 and not wait_status:
        if current_action!=-1:
            dist-=1
            state=1
            
            if dist==0:
                cur=dest
                state=0
        
        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:
S= input()
days = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
for i in days:
    if S==days[0]:
        print(0)
    elif S==days[i]:
        print(7-i)

Submission status: Runtime Error

Solution code:
a, b, x = map(int, input().split())
l, r = 1, 10 ** 9
while True:
    if r - l < 10: break
    m = (l + r) // 2
    if (a * m + b * len(str(m))) < x:
        l = m
    else:
        r = m - 1
ans = 0
import math
for i in range(l, r + 1):
    if a * i + b * len(str(i)) < x:
        ans = i
print(ans)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**6)
N = int(input())
v = [[] for i in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    a,b = a-1,b-1
    v[a].append([b,i])

ans = [None] * (N-1)

def decide_colord(cur,color):
    cnt = 1
    for (to,j)in v[cur]:
        if cnt == color:
            cnt += 1
        ans[j] = cnt
        decide_colord(to,cnt)
        cnt += 1
decide_colord(0,0)
print(max(ans))
[print(a) for a in ans]

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:
# -*- coding: utf-8 -*-
# リストの準備
list = [SUN,MON,TUE,WED,THU,FRI,SAT]
# 文字列の入力
s = input()
# indexの検索
a = list.index(s)
# 7-indexで出力
print(7 - b)

Submission status: Runtime Error

Solution code:
#入力
day = input()


if day == "MON":
  answer = 6
  
if day == "TUE":
  answer = 5
if day == "WEN":
  answer = 4
if day == "TUR":
  answer = 3
if day == "FRY":
  answer = 2
if day == "SAT":
  answer = 1
if day == "SUN":
  answer = 7

print(answer)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

#値段の算出する関数
def nedan(N,A,B):
    Nmozi = str(N)
    lengs = len(Nmozi)
    ans = A * N  + B * lengs
    return ans


#Nの値を二分法で計算する。
MAX = 1000000000
MIN = 0

for i in range(500):
    CENTER = MIN + (MAX-MIN)//2
    if MAX - MIN < 0.5:
        break
#MAXとMINが同じになったら終了する。
    if nedan(CENTER,A,B) <= X:
        MIN = CENTER
    else:
        MAX = CENTER



if nedan(MAX,A,B) <= X:
    ANS = MAX
else:
    ANS = MIN

print(ANS)

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Here your code !
data = input()

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

Submission status: Runtime Error

Solution code:

N= input()
S= input()


N = int(N)
Len = len(S)#文字数の長さ
LIST = list(S)#文字列を1文字ごとに分割する。

ANSWER = ""
#リストの中身をループ
for SS in LIST:
    NUNBER = ord(SS)#アスキーコードを出す組み込み関数:1文字しか対応していない
    NUNBER = NUNBER -65#アスキーコードからアルファベット順に変更
    AFFTER = NUNBER + N
    LAST  = AFFTER % 26
    LAST  = chr(LAST+65)#アスキーコードからアルファベットに戻す
    ANSWER = ANSWER + LAST
    
print(ANSWER)

Submission status: Runtime Error

Solution code:
day = input()
d = {"SUN":0,"MON":1,"TUE":2,"WED":3,"THU":4,"FRI":5,"SUT":6}
print(7 - d[day])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=input()

if S=="SUN":
    x=7
elif S=="MON":
    x=6
elif S=="TUE":
    x=5
elif S=="WED":
    x=4
elif S=="THU":
    x=3
elif S=="FRI":
    x=2
elif S=="STU":
    x=1
    
print(x)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
w = ""
for x in S:
    if abc.index(x) + 1 + N > 26:
        w += abc[abc.index(x) + N - 26]
    else:
        w += abc[abc.index(x) + N]
print(w)

Submission status: Runtime Error

Solution code:
import math
a,b,x = map(int,input().split())
max = 1000000000
min = 1

y = x - b
if y < 0 or y / a < 1: 
    print(0)
else :
    if a * max + b * 10 <= x:
        print(max)
    else :
        while max - min > 1 :
            mid = math.floor((min + max) / 2)
            if a * mid + b * (1 + math.floor(math.log10(mid))) <= x :
                min = mid
            else :
                max = mid
        print('%1.0f' %min)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <algorithm>
using namespace std;

string s;
int ans;

int main(){
	cin>>s;

	if(s =="SUN"){
		ans = 7;
	}
	else if(s =="MON"){
		ans = 6;
	}
	else if(s =="TUE"){
		ans = 5;
	}
	else if(s =="WED"){
		ans = 4;
	}
	else if(s =="THU"){
		ans = 3;
	}
	else if(s =="FRI"){
		ans = 2;
	}
	else if(s =="SAT"){
		ans = 1;
	}
	cout<<ans;
}

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