Problem:


Score: 100 points

Problem Statement

The weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...

Given is a string S representing the weather in the town today. Predict the weather tomorrow.

Constraints

S is Sunny, Cloudy, or Rainy.

Input

Input is given from Standard Input in the following format:

S

Output

Print a string representing the expected weather tomorrow, in the same format in which input is given.

Sample Input 1

Sunny

Sample Output 1

Cloudy

In Takahashi's town, a sunny day is followed by a cloudy day.

Sample Input 2

Rainy

Sample Output 2

Sunny



Sample input:
Sunny


Sample output:
Cloudy

Submission status: Runtime Error

Solution code:
S = input()
if S == 'Sunny':
  print 'Cloudy'
else if S == 'Cloudy':
  print 'Rainy'
else:
  print 'Sunny'

Submission status: Runtime Error

Solution code:
input = S
if(input = 'Sunny'):
  print('Rainy')
else if(input = 'Cloudy'):
  print('Sunny')
else:
  print('Cloudy')

Submission status: Runtime Error

Solution code:
input = S
if(input = 'Sunny'):
  print('Cloudy')
else if(input = 'Cloudy'):
  print('Rainy')
else:
  print('Sunny')

Submission status: Runtime Error

Solution code:
input = S
if(input = 'Sunny'):
  print('Cloudy')
else if(input = 'Cloudy'):
  print('Rainy')
else:
  print('Sunny')

Submission status: Runtime Error

Solution code:
input = S
if(input = 'Sunny')
  print('Cloudy')
else if(input = 'Cloudy')
  print('Rainy')
else
  print('Sunny')

Submission status: Runtime Error

Solution code:
S = input("Today's whether")
if S == "Sunny":
  result = Cloudy
elif S == "Rainy":
  result = Sunny
elif S =="Cloudy:
  result = Rainy
print(result)

Submission status: Runtime Error

Solution code:
N, M= input().split(" ")
N = int(N)
M = int(M)

A_sub = input().split(" ")
A = [int(n0) for n0 in A_sub]

A.sort(reverse=True)
# print(A)

if N >1:
    for xi in range(M):
        for yi in range(N-1):
            if A[yi]>A[yi+1]:
                A[yi]= A[yi]//2
                break

    sum = 0
    for yi in range(N):
        sum = sum + A[yi]
    print(sum)
else:
    for yi in range(M):
        A[0]= A[0]//2
    print(A[0])

Submission status: Runtime Error

Solution code:
import heapq

N,M = map(int,input().split())
value = list(map(int,input().split()))
value = list(map(lambda x: x*(-1), value))
heapq.heapify(value)

