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:
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 = 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:
if S == "SUN":
  print("0")
  
elif S == "MON":
  print("1")
elif S == "TUE":
  print("2")
elif S == "WED":
  print("3")
elif S == "THE":
  print("4")
elif S == "FRI":
  print("5")
elif S == "SAT"
  print("6")

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
S = len(s)
l = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
m = "ABCDEFGHIJKLMNOQPRSTUVWXYZ"
old_word = 0
new_word = 0
ans = []
#print(S)
#print(l[n])
#print(m[n])

for i in range(S):
    old_word = l.index(s[i])
    #print(old_word)
    new_word = old_word + n
    print(new_word)
    if new_word > 25:
        new_word = new_word - 26
    ans.append(l[new_word])


#print(l.index("B"))
print(ans)

Submission status: Runtime Error

Solution code:
from sys import stdin
A,B,X=list(map(int,(stdin.readline().strip().split())))

left=0
right=10**(9)+1

while(right-left>1):
    num = left + (right - left) // 2
    cost=A*num+B*(len(str(num)))
    if cost<=X:
        left=num
    else:
        right=num
print(left)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
l = [None, 'SAT', 'FRY', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(l.index(s))

Submission status: Runtime Error

Solution code:
s = str(input())

days = ['SUN','MON','TUE','WED','THU','FRI','SAT']

k=1
while k<=7:
  if s==days[k]:
    print(k)
  else:
    k+=1

Submission status: Runtime Error

Solution code:
s = str(input())

days = [SUN,MON,TUE,WED,THU,FRI,SAT]

k=1
while k<=7:
  if s==days[k]:
    print(k)
  else:
    k+=1

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)
else:
    print(1)

Submission status: Runtime Error

Solution code:
S = input()

days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for d in len(days):
  if S == days[d]:
    break

print(6 - d)

Submission status: Runtime Error

Solution code:
S = input()

days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for d in len(days):
  if S == d:
    break

print(6 - d)

Submission status: Runtime Error

Solution code:
a,b,x = map(int,input().split())
mi = 0
ma = 10**9+1
while ma-mi>1:
  me = int((mi+ma)/2)
  if a*me+b*len(str(me))<=x:
    mi = me
  else:
    ma = me
print(mi)

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())
x=min(10**9,int((X-B)/A)+1)
for  i in range(x):
  d=len(str(x-i))
  if A*(x-i)+B*d<=X:
    ans=x-i
    break
  if i==x-1:
    ans=0
print(ans)

Submission status: Runtime Error