for i in range(M):
  num = (heapq.heappop(value)*(-1)//2)*(-1)
  heapq.heappush(value,num)

print(sum(list(map(lambda x: x*(-1), value))))

Submission status: Runtime Error

Solution code:
sankaNum, scoreMax, ansCnt = map(int, input().split())

score = []

for i in range(sankaNum):
    score.append(scoreMax)

for n in range(ansCnt):
    ansSanka = input()

    for k in range(sankaNum):
        if int(ansSanka) - 1 != k:
            score[k] -=  1
    
for m in range(sankaNum):

    if score[m]  > 0:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
s=input()
if s[0]=='S':
   print('Cloudy')
else if s[0]=='C':
   print('Rainy')
else:
   print('Sunny')

Submission status: Runtime Error

Solution code:
S=str(input())
if S=="Sunny":
    print("Cloudy")
elif S=="Cloudy":
    print("Rainy")
else :
    print(Sunny)

Submission status: Runtime Error

Solution code:
import os
import sys

weather_list = ['Sunny', 'Cloudy', 'Rainy']

today_weather = sys.argv[1]

weather_index = weather_list.index(today_weather)

weather_index = weather_index+1 if len(weather_list)-1!=weather_index else 0

print(weather_list[weather_index])

Submission status: Runtime Error

Solution code:
s=input()
if s=="Sunny":print("Cloudy")
elif s=="Cloudy":print("Rainy")
else print("Sunny")

Submission status: Runtime Error

Solution code:
tomorrow = {
  'Sunny': 'Cloudy',
  'Cloudy': 'Rainy',
  'Rainy': 'Sunny'
}
print(tomorrow[int(input())])

Submission status: Runtime Error

Solution code:
tomorrow = {
  'Sunny': 'Cloudy',
  'Cloudy': 'Rainy',
  'Rainy': 'Sunny'
};
print(tomorrow[int(input())])

Submission status: Runtime Error

Solution code:
S=input()
if S == Sunny:
  print(Cloudy)
  elif S == Cloudy:
    print(Rainy)
    else
    	print(Sunny)

Submission status: Runtime Error

Solution code:
today_weather = input()
list = ['Sunny', 'Cloudy', 'Rainly']
for i in range(0, 3):
	if(today_weather==list[i]):
		next_weather = list[(i+1)%3]
print(next_weather)

Submission status: Runtime Error

Solution code:
today_weather = input()
list = ['Sunny', 'Cloudy', 'Rainly']
print(list[1])
for i in range(0, 3):
	if(today_weather==list[i]):
		next_weather = list[(i+1)%3]
print(next_weather)

Submission status: Runtime Error

Solution code:
weather = ['Sunny', 'Cloudy', 'Rainy','Sunny']
print(weather(weather.index(input())))

Submission status: Runtime Error

Solution code:
def weather_prediction():
    today = input()
    print(tomorrow_weather_q today)

def tomorrow_weather_q(today):
    if today == "Sunny":
        return "Cloudy"
    elif today == "Cloudy":
        return "Rainy"
    elif today == "Rainy":
        return "Sunny"
    else:
        return 0

weather_prediction()

Submission status: Runtime Error

Solution code:
import sys

args = sys.argv

list = {'Sunny':'Cloudy', 'Cloudy':'Rainy', 'Rainy':'Sunny'}

print(list[args[1]])

Submission status: Runtime Error

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

    dp = [[0] * 5005 for i in range(5005)]

    for i in range(N, 0, -1):
        for j in range(N, 0, -1):
            if S[i-1] != S[j-1]:
                dp[i][j] = 0
            else:
                dp[i][j] = dp[i+1][j+1] + 1

    result = 0
    for i in range(N):
        for j in range(N):
            if i >= j:
                continue
            now = min(dp[i][j], j-i)
            result = max([now, result])

    print(result)

Submission status: Runtime Error

Solution code:
import math
import heapq
 
n, m = map(int, input().split())
A = list(map(int, input().split()))
A = list(map(lambda x:x*(-1), A))
for i in range(m):
    heapq.heapify(A)
    min = (-1)*((-1)*(heapq.heappop(A))//2)
    heapq.heappush(A, min)
 
 
print(int(sum(A))*(-1))

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python3
# -*- coding:utf-8 -*-

def attackSurvival(n, k, q, a):
    ans = []
    import collections
    c = collections.Counter(a)
    for i in range(n):
        if c[i+1] > q - k: ans.append('Yes')
        else: ans.append('No')
    return ans

def main():
    n, k, q = filter(int, input().split())
    a = []
    for _ in range(q):
        a.append(int(input()))
    attackSurvival(n, k, q, a)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
s = str(input())
loop = ["Sunny","Cloudy","Rainy"]
i = loop.index(s)
print(loop((i+1)%3))

Submission status: Runtime Error

Solution code:
if S == "Sunny": return "Cloudy"
if S == "Cloudy": return "Rainy"
if S == "Rainy": return "Sunny"

Submission status: Runtime Error

Solution code:
import sys
S = sys.stdin.readline().rstrip()
L = ['Sunny', 'Cloudy', 'Rainy']
if S ==L[0]:
    print(L[1])
elif S ==L[1]:
    print(L[2])
elif S ==L[2]:
    printf(L[0])

Submission status: Runtime Error

Solution code:
import sys
S = sys.stdin.readline().rstrip()
L = ['Sunny', 'Cloudy', 'Rainy']
if S ==L[0]:
    print(L[1])
elif S ==L[1]:
    print(L[2])
elif S ==L[2]:
    printf(L[0])

Submission status: Runtime Error

Solution code:
S = input()
if S = 'Sunny':
    print('Cloudy')
elif S = 'Cloudy':
    print('Rainy')
elif S = 'Rainy':
    print('Sunny')

Submission status: Runtime Error

Solution code:
cur = input()
if cur == "Sunny":
  print("Cloudy")
else if cur == "Rainy":
  print("Sunny")
else:
  print("Rainy")

Submission status: Runtime Error

Solution code:
n, k, q = map(int, input().split())
 
C = [0] * n
 
for a in range(q) :
    C[int(input())-1] += 1
 
sum_c = sum(C)
 
for i in range(n) :
    minus = sum_c - C[i]
    if minus < k :
        print('Yes')
    else :
        print('No')

Submission status: Runtime Error

Solution code:
n, k, q = map(int, input().split(" "))
liste = [k-q for i in range(n)]
for i in range(q):
    a = int(input())
    liste[a-1] += 1
for i in liste:
    if i > 0:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
dp = [0]*n
j = 1

for i in range(n):
    while s[i:j] in s[j:s]:
        j += 1
    dp[i] = j-i-1
print(max(dp))

Submission status: Runtime Error

Solution code:
n = int(input())
s = input().strip()
assert n == len(s)

maxlen = 0
for offset in range(1, n):
  t = s[offset:]
  d = 0
  for (a, b) in zip(s, t):
    if a == b:
      d += 1
    else:
      d = 0
    if maxlen < d and d <= offset:  # (d > offset) のとき共通部分文字列が重なってる
      maxlen = d

print(maxlen)

Submission status: Runtime Error

Solution code:
import heapq
N,M=map(int, input().split())
A=list(map(int, input().split()))
for i in range(N):
    A[i]=-1*A[i]
heapq.heapify(A)
for i in range(M):
    q=heapq.heappop(A)
    q=q/2
    heapq.heappush(A,q)
ans=0
for i in range(N):
    ans+=-1*int(A[i])
print(ans)

Submission status: Runtime Error

Solution code:
from sys import stdin
S = (stdin.readline().rstrip())
if S{0} == "S":
    print("Cloudy")
elif S[0] == "C":
    print("Rainy")
else:
    print("Sunny")

Submission status: Runtime Error

Solution code:
S=input()

if  S='Sunny':
  print('Cloudy')
elif  S='Cloudy':
  print('Rainy')
elif  S='Rainy'
  print('Sunny')

Submission status: Runtime Error

Solution code:
import heapq

N,M = map(int,input().split())

A = [int(i)*-1 for i in input().split()]
heapq.heapify(A)

for _ in range(M):
  max = heapq.heappop(A) * -1
  heapq.heappush(A,(max//2)*-1)





print(sum(A)*-1)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
import collections
import itertools


def solve(N: int, S: str):
    dp = [[0 for _ in range(N)] for _ in range(N)]

    for i in range(N):
        if S[i] == S[-1]:
            dp[i][N-1] = 1

    res = 0
    for i in range(N-2,-1,-1):
        for j in range(N-2,i,-1):
            if S[i] == S[j]:
                dp[i][j] = dp[i+1][j+1] + 1
                l = dp[i][j]
                if j >= i+l:
                    res = max(res,l)

    print(res)



# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, S)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import numpy as np


n,m = map(int,input().split())
a = np.array(list(map(int,input().split())))
for i in range(m):
    a[a.argmax()] = a[a.argmax()]//2 
print(np.sum(a))

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = list([int(x) for x in input().split()])
 
for i in range(m):
    a[a.index(max(a))] = max(a)//2
print(sum(a))

Submission status: Runtime Error

Solution code:
N,K,Q = map(int, input().split())

P = [0] * N


 
for i in range(Q):
	A = int(input())
	P[A-1] += 1


for j in range(0,len(P)):
	if K - Q + P[j] > 0:
		print('Yes')
	else:
		print('No')

Submission status: Runtime Error

Solution code:
import bisect
N, M = list(map(int, input().split(' ')))
As = list(map(int, input().split(' ')))
# osoi
As = sorted([-a for a in As])
while M:
    hoge = -As.pop(0) // 2
    M -= 1
    while M and As and hoge < As[1]:
        hoge = hoge // 2
        M -= 1
    bisect.insort(As, -hoge)
print(-sum(As))

Submission status: Runtime Error

Solution code:
import math
N,M=map(int,input().split())
l = [int(s) for s in input().split()]

for i in range(M):
  math.floor(l[l.index(max(l))] = l[l.index(max(l))]/2)

p = 0
for i in range(N):
  p += l[i]
print(p)

Submission status: Runtime Error

Solution code:
import numpy as np
n = list(map(int,input().split()))
a = np.array(list(map(int,input().split())))
print(a)
for i in range(n[1]):
    a[a.argmax()] = a[a.argmax()]//2 
print(np.sum(a))

Submission status: Runtime Error

Solution code:

from heapq import heappush, heappop, heapify


obj = input().strip().split(' ')
N, M = map(int, obj)

obj = input().strip().split(' ')
val_list = [-1 * item for item in list(map(int, obj))]

heapify(val_list)

for _ in range(M):
    val = (-1) * ((heappop(val_list) * (-1)) // 2)
    heappush(val_list, val)

print(-1 * sum(val_list))

Submission status: Runtime Error

Solution code:
import math
N,M=map(int,input().split())
#print(N,M)
a = list(map(float,input().split()))
#print(a)
a.sort(reverse=True)
#print(a)
k=0
maxa=a[0]/2
while M>0:
#  print(M,k,maxa,a)
  if a[k]>=maxa:
    a[k]=a[k]/2
    M=M-1
  if k==len(a)-1:
    a.sort(reverse=True)
    k=0
    maxa=a[0]
    if maxa<1:
      break
    continue
  if a[k]<a[k+1]:
    if maxa<a[k]:
      maxa=a[k]
    k=k+1
  elif a[k]<maxa:
    if maxa<a[k]:
      maxa=a[k]
    k=k+1
#print(a)
total=0
for t in a:
  total+=int(t)
#  print(t,total)
print(total)

Submission status: Runtime Error

Solution code:
a = ["Sunny", "cloudy", "Rainy"]
s = input()
for i in range(0, 3):
  if s == a[i]:
    print(a[(i+1)/3])

Submission status: Runtime Error

Solution code:
N, K, Q = map(int, input().split())
A = [int(input()) for i in range(Q)] 

p = Q - K
for i in range(N):
    j = A.count(i+1)
    if j > p:
        print('Yes')
    else:
        print('No')
    j = 0

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = [ int(a) for a in input().split() ]
A.sort(reverse=True)
 
for m in range(M):
    A[0] = A[0] // 2
    A.sort(reverse=True)
 
print(sum(A))

Submission status: Runtime Error

Solution code:
import heapq as h

# input
n, m = map(int, input().split())
la = list(map(lambda x: int(x)*-1, input().split()))

h.heapify(la)

while m > 0:
    max = abs(la[0])
    h.heapreplace(la, (max // 2)*-1)
    m -= 1

print(abs(sum(la)))

Submission status: Runtime Error

Solution code:
import bisect
import math
 
N,M = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort()
 
for m in range(M):
    A[N-1] = math.floor( A[N-1]/2 )
    temp = A[N-1]
    del A[N-1]
    # 挿入    
    bisect.insort(A, temp)
print(sum(A))

Submission status: Runtime Error

Solution code:
if S=="Sunny":
    print(Cloudy)
if S=="Cloudy":
    print(Rainy)
if S=="Rainy":
    print(Sunny)

Submission status: Runtime Error

Solution code:
import sys

def main():
    N = sys.stdin.readline()
    w = ['Sunny', 'Cloudy', 'Rainy']
    i = w.index(N)
    print(w[(i+1)%3])

if __name__=='__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys
if argv[1] == 'Sunny':
  echo "Cloudy"
elif argv[1] == 'Cloudy':
  echo "Rainy"
elif argv[1] == 'Rainy' :
  echo "Sunny"
else:

Submission status: Runtime Error

Solution code:
import sys
N,K,Q =map(int,input().split())
F = {}
A = []
for l in sys.stdin:
    A.append(int(l))
for i in range(N):
    cnt = A.count(i+1)
    F[str('A'+ str(i+1))] = K - (Q - cnt)
    if F[str('A'+ str(i+1))] >= 1 :
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
import bisect
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
for i in range(m):
    tmp_max = a.pop()
    bisect.insort(a, tmp_max // 2)
print(sum(a))

Submission status: Runtime Error

Solution code:
n,k,q = map(int,input().split())
a = [] # 順番
for _ in range(q):
    a.append(int(input()))


point = [k] * n


for win in a:         # 勝った人(a[win-1])以外を下げる
    point[win-1] += 1
    for i in range(n):
        point[i] -= 1
#        print(point)

#print(point)


for i in point:
    if i <= 0:
        print("No")
    elif i >= 1:
        print("Yes")

Submission status: Runtime Error

Solution code:
N , M = map(int, input().rstrip().split())
 
pricelist = list(map(int, input().split()))
#moneylist = input().rstrip().split()
#pricelist.append(price)
 
for i in range(M):
  pricelist.sort()
  pricelist[N-1] = pricelist[N-1] // 2

print(sum(pricelist))

Submission status: Runtime Error

Solution code:
s = input()
if s=='Sunny':
  print('Cloudy')
elif: s=='Rainy':
    print('Sunny')
else:
  print('Rainy')

Submission status: Runtime Error

Solution code:
import bisect
import numpy as np

n, m = map(int, input().split())
*a, = map(int, input().split())

a = sorted(a)
a = np.array(a)

for i in range(m):
    a[n-1] = a[n-1] // 2
    temp = a.pop()
    bisect.insort_left(a, temp)
print(sum(a))

Submission status: Runtime Error

Solution code:
s = input()

if s == "Sunny":
  	print("Cloudy")
else if s == "Cloudy":
  	print("Rainy")
else:
  	print("Sunny")

Submission status: Runtime Error

Solution code:
listA=[] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
        #または、quit(),os.exit()をして止める。

n,m=listA[0]

maxA=sorted(listA[1])
kei=0
kei_list=[]
j=0
m1=m
for j in range(m,0,-1):
  	m=m1
    kei=0
    for i in range(n):
        kei=kei + maxA[-i]//(2**(m-j))
        j=j-1
    kei_list.append(kei)
        
print(min(kei_list))
#print(n,k,q)
"""
point=[k]*n

Submission status: Runtime Error

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

def merge_sort(arr):
    if len(arr) <= 1:
        return arr

    mid = len(arr) // 2
    # ここで分割を行う
    left = arr[:mid]
    right = arr[mid:]

    # 再帰的に分割を行う
    left = merge_sort(left)
    right = merge_sort(right)

    # returnが返ってきたら、結合を行い、結合したものを次に渡す
    return merge(left, right)


def merge(left, right):
    merged = []
    l_i, r_i = 0, 0

    # ソート済み配列をマージするため、それぞれ左から見ていくだけで良い
    while l_i < len(left) and r_i < len(right):
        # ここで=をつけることで安定性を保っている
        if left[l_i] <= right[r_i]:
            merged.append(left[l_i])
            l_i += 1
        else:
            merged.append(right[r_i])
            r_i += 1

    # 上のwhile文のどちらかがFalseになった場合終了するため、あまりをextendする
    if l_i < len(left):
        merged.extend(left[l_i:])
    if r_i < len(right):
        merged.extend(right[r_i:])
    return merged

N,M=map(int,input().split())
A=list(map(int, input().split()))
merge_sort(A)
for i in range(M):
  A[N-1]=A[N-1]/2
  for j in range(N-1,0,-1):
    if A[j-1]>A[j]:
      a=A[j-1]
      A[j-1]=A[j]
      A[j]=a
    else:
      break
  #print(A)
ans=0
for i in range(N):
  ans+=math.floor(A[i])
print(ans)

Submission status: Runtime Error

Solution code:
def S:
    sample_list = ['Sunny', 'Cloudy', 'Rainy']
random.shuffle(sample_list)
print sample_list
if S==Sunny:
  print(Cloudy)
if S==Cloudy:
  print(Rainy)
if S==Rainy:
  print(Sunny)

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = list(map(int,input().split()))
A = sorted(A)
if N == 1:
  a = A[0]
  for j in range(M):
    a = a//2
  print(a)
elif N > 1:  
  for i in range(M):
    aa = A.index(max(A))
    A[aa] = A[aa]//2
  print(sum(A))

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
l = sorted(list(map(int,input().split())))
l.reverse()
yl = [0]*n
r = [-(-l[0]//i) for i in l]
chk = 1
flag = False
while True:
  #group 1
  for i in range(n):
    if r[i] > chk:
        break
    elif r[i] > chk//2 :
        yl[i]+=1
        m-=1
        if m == 0:
            flag = True
        break
  if flag:
     break
  #group 2
  for i in range(n):
    if r[i] > chk//2:
      break
    else:
      yl[i]+=1
      m-=1
      if m == 0:
        flag = True
        break
  if flag:
    break
  chk *= 2
ans = 0
for i,j in zip(l,yl):
  ans += i//(2**j)
print(ans)

Submission status: Runtime Error

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

S = list(map(int, input().split()))
N = S[0]
M = S[1]
A = list(map(int, input().split()))


for _ in range(M):
    A[A.index(max(A))] //= 2

print(sum(A))

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
A = list(map(int, input().split()))

for i in range(M):
    A.sort(reverse=True)
    A[0] //= 2

print(sum(A))

Submission status: Runtime Error

Solution code:
ss = input()

if ss == 'Sunny':
  print('Cloudy')
  elif ss == 'Cloudy':
    print('Rainy')
    else:
      print('Sunny')

Submission status: Runtime Error

Solution code:
n,k,q = map(int, input().split())
a = [int(input()) for _ in range(q)]
p = [0]*n

if k>q:
    for i in range(n):
        print('Yes')
    exit()
else:
    for i in range(n):
        p[i]=a.count(i+1)
        if k+p[i]-q<=0:
            print('No')
        else:
            print('Yes')

Submission status: Runtime Error

Solution code:
N,K,Q = map(int,input().split())
A = []
P = []
for x in range(0,N):
    P.append(K)
for a in range(0,Q):
    A.append(input())
    
for a in range(0,Q):
    for x in range(0,N):
        P[x] = P[x] - 1
    P[int(A[a])-1]=P[int(A[a])-1]+1
for x in range(0,N):
    if P[x] <= 0:
        P[x] = 'No'
    else:
        P[x] = 'Yes'
for x in range(0,N):
    print(P[x])

Submission status: Runtime Error

Solution code:
# python3
import numpy as np

def atack_survival(N, K, r_list):
	point_list= np.full(N, K)
	for i in r_list:
		point_list= point_list - 1
		point_list[i-1]= point_list[i-1] + 1


	for i in point_list:
		if i <= 0:
			print ("No")
		else:
			print("Yes")

if __name__ == '__main__':
    l = list(map(int, input().split()))
    N=l[0]
    K=l[1]
    Q=l[2]
    result= [int(input()) for i in range(Q)]
    atack_survival(N,K,result)

Submission status: Runtime Error

Solution code:
str = input()

split = str.split(" ")

N = int(split[0])
M = int(split[1])

HowMuch = [0 for i in range(N)]

split = input().split(" ")
for i in range(N):
  HowMuch[i] = int(split[i])
  
sortHow = HowMuch.sort(reverse = True)

if sortHow is None:
  sortHow = HowMuch[0]

if type(sortHow) is int:
  for i in range(M):
    sortHow //= 2
  print(sortHow)
else:
  for i in range(M):
    maxInd = sortHow.index(max(sortHow))
    sortHow[maxInd] //= 2
  print(sum(HowMuch))

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000)


def coupon(i, m, pay):
    if m == 0 or i == n:
        return sum(l[i:])
    for maisuu in range(1, 31):
        #print("{}に{}まい使う".format(i, maisuu))
        now = l[i] // (2 ** maisuu)
        pay = min(pay, coupon(
            i + 1, m - maisuu, pay) + now)
        if now == 0:
            break

    return pay


n, m = map(int, input().split())

l = [int(c) for c in input().split()]
l.sort()
l.reverse()
max_pay = sum(l)
# print(l)


print(coupon(0, m, max_pay))

Submission status: Runtime Error

Solution code:
ss = input()

if ss == 'Sunny':
  print('Sunny')
  elif ss == 'Cloudy':
    print('Cloudy')
    else:
      print('Rainy')

Submission status: Runtime Error

Solution code:
from collections import deque
import bisect

N, M = map(int, input().split(" "))
As = [0]+list(map(int, input().split(" ")))
As = sorted(As)
cnt = 0
cnt2 = 1
for _ in range(M):
  i = As[-1-cnt]  
  i = i//(2**cnt2)
  if i < As[-1-cnt-1]:
    cnt += 1
    cnt2 = 1
    bisect.insort_left(As,i)
  else:
    cnt2 += 1

print(sum(As[:-cnt]))

Submission status: Runtime Error

Solution code:
n, k, q = map(int, input().split())

adict = {i + 1: k for i in range(n)}

answer = [int(input()) for _ in range(q)]

for k, v in adict.items():
    adict[k] = v - (q - answer.count(k))

    if adict[k] > 0:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
import numpy as np
N, K, Q = map(int, input().split())
S = []
for _ in range(Q):
    S.append(int(input())) 
P=np.array([K]*N)
for i in range(Q):
  P[S[i]-1]+=1
P -= Q
for i in range(N):
  if P[i] <= 0:
    print("No")
  else:
    print("Yes")

Submission status: Runtime Error

Solution code:
import sys

def main():
    N = sys.stdin.readline()
    w = ['Sunny', 'Cloudy', 'Rainy', 'Sunny']
    i = w.index(N)
    print(w[i+1])

if __name__=='__main__':
    main()

Submission status: Runtime Error

Solution code:
n, k, q = list(map(int, input().split()))
a = [0] * q
for i in range(q):
  a[i] = int(input())

cur_k = [k] * n

for i in range(q):
  cur_k[a[i] - 1] += 1

for i in cur_k:
  if (i > q):
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

Solution code:
import numpy as np

s = input().split()
N = int(s[0])
M = int(s[1])
A = np.array(list(map(int, input().split())))
for i in range(M):
    A[A.argmax()] //= 2
print(np.sum(A))

Submission status: Runtime Error

Solution code:
S = input()
if S = 'Sunny':
  print ('Cloudy')
elif S = 'Cloudy':
  print ('Rainy')
else:
  print ('Sunny')

Submission status: Runtime Error

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


class Node:
    def __init__(self, num_):
        self.num = num_
        self.children = {}  # dict

    def addChild(self, ch_, num_):
        self.children[ch_] = Node(num_)


ma_max = 0
Tr = {}
for i in range(0, N):
    tr = Tr
    ma = 0
    for j in range(i, N):
        if S[j] not in tr:
            tr[S[j]] = Node(j)
            tr = tr[S[j]].children
        else:
            if tr[S[j]].num >= i:
                ma = 0
            else:
                ma += 1
            tr = tr[S[j]].children
    ma_max = max(ma_max, ma)
    if N - i < ma_max:
        break

print(ma_max)

Submission status: Runtime Error

Solution code:

import sys
def input():
    return sys.stdin.readline()[:-1]

N, K, Q = map(int, input().split())

points = [K for _ in range(N)]

for q in range(Q):
    A = int(input()) - 1
    points = [p if i == A else p-1 for i, p in enumerate(points)]
for p in points:
    if p < 1:
        print('No')
    else:
        print('Yes')

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
As = list(map(int,input().split()))

for i in range(M):
    index = As.index(max(As))
    As[index] = As[index] // 2

print(sum(As))

Submission status: Runtime Error

Solution code:
import numpy as np

N,M = map(int,input().split())
A = sorted(list(map(int,input().split())))
for i in range(M):
  A[-1] = A[-1]/2
  if len(A) == 1:
    continue
  elif A[-1] < A[-2]:    
    A = sorted(A)
A = np.array(A)
A = np.floor(A)
print(int(np.sum(A)))

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())

A = list(map(int, input().split()))
def soujyuu(left, right, num):
    if right - left <= 1:
        A.insert(right, num)
    else:
        if num >= A[left + right // 2]:
            left = left + right // 2
        else:
            right = left + right // 2
        soujyuu(left, right, num)


A.sort()
for i in range(M):
    maxA = A.pop(N-1)
    maxA = maxA // 2
    soujyuu(0,N-2, maxA)
    #print(A)

print(sum(A))

Submission status: Runtime Error

Solution code:
import sys
from bisect import bisect_left,bisect

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n,m=map(int,input().split())

A=list(map(int,input().split()))
A=sorted(A)

for i in range(m):
	A.insert(bisect_left(A,max(A)//2),max(A)//2)
	del A[n]
	
print(sum(A))

Submission status: Runtime Error

Solution code:
mnum, gnum = map(int, input().split())
array = list(map(int, input().split()))

for i in range(gnum):
	array.sort()
	array[len(array)-1] = array[len(array)-1]/2

print(sum(array))

Submission status: Runtime Error

Solution code:
a = input()
if a == 'Sunny':
  print('Cloudy')
elif a == 'Cloudy':
  print('Rainy')
else
  print('Sunny')

Submission status: Runtime Error

Solution code:
ss = input().split()
N = int(ss[0])
K = int(ss[1])
Q = int(ss[2])
As = []

SCORE = [0] * N

for i in range(Q):
  SCORE[int(input())-1] += 1
for i in range(N):
  if(SCORE[i]<= Q-K):
    print("No")
  else:
    print("Yes")

Submission status: Runtime Error

Solution code:
a = input().strip()
if a == 'Sunny':
  print('Cloudy')
else if a == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')

Submission status: Runtime Error

Solution code:
import math
import bisect

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort()

for i in range(M):
  if (A[N - 1] < A[N - 2]):
    a = A.pop(-1)
    bisect.insort(A, a)
  A[N - 1] /= 2.0
amount = 0
for a in A:
  amount += math.floor(a)
print(amount)

Submission status: Runtime Error

Solution code:
a = input().split()
if a == 'Sunny':
  print('Cloudy')
else if a == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')

Submission status: Runtime Error

Solution code:
import math

nm = list(map(int,input().split(" ")))
N = nm[0]
M = nm[1]

A = list(map(int,input().split(" ")))
A.sort(reverse=True)
hmax = math.floor(A[0]/2)
index = 0
while M > 0:
    if index != len(A):
        if A[index] >= hmax:
            A[index] = math.floor(A[index]/2)
            M = M -1
            index = index + 1
        else:
            index = 0
            A.sort(reverse=True)
            hmax = math.floor(A[0])
    else:
        index = 0
    if hmax == 0:
        break
print(sum(A))

Submission status: Runtime Error

Solution code:
import numpy as np
n,k,q=map(int,input().split())	
listA=[] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))
    except:
        break;
a=np.repeat(k,n)
for word in listA:
    a[word]+=1
result=[]
for i in range(len(a)):
    if a[i]<=0:
        print('No')
    else:
        print('Yes')

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
N, K, Q = map(int, input().split())
score = np.array([K]*N)


for i in range(Q):
    answer = int(input())
    score[answer - 1] += 1
    score = score - 1


for i in range(N):
    if score[i] <= 0:
        print("No")
    else:
        print("Yes")

Submission status: Runtime Error

Solution code:
# D - Powerful Discount Tickets

def power(price, ticket_count):
    return int(price // (2 ** ticket_count))

# n: 商品数
# m: チケットの枚数
n, m = map(int, input().split())
data = list(map(int, input().split()))

ans = 0

for i in range(m):
    data.sort()
    data = data[::-1]

    max_data = data[0]
    if max_data == 0:
        break

    max_point = 0
    data[max_point] = power(data[max_point], 1)

print(sum(data))

Submission status: Runtime Error

Solution code:

n,k,q = map(int, raw_input().split())
import numpy as np

vec = np.full(n, k, dtype=int)
for i in range(q):
  ind = np.full(n, 1, dtype=int)
  a = int(raw_input())
  ind[a-1] = 0
  vec = vec - ind
  
print('Yes' if i > 0 in vec else 'No')

Submission status: Runtime Error

Solution code:
a = input()
if a == "Sunny":
    print("Cloudy")
elif a == "Rainy":
    print("Sunny")
else a == "Cloudy":
    print("Rainy")

Submission status: Runtime Error

Solution code:
w = input()
 
s = "Sunny"
c = "Cloudy"
r = "Rainy"
 
if w == s:
  print(c)
elif w == c:
  print(r)
else w == r:
  print(s)

Submission status: Runtime Error

Solution code:
def main():

  n,m=map(int,input().split())
  a=list(map(int,input().split()))
  for i in range(m):
    a.sort(reverse=True)
    a[0]=a[0]//2
  print(sum(a))
  
main()

Submission status: Runtime Error

Solution code:
import numpy as np
 
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
 
member = np.ones(N) * K
 
for a in A:
    member -= 1
    member[a - 1] += 1
 
res = np.array(['No', 'Yes'])[(member > 0).astype('int')]
 
for r in res:
    print(r)

Submission status: Runtime Error

Solution code:
n,k,q=map(int,input().split())
a=list(int(input()) for i in range(q))

if k>q:
    for i in range(n):
        print('Yes')
else:
    for i in range(n):
        ans=a.count(i+1)
        if ans+k>q:
            print('Yes')
        else:
            print('No')

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
A = list(map(int, input().split()))
A = sorted(A)

from bisect import insort_left

for _ in range(m):
    x = A.pop()//2
    insort_left(A, x)

print(sum(A))