Solution code:
A,B,X=map(int,input().split())
X=min(10**9,((X-B)//A)+1)
for  i in range(X):
  d=len(str(X-i))
  if A*(X-i)+B*d<=X:
    ans=X-i
    break
  if i==X-1:
    ans=0
print(ans)

Submission status: Runtime Error

Solution code:
A,B,X=map(int,input().split())
X=min(10**9,(X-B)//A+1)
for  i in range(X):
  d=len(str(X-i))
  if A*(X-i)+B*d<=X:
    ans=X-i
    break
  if i==X-1:
    ans=0
print(ans)

Submission status: Runtime Error

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

#Binary Search
high = 10**9 + 1
low  = 0
n = 0
while high - low > 0:
    mid = (high + low)//2
    if a * mid + b * len(str(mid)) <= x:
        low = mid
    else:
        high = mid

print(low)

Submission status: Runtime Error

Solution code:
S=input()

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

Submission status: Runtime Error

Solution code:
S=input()

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

Submission status: Runtime Error

Solution code:
S=input()

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

Submission status: Runtime Error

Solution code:
S=input()

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

Submission status: Runtime Error

Solution code:
s = input()
x = [ '0', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN' ]
for i in range x:
     if s == x[i]:
          print(i)

Submission status: Runtime Error

Solution code:
S=str(input())
L=['SUN','MON','TUE','WED','THU','FRI','SAT']
s=L.index(L)

print(7-s)

Submission status: Runtime Error

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

import math
def digit(n):
  return math.floor(math.log(n,10))+1
  
n_max = 10**9
n_min = 0

while((n_max-n_min)>1):
  key = (n_max+n_min)//2
  if a*key + b*digit(key) < x:
    n_min = key
  elif a*key + b*digit(key) > x:
    n_max = key

if n_max*a + b*digit(n_max) < x:
  print(n_max)
else:
  print(n_min)

Submission status: Runtime Error

Solution code:
s = input()

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

if s == 'SUN':
  print(7)
else:
  print(dic['SUN']-dic[s])

Submission status: Runtime Error

Solution code:

s = input()
d = {"SUN":0,"MO":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}

print(d[s])

Submission status: Runtime Error

Solution code:
s=str(input())
l=['SUN','MON','TUE','WED','THU','FRI','SAT']
print(7-i)

Submission status: Runtime Error

Solution code:
s = str(input())
l = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN']
 
if s == "SUN":
  print(7)
else:
  for i in range(7):
    if s == l[i]
       print(i)

Submission status: Runtime Error

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

if s == "SUN":
  print(7)
else:
  for i in range(7):
    if s == l[i]
       print(i)

Submission status: Runtime Error

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

def calc(c):
    return A * c + B * (10 ** len(str(c)))
min_n = 0
max_n = 10 ** 18 + 10

while max_n - min_n > 1:
    mid = (min_n + max_n)//2
    if calc(mid) <= X:
        min_n = mid
    else:
        max_n = mid
return mid

print(mid)

Submission status: Runtime Error

Solution code:
s = input()

if s == "SUM":
  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 == "SUM":
  print(0)
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:
a,b,x=map(int,input().split())
h=1
if a+b<=x<10*a+2*b:
    h=1
if 10*a+b*2<=x<100*a+3*b:
    h=2
if 100*a+b*3<=x<1000*a+4*b:
    h=3
if 1000*a+b*4<=x<10000*a+5*b:
    h=4
if 10000*a+b*5<=x<100000*a+6*b:
    h=5
if 100000*a+b*6<=x<1000000*a+7*b:
    h=6
if 1000000*a+b*7<=x<10000000*a+8*b:
    h=7
if 10000000*a+b*8<=x<100000000*a+9*b:
    h=8
if 100000000*a+b*9<=x<1000000000*a+10*b:
    h=9
if x>=1000000000*a+10*b:
    print(1000000000)
elif x<a+b:
    print(0)
else:
    d=0
    for i in range(10**(h-1),10**h):
        if i*a+b*h>x:
            print(d)
            break
        else:
            d=i
    else:
        print(d)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

import numpy as np
import scipy as sp
from collections import Counter, deque

INF = float('inf')
weekly = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']


def main():
    S = input().rstrip()
    index = weekly.index(S)
    print(-(index - len(weekly)))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

import sys
# import math
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import product                # product(iter, repeat=n)
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from fractions import gcd                    # for Python3.4.3


def main():
    mod = 10000007                  # 10^9+7
    inf = float('inf')
    input = sys.stdin.readline      # 改行文字が残ることに注意
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def ii():  return int(input())
    def mi():  return map(int, input().rstrip().split())
    def lmi(): return list(map(int, input().rstrip().split()))
    def li():  return list(input().rstrip())
    
    
    def bfs_tree_traverse(start):
        paths = deque([[start]])
        max_branch = 0
        while paths:
            # print(paths)
            current_path = paths.popleft()
            u = current_path[-1]
            previous = current_path[-2] if len(current_path)>=2 else -1
            previous_color = color[current_path[-2]][u] if len(current_path)>=2 else 0
            count = 0    # 現在の頂点 u から伸びるリンクの数を数える
            current_color = 0
            for v in adj[u]:
                count += 1    # 親へのリンクも含めて数えている
                if v != previous:
                    # tmp = current_path[:]
                    tmp = current_path[-1:]    # 定数倍高速化への道のり
                    tmp.append(v)
                    paths.append(tmp)
                    current_color += 1
                    if current_color == previous_color:
                        current_color += 1
                    color[u][v] = current_color
                    # color[v][u] = current_color    # 定数倍高速化への道のり
            max_branch = max(max_branch, count)
        return max_branch

    n = ii()
    adj = [[] for _ in range(n)]
    L = [list(map(lambda x: int(x)-1, input().rstrip().split())) for _ in range(n-1)]
    for pair in L:
        a, b = pair
        adj[a].append(b)
        adj[b].append(a)
    color = [[None] * n for _ in range(n)]
    
    print(bfs_tree_traverse(0))
    for pair in L:
        a, b = pair
        print(color[a][b])

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
from sys import stdin

S = stdin.readline().rstrip()
days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for i in range(len(days)):
    if S == days[i]:
        t = i
        break
    else:
        i += 1

print(days[t + 1])

Submission status: Runtime Error

Solution code:
S = input()
days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for i in range(6):
    if S == days[i]:
        t = i
        break
    else:
        i =+ 1

print(days[t + 1])

Submission status: Runtime Error

Solution code:
S = input()
days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for i in days:
    if S == days[i]:
        t = i
        break
    else:
        i =+ 1

print(days[t + 1])

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)
else:
	print(1)

Submission status: Runtime Error

Solution code:
a= ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]
s=raw_input()
idNum=a.index(s)
if idNum == 6:
  print 7
else:
  print 6- idNum

Submission status: Runtime Error

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

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)
elif S = "SUN":
    print(7)

Submission status: Runtime Error

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

a = int(a)
b = int(b)
x = int(x)


def func(n, a=a, b=b):
    return a*n+b*len(str(int(n)))


r, l = 1, 10**9

if func(1) > x:
    print(0)
    exit()

while l - r >= 1:
    t = (r + l) / 2
    if func(t) > x:
        l = t
    else:
        r = t

if func(int(l)) <= x:
    print(int(l))
else:
    print(int(r))

Submission status: Runtime Error

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

a = int(a)
b = int(b)
x = int(x)


def func(n, a=a, b=b):
    return a*n+b*len(str(int(n)))


r, l = 1, 10**9

if func(1) > x:
    print(0)
    exit()

while l - r >= 1:
    t = (r + l) / 2
    if func(t) > x:
        l = t
    else:
        r = t

if func(int(l)) <= x:
    print(int(l))
else:
    print(int(r))

Submission status: Runtime Error

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

a = int(a)
b = int(b)
x = int(x)


def func(n, a=a, b=b):
    return a * n + b * len(str(int(n)))


r, l = 1, 10**9

if func(1) > x:
    print(0)
    exit()

while l - r >= 1:
    t = (r + l) / 2
    if func(t) > x:
        l = t
    else:
        r = t

if func(int(l)) <= x:
    print(int(l))
else:
    print(int(r))

Submission status: Runtime Error

Solution code:
s = input()
week = "SUN", "MON", "TUE", "WED", "TUE", "FRI", "SAT"

s = week.index(s)
print(7-s)

Submission status: Runtime Error

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

ok = 0
ng = 10**9 + 1

def isok(arg):
    return a*arg+b*len(str(arg))

while abs(ng - ok) > 1 :
    mid = (ok+ng)//2
    if isok(mid) <= x:
        ok = mid
    else:
        ng = mid

print(mid)

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)
elif S==SUN:
  print(7)

Submission status: Runtime Error

Solution code:
S=input()
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)
elif S==SUN:
  print(7)

Submission status: Runtime Error

Solution code:
daw = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
S = input()
ind = daw.index(S)
print(7 - idx)

Submission status: Runtime Error

Solution code:
daw = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
S = input()
ind = daw.find(S)
print(7 - idx)

Submission status: Runtime Error

Solution code:
daw = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
S = input()
ind = S.find(daw)
print(7 - idx)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)

using namespace std;



int main(){
    string s;
    cin >>s;
    int ans,i;
    string date[7]={"SUN","MON","TUE","WED","THU","FRI","SAT"};
    REP(i,7){
        if(date[i]==s){
            ans=7-i;
            break;
        }
    }
    
    cout<< ans << endl;
    
    
    return 0;
}

Submission status: Runtime Error

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

print(answer)

Submission status: Runtime Error

Solution code:
def iip():
    return [int(i) for i in input().split()]

A, B, X = iip()

keta = min(10, int(X / B))

max_ = int(10**9)

if X < (A+B):
    print(0)
    exit()


while True:
    if keta * B + 10 ** (keta-1) * A > X:
        keta -= 1
        if keta == 0:
            print(0)
            exit()
    else:
        break

#print(keta)

amari = X - B * keta
#print(amari)
num = int(amari / A)
if num * A + keta * B > X:
    num -= 1

if num >= 10**(keta):
    num = 10**(keta) - 1

if num > 10**9:
    num = 10**9

print(num)

Submission status: Runtime Error

Solution code:
def iip():
    return [int(i) for i in input().split()]

A, B, X = iip()

keta = min(10, int(X / B))

max_ = 10**9

if X > (A*max_ + B*10):
    print(10**9)
    exit()

if X < (A+B):
    print(0)
    exit()

while True:
    if keta * B + 10 ** (keta-1) * A > X:
        keta -= 1
        if keta == 0:
            print(0)
            exit()
    else:
        break


amari = X - B * keta
num = int(amari / A)
#if num > 10**(keta-1):
#    num = 10**keta - 1
print(num)

Submission status: Runtime Error

Solution code:
S = input()
Weeks = ["MON","TUE","WED","THU","FRI","SAT","SUN"]
ind = Weeks.index(S)
if S != "SUN"
    print(6-ind)
else:
    print(7)

Submission status: Runtime Error

Solution code:
n = int(input())
# s = input()
c = []
hen = [[] for _ in range(n)]
for i in range(n-1):
    a,b = map(int,input().split())
    hen[a-1].append(b-1); hen[b-1].append(a-1)
    c.append([a-1,b-1])

k = 0
for i in range(n):
    k = max(k,len(hen[i]))
print(k)

child = [[] for _ in range(n)]
for [a,b] in c:
    color = 1
    while (color in child[a]) or (color in child[b]):
        color += 1

    child[a].append(color)
    child[b].append(color)
    print(color)

Submission status: Runtime Error

Solution code:
A, B, X = map(int, input().split())
lb = -1
ub = X

while ub - lb > 1:
    mid = (lb + ub) // 2
    if A*mid + B*len(str(mid)) > X:
        ub = mid
    else:
        lb = mid
print(min(10**9,lb))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
s = S.split()
 
a = int(s[0])
b = int(s[1])
x = int(s[2])
 
digits = 1
 
while (a*(10**digits)) + (b*digits) <= x:
    digits += 1
    if digits == 9:
        print(10**9)
        exit()
 
ans = 10 ** (digits - 1)
 
while (a*ans) + (b*digits) <= x:
    ans += 1
 
print(ans - 1)

Submission status: Runtime Error

Solution code:
S = input()
s = S.split()
 
a = int(s[0])
b = int(s[1])
x = int(s[2])
 
digits = 1
 
while (a*(10**digits)) + (b*digits) < x:
    digits += 1
    if digits == 9:
        print(10**9)
        exit()
 
ans = 10 ** (digits - 1)
 
while (a*ans) + (b*digits) <= x:
    ans += 1
 
print(ans - 1)

Submission status: Runtime Error

Solution code:
#a,b = map(int,input().split())
s = input()
S =['SUN','MON','TUE','WEB','THU','FRI','SAT']
print(7-S.index(s))

Submission status: Runtime Error

Solution code:
#a,b = map(int,input().split())
s = str(input())
S =['SUN','MON','TUE','WEB','THU','FRI','SAT']
print(7-S.index(s))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
Mat = [[] for _ in range(N)]
for i in range(N-1):
    a,b = list(map(int, input().split(' ')))
    a,b = a-1,b-1
    Mat[a].append([i,b])
    Mat[b].append([i,a])

colL = [1 for i in range(N-1)]
colorSave = []

M = 0
for i in range(N):
    if M < len(Mat[i]):
        M = len(Mat[i])
print(M)
def bfs(now,bef,nowC,befC,first):
    colL = [1 for i in range(N-1)]
    if first == 0:
        colL[nowC] = 0
    for nex in Mat[now]:
        if nex[1] != bef:
            nexC = colL.index(1)
            colL[nexC] = 0
            colorSave.append([nex[0],nexC])
            bfs(nex[1],now,nexC,nowC,0) 
    return

bfs(0,-1,0,-1,1)
new = sorted(colorSave,key=lambda x:x[0])
for n in new:
    print(n[1]+1)

Submission status: Runtime Error

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

for ss in s:
    i = ord(ss)
    i += n
    if i > 90:
        i -= 26
    ss = chr(i)
    print(ss,end="")

Submission status: Runtime Error

Solution code:
def resolve():
    import math
    a,b,x = map(int, input().split())
    if 10**((x//b)-1) < 10:
        pmax = min (x//a, 10**((x//b)-1))
    else:
        pmax = x//a
    if pmax ==0:
        print(0)
        exit()
    elif pmax > 10**9:
        pmax = 10**9

    for i in range(10**9):
        n1 = pmax-i
        logn1 = int(math.log(n1,10))+1
        if a*n1+b*logn1 <= x:
            print(n1)
            exit()
resolve()

Submission status: Runtime Error

Solution code:
a,b,x=map(int,input().split())
l=0
r=10**9+1

while r-l >1:
    mid=(r+l)//2
    if x < a*(mid) + b+len(str(mid)):
        max=mid
    else:
        min=mid

print(min)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
week={'SUN'=0
      'MON'=1
      'TUE'=2
      'WED'=3
      'THU'=4
      'FRI'=5
      'SAT'=6

print(7-week)

Submission status: Runtime Error

Solution code:
S = input()
day_list = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

day_num = day_list.index(S)

print(day_list[day_num+1])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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



if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
A,B,X=map(int,input().split());N=0
while A*10**N+B*N<X:
    N+=1
print(min((X-B*N)//A,10**9))

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
a = ''
for i in range(0,len(s)):
   cc = 65+ (ord(s[i]) + n - 65)%26
   a += chr(cc)

print(a)

Submission status: Runtime Error

Solution code:
S=input()
if S=="MON" :
	print(1)
else if S=="TUE" :
	print(2)
else if S=="WED" :
	print(3)
else if S=="THU" :
	print(4)
else if S=="FRI" :
	print(5)
else if S=="STA" :
	print(6)
else if S=="SUN" :
	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())

def cal(n):
    return a*n + b*len(str(n))

l = 0
r = 10**9+1

while r-l > 1:
    n = (l+r) // 2
    if cal(n) >= x:
        r = n
    else:
        l = n

print(n)

Submission status: Runtime Error

Solution code:
Week=["SAT","FRI","THU","WED","TUE","MON","SUN"]
 Day=input()
 print(Week.index(Day)+1)

Submission status: Runtime Error

Solution code:
Week=["SAT","FRI","THU","WED","TUE","MON","SAN"]
Day=input()
print(Week.index(Day)+1)

Submission status: Runtime Error

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

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 s == "SUT":
  print(1)

Submission status: Runtime Error

Solution code:
s = str(input())

if s = "SUM":
  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 s = "SUT":
  print(1)

Submission status: Runtime Error

Solution code:
S=input()
list=["SUN","MON","TUE","WED","THU","FRI","SUT"]
print(7-list.index(S))

Submission status: Runtime Error

Solution code:
S=input()
list=["SUN","MON","TUE","WED","THU","FRI","SUT"]
print(list[S])

Submission status: Runtime Error

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

i = 0

while True:
    #何桁円か確定させる
    price = a * (10**i) + b * (i+1)
    if price > x:
        break
    else:
        i += 1

x -= b * i
n = x//a

print(min(n,10**9))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

l = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for i in range(1,8):
    if s == l[i-1]:
        print(8-i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

int main(){
    string s;
    cin >>s;
    int ans ;
    if (s == "SUN")
    {
        ans = 7 ;
    }else if (s =="MON")
    {
        /* code */
        ans = 6 ;
    }else if (s == "TUE")
    {
        /* code */
        ans = 5 ;
    }else if (s == "WED")
    {
        /* code */
        ans = 4;
    }else if (s == "THU")
    {
        /* code */
        ans = 3 ;
    }else if (s == "FRI")
    {
        /* code */
        ans = 2 ;
    }else if (s == "SAT")
    {
        /* code */
        ans = 1; 
    }
    
    cout << ans << endl ;
    
    
    
    
        
}

Submission status: Runtime Error

Solution code:
def nibutan(A,B,X,L,H):
	M=(H+L)//2
	tmp=A*M+B*len(str(M))
	if M == 0:
		return 0
	elif tmp==X:
		return M
	elif tmp<X:
		if M==999999999:
			return M
		else:
			return nibutan(A,B,X,M,H)
	elif tmp>X:
		tmp_2=A*(M-1)+B*len(str(M-1))
		if tmp_2<X:
			return M-1
		else:
			return nibutan(A,B,X,L,M)

A,B,X=map(int,input().split())
if X>=A*1000000000+B*10:
	print(1000000000)
else:
	ans=nibutan(A,B,X,0,1000000000)
	print(ans)

Submission status: Runtime Error

Solution code:
def nibutan(A,B,X,L,H):
	M=(H+L)//2
	tmp=A*M+B*len(str(M))
	if M == 0:
		return 0
	elif tmp==X:
		return M
	elif tmp<X:
		if M=999999999:
			return 999999999
		else:
			return nibutan(A,B,X,M,H)
	elif tmp>X:
		tmp_2=A*(M-1)+B*len(str(M-1))
		if tmp_2<X:
			return M-1
		else:
			return nibutan(A,B,X,L,M)

A,B,X=map(int,input().split())
if X>=A*1000000000+B*10:
	print(1000000000)
else:
	ans=nibutan(A,B,X,0,1000000000)
	print(ans)

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")
else:
  print("1")

Submission status: Runtime Error

Solution code:
days=["SUN","MON","TUE","WED","THR","FRI","SAT"]
print(7-days.index(input()))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,x = map(int,input().split())
maxv2 = a*(10**9)+b*10
minv2 = a*1+b
maxv1 = 10**9
minv1 =0

if  maxv2 <= x:
    print(10**9)
    
elif minv2 > x:
    print(0)
    

while True:
    #print(minv1,maxv,avg)
    avg =(maxv1+minv1)//2
    maxv = a*avg + b*len(str(avg))
           
    if maxv > x:
        if (a*(avg-1) + b*len(str(avg-1))) <x:
            print(avg-1)
            break
        else:
            maxv1 = avg
                         
    elif maxv < x:
        if (a*(avg+1) + b*len(str(avg+1))) >x:
            print(avg)
            break
        else:
            minv1 = avg

Submission status: Runtime Error

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

low = 0
high = 10 ** 10

for i in range(10 ** 9):

    if high - low == 1:
        if A * high + B * len(str(high)) <= X:
            print(high)
            break
        else:
            print(low)
            break

    if (high - low) % 2 == 0:
        N = (high - low) // 2 + low
        tmp = A * N + B * len(str(N))

        if tmp < X:
            low = N
        elif tmp > X:
            high = N
        elif tmp == X:
            print(N)
            break

    else:
        N = (high - low) / 2 + low
        floor = int(N)
        ceil = floor + 1

        tmp_floor = A * floor + B * len(str(floor))
        tmp_ceil = A * ceil + B * len(str(ceil))

        if tmp_floor < tmp_ceil < X:
            low = ceil
        elif X < tmp_floor < tmp_ceil:
            high = floor
        elif tmp_floor < X < tmp_ceil:
            low = floor
            high = ceil
        elif X == tmp_floor:
            print(N)
            break
        elif X == tmp_ceil:
            print(N)
            break