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:
Wethers={"Sunny":0,"Cloudy":1,"Rainy":2}
Wether=["Sunny","Cloudy","Rainy"]
S=input()[:-1]
S_id = Wethers[S]
print(Wether(S_id+1)%3)

Submission status: Runtime Error

Solution code:
Wethers={"Sunny":0,"Cloudy":1,"Rainy":2}
Wether=["Sunny","Cloudy","Rainy"]
S=input()[:-1]
S_id = Wethers[S]
print((S_id+1)%3)

Submission status: Runtime Error

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
n,k,q=map(int,input().split())
pt=[0 for _ in range(n)]
for _ in range(q):
    a = int(input())
    pt[a-1] += 1
base=q-k
for p in pt:
    print("No" if p <= base else "Yes")

Submission status: Runtime Error

Solution code:
weather_list = ["Sunny", "Cloudy", "Rainy"]
a = input("")
print( weather_list[ weather_list.index(a) + 1 ] )

Submission status: Runtime Error

Solution code:
weather_list = ["sunny", "cloudy", "rainy"]
a = input("")
print( weather_list[ weather_list.index(a) + 1 ] )

Submission status: Runtime Error

Solution code:
weather_list = ["sunny", "cloudy", "rainy"]
a = input("")
print( wether_list[ weather_list.index(a) + 1 ] )

Submission status: Runtime Error

Solution code:
S = input()

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

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

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

Submission status: Runtime Error

Solution code:
arr ={"Sunny":"Cloudy","Cloudy":"Rainy","Rainy":""Cloudy"}
S = input()
print(arr[S])

Submission status: Runtime Error

Solution code:
arr ={"Sunny":"Cloudy","Cloudy":"Rain","Rain":""Cloudy"}
S = input()
print(arr[S])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import collections
def main():
    li = list(map(int,input().split()))
    respondents = [int(input()) for i in range(li[2])]
    number_of_respondes = respondes_number_of_participants(respondents)
    check_surviver(number_of_respondes,li[0],li[1],li[2])


def respondes_number_of_participants(respondents):
    return collections.Counter(respondents)


def check_surviver(number_of_respondes,number_of_participants,gived_points,number_of_questions):
    for i in range(number_of_participants):
        if number_of_respondes[i+1]:
            if gived_points - number_of_questions + number_of_respondes[i+1] > 0:
                print("Yes")
            else:
                print("No")
        else:
            if gived_points - number_of_questions > 0:
                print("Yes")
            else:
                print("No")

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import heapq
N,M=map(int,input().split())
A=[-int(x) for x in input().split()]
heapq.heapify(A)
    
for i in range(0,M):
    tmp=heapq.heappop(A)
    heapq.heappush(A,-int(-tmp/2))
print(-sum(A))

Submission status: Runtime Error

Solution code:
def participants_maker(number_of_participates,point):
    return [point]*number_of_participates



def point_getter(participates,respondents):
    for i in range(len(respondents)):
        participates = list(map(lambda x : x-1, participates))
        participates[respondents[i]-1] += 1
    return participates

def discriminate_serviver(result_score):
    for i in range(len(result_score)):
        if result_score[i] <= 0:
            print("NO")
        else:
            print("YES")








def main():
    li = list(map(int,input().split()))
    respondents = [int(input()) for i in range(li[2])]
    participates = participants_maker(li[0],li[1])
    result_score = point_getter(participates,respondents)
    discriminate_serviver(result_score)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
N,K,Q = map(int, input().split()) #N人、K点、Q問
A = [int(input()) - 1 for i in range(Q)] #受験番号とリスト番号のズレを補正
# print(A)
P = [0] * N #持ち点
for j in range(Q):
    P[A[j]] +=1
for k in range(N):
    if P[k] > Q - K:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
from collections import defaultdict
 
 
N, K, Q = map(int, input().split(' '))
a = [int(input()) for _ in range(Q)]
 
num_ans = defaultdict(int)
for i in a:
    num_ans[i-1] += 1
 
for i in range(N):
    win = K - (Q - num_ans[i]) > 0
    print('Yes' if win else 'No')

Submission status: Runtime Error

Solution code:
from collections import defaultdict


N, K, Q = list(map(int, input().split(' ')))
a = [int(input()) for _ in range(N)]

num_ans = defaultdict(int)
for i in a:
    num_ans[i-1] += 1

for i in range(N):
    win = K - (Q - num_ans[i]) > 0
    print('Yes' if win else 'No')

Submission status: Runtime Error

Solution code:
now_wether = input() 

if now_wether == "Sunny":
  print(Cloudy)
elif now_wether == "Cloudy":
  print(Rainy)
else:
  print(Sunny)

Submission status: Runtime Error

Solution code:
S = input()

weather_list = ["Sunny", "Cloudy", "Rainy", "Sunny"]
print(weather_list[weather_list.index("S") + 1])

Submission status: Runtime Error

Solution code:
arr = ['Sunny', 'Cloudy', 'Rainy']
in = input()
ind = (arr.index(in) + 1) % 3
print(arr[ind])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=input()
if s=Sunny:
    print('Cloudy')
if s=Cloudy:
    print('Rainy')
eise:
    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:
n=input()
if(n=Sunny):
  print(Cloudy)
elif(n=Cloudy):
  print(Rainy)
else:
  print(Sunny)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
today = input()
 
if today = "Sunny":
  tomorrow = "Cloudy"
elseif today = "Cloudy":
  tomorrow = "Rainy"
else:
  tomorrow = "Sunny"
 
print(tomorrow)

Submission status: Runtime Error

Solution code:
today = input()

if today = "Sunny":
  tomorrow = "Cloudy"
elseif today = "Cloudy":
  tomorrow = "Rainy"
else:
  tomorrow = "Rainy"

output(tomorrow)

Submission status: Runtime Error

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

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:
s = input()
if s == "Sunny"
print("Cloudy")
elif s == "Cloudy"
print("Rainy")
elif s == "Rainy"
print("Sunny")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

status = input()
out = {"Sunny", "Cloudy", "Rainy"}

if status==out[0]:
	print(out[1])
elif status==out[1]:
	print(out[2])
elif status==out[2]:
	print(out[0])

Submission status: Runtime Error

Solution code:
import sys

status = input()
out = {"Sunny", "Cloudy", "Rainy"}

if(status==out[0])
	print(out[1])
elif(status==out[1])
	print(out[2])
elif(status==out[2])
	print(out[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def solve():
  weather_dictionary = {
    'Sunny': 'Cloudy',
    'Coludy': 'Rainy',
    'Rainy': 'Sunny'
  }

  print(weather_dictionary[input()])
  

if __name__ == '__main__':
  solve()

Submission status: Runtime Error

Solution code:
from sys import stdin
S == stdin.readline().rstrip()
if S == "Sunny":
  print("Cloudy")
elif S == "Cloudy":
  print("Rainy")
else:
  print("Sunny")
S == input()
if S == "Sunny":
  print("Cloudy")
elif S == "Cloudy":
  print("Rainy")
else:
  print("Sunny")

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:
if S == "Sunny":
  print("Cloudy")
elif S == "Cloudy":
  print("Rainy")
else:
  print("Sunny")

Submission status: Runtime Error

Solution code:
import math

n, m = map(int, input().split())
a_i = list(map(lambda x: math.log(int(x), 2), input().split()))
for _ in range(m):
    a_i.sort(reverse=True)
    a_i[0] -= 1
print(sum(map(lambda x: int(2 ** x), a_i, 0)))

Submission status: Runtime Error

Solution code:
import math
from functools import reduce

n, m = map(int, input().split())
a_i = list(map(lambda x: math.log(int(x), 2), input().split()))
for _ in range(m):
    a_i.sort(reverse=True)
    a_i[0] -= 1
print(reduce(lambda acc, x: acc + int(2 ** x), a_i, 0))

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:
s=input()
if s ==　Sunny:
    print("Cloudy")
if s ==　Cloudy:
    print("Rainy")
else:
    print("Sunny")

Submission status: Runtime Error

Solution code:
n,k,q=map(int,input().split())
L= [ int(input()) for i in range(q)]
N = [ k-q+L.count(i) for i in range(1,n+1) ]
for i in N:
    print('YES' if i>0 else 'NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=list(input())
K="Yes"
for i in range (0,len(S)):
	if i%2==0:
		if S[i]=="L" :
        	K="No"
			break
		else:
        	continue
	else :
		if S[i]=="R" :
			K="No"
			break
		else:
			continue
print(K)

Submission status: Runtime Error

Solution code:
S=list(input())
K="Yes"
for i in range (0,len(S)):
	if i%2==0:
	    if S[i]=="L" :
        	K="No"
        	break
        else:
        	continue
    else :
		if S[i]=="R" :
        	K="No"
        	break
    	else:
        	continue
print(K)

Submission status: Runtime Error

Solution code:
#キューを使っている。ところどころマイナスにしているのはキューの性質のため。実行時間が全然違うのはソートが早いから
n,m = map(int,input().split())
a = list(map(lambda x: -int(x) ,input().split()))
print(a)
import heapq
heapq.heapify(a)
for _ in range(m):
  tmp = -heapq.heappop(a)
  tmp //= 2
  heapq.heappush(a,-tmp)
print(-sum(a))

Submission status: Runtime Error

Solution code:
a = input("日本語で文を入力してください -> ")
b = input("調べたい文字は -> ")
print(a.find(b))

Submission status: Runtime Error

Solution code:
a = int(input("aを入力:"))
if a == 0:
    print("zero")
else:
    print("non zero")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
w = ['Sunny', 'Cloudy', 'Rainy']
print(w[w.index(s) + 1])

Submission status: Runtime Error

Solution code:
import heapq

N, M = tuple(map(int, input().split()))
A = list(map(lambda a: -1*int(a), input().split()))
heapq.heapify(A)

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

print(-1*sum(A))

Submission status: Runtime Error

Solution code:
tenki = input()

if tenki == Sunny:
  print("Cloudy")
elif tenki == Rainy:
  print("Rainy")
else:
  print("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:
S==input()
if S=='Sunny':
  print("Cloudy")
elif S=='Cloudy':
  print("Rainy")
elif S=='Rainy':
  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:
S==input()
if S=='Sunny':
  print'Cloudy'
elif S=='Cloudy':
  print'Rainy'
elif S=='Rainy':
  print'Sunny'

Submission status: Runtime Error

Solution code:
I = input()
K = ['Sunny', 'Cloudy,''Rainy', 'Sunny']
Idx = K.index(I)
print(K[Idx+1])

Submission status: Runtime Error

Solution code:
I = input()
K = ['Sunny', 'Cloudy,''Rainy', 'Sunny']
Idx = K.index(I)
print(K[idx+1])

Submission status: Runtime Error

Solution code:
import numpy as np

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

for a in range(Q):
    A.append(int(input()))

P = [K] * N
X = [-1] * N
B = [0] * N

P_n = np.array(P)
X_n = np.array(X)
X_n_Q = X_n * Q

R_n = P_n + X_n_Q

B_n = np.array(B)

for a in A:
    B_n[a-1] = B_n[a-1] + 1

dif_n = R_n + B_n
dif = dif_n.tolist()

for d in dif:
    if d >= 1:
        print('Yes')
    else:
        print('No')

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 sys
input = sys.stdln.readline
s = input()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if S[i] == ("R" or "U" or "D"):
    	continue
   	else:
    	print("No")
      	exit()
  else:
  	if S[i] == ("L" or "U" or "D"):
    	continue
    else:
    	print("No")
      	exit()
print("Yes")

Submission status: Runtime Error

Solution code:
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if S[i] == ("R" or "U" or "D"):
    	continue
   	else:
    	print("No")
      	exit()
  else:
    if S[i] == ("L" or "U" or "D"):
    	continue
    else:
    	print("No")
      	exit()
print("Yes")

Submission status: Runtime Error

Solution code:
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if S[i] == ("R" or "U" or "D"):
      continue
   	else:
      print("No")
      exit()
  else:
    if S[i] == ("L" or "U" or "D"):
      continue
    else:
      print("No")
      exit()
print("Yes")

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, M = list(map(lambda x:int(x), input().split(' ')))
l = list(map(lambda x:int(x), input().split(' ')))

maxheap = MaxHeap(l)

WARI = 0.5
for _ in range(0, M):
    v = int(maxheap.pop() * WARI)
    maxheap.push(v)

SUM = 0
for _ in range(0, N):
    SUM += maxheap.pop()

print(SUM)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input()
b = 'Sunny'
c = 'Cloudy'
d = 'Rainy'
if a = b:
 print(c)
if a = c:
 print(d)
if a = d:
 print(b)

Submission status: Runtime Error

Solution code:
a = input()
b = 'Sunny'
c = 'Cloudy'
d = 'Rainy'
if a = b:
 print(c)
elif a = c:
 print(d)
elif a = d:
 print(b)

Submission status: Runtime Error

Solution code:
a=input()
b='Sunny'
c='Cloudy'
d='Rainy'
if a=b:
 print(c)
elif a=c:
 print(d)
elif a=d:
 print(b)

Submission status: Runtime Error

Solution code:
a=input("")
b='Sunny'
c='Cloudy'
d='Rainy'
if a=b:
 print(c)
elif a=c:
 print(d)
elif a=d:
 print(b)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
wether = ['Sunny','Cloudy','Rainy']
S = input()

if S == wether[0]:
  print(wether[1])
elif S == wether[1]:
  print(wether[2])
else:
  print(wether[3])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
wether = ['Sunny','Cloudy','Rainy']
S = int(input())

if S == wether[0]:
  print(wether[0])
elif S == wether[1]:
  print(wether[1])
else:
  print(wether[2])

Submission status: Runtime Error

Solution code:
a=input()
b=Sunny
c=Cloudy
d=Rainy
if a=b:
print(c)
elif a=c:
print(d)
else:
print(b)

Submission status: Runtime Error

Solution code:
a=input()
b=Sunny
c=Cloudy
d=Rainy
if a=b:
print(c)
elif a=c:
print(d)
else a=d:
print(b)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
wet = ["Sunny","Cloudy","Rainy"]

if S == wet[0]:
	ptint(wet[1])
elif S == wet[1]:
	ptint(wet[2])
else:
	ptint(wet[0])

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=input()
if n='Sunny':
  print('Cloudy')
elif n='Cloudy':
  print('Rainy'):
else:
  print('Sunny')

Submission status: Runtime Error

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

elif input()=='Cloudy':
  print('Rainy')

else:
  print('Sunny')

Submission status: Runtime Error

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

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:
S=input()
if S == "Sunny" :
    print("Cloudy")
else if S =="Cloudy":
    print("Rainy")
else
    print("Sunny")

Submission status: Runtime Error

Solution code:
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
t=0
while True:
  maxi=A[0]
  if len(A)>1 :
    maxi_2=A[1]
    t+=1
    maxi=maxi//2
    if t==M :
      A[0]=maxi
      break
    elif maxi_2>maxi :
      A[0]=maxi_2
      A[1]=maxi
      for i in range(1,N):
        if A[i]<A[i+1]:
          A[i]=A[i+1]
          A[i+1]=maxi
        else:
          break     
      continue
    else:
      continue
  else :
    maxi=maxi//(2**M)
    A[0]=maxi
    break

amount=sum(A)
print(amount)

Submission status: Runtime Error

Solution code:
from fractions import gcd as bltin_gcd


def coprime2(a, b):
    return bltin_gcd(a, b) == 1


def cf(x1,x2):
    cf = [1]
    for i in range(2, min(x1, x2) + 1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf


A, B = map(int, input().split())

# 公約数
divisor_list = cf(A, B)

# print(divisor_list)

counts = []
for i in divisor_list:
    if i == 1:
        continue

    other_list = list(filter(lambda x: x != i, divisor_list))

    count = 0
    nums = []
    for j in other_list:
        if coprime2(i, j):
            for n in nums:
                if not coprime2(j, n):
                    break
            else:
                nums.append(j)
                count = count + 1

    counts.append(count)

if not counts:
    print(1)
else:
    print(max(counts) + 1)

Submission status: Runtime Error

Solution code:
if S=="sunny":
   print("cloudy")
elif S=="cloudy":
   print("rainy")
else:
   print("sunny")

Submission status: Runtime Error

Solution code:
a = {'Sunny' : 'Cloudy', 'Cloudy': 'Rainy', 'Rainy': 'Sunny')
s = input()
print(a[s])

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:
s=input()
w=['Sunny','Cloudy','Rainy']
print(w[w.index(s)+1])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
print(a)

Submission status: Runtime Error

Solution code:
S = input()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
  input=input()
  
  weather={"Sunny":0,"Cloudy":1,"Rainy":2}
  output={0:"Sunny",1:"Cloudy",2:"Rainy"}
  s=weather[input]+1
  if s>=3:
           s=s-3
           print(output[s])
　else:
		　　print(output[s])

Submission status: Runtime Error

Solution code:
inp = input()

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

if inp == 'Sunny':
  print arr[1]
elif inp == 'Cloudy':
  print arr[2]
elif inp == 'Rainy':
  print arr[0]

Submission status: Runtime Error

Solution code:
N,M = map(int, input().split())
A = []
for X in input().split():
	x = int(X)
	A.append(x)

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

sum = 0
for x in range(len(A)):
	sum += int(A[x])

print(sum)

Submission status: Runtime Error

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

int main(int argc, char const *argv[]) {
  vector<string> wth{"Sunny", "Cloudy", "Rainy"};
  string s;
  cin >> s;

  int i = find(wth.begin(), wth.end(), s) - wth.begin();
  cout << wth[(i + 1) % 3] << endl;

  return 0;
}

Submission status: Runtime Error

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

A = Aorg

A.sort(reverse=True)

for m in range(M):
  #print(int(A[0]/2))
  A[0] = int(A[0]/2)
  if A[0]<A[1]:
    A.sort(reverse=True)

print(sum(A))

Submission status: Runtime Error

Solution code:
import sys
# input関係の定義
sys.setrecursionlimit(200000)
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def fi(): return float(input())
def mfi(): return map(float, input().rstrip().split())
def lmfi(): return list(map(float, input().rstrip().split()))
def li(): return list(input().rstrip())
def debug(*args, sep=" ", end="\n"): print("debug:", *args, file=sys.stderr, sep=sep, end=end) if not __debug__ else None
def exit(*arg): print(*arg); sys.exit()
# template

# BEGIN CUT HERE
class RollingHash():
    """ロリハ。容易に衝突するので注意。"""
    BASE1 = 1007
    BASE2 = 2009
    MOD1 = 1000000007
    MOD2 = 1000000009

    def __init__(self, s, opt=2):
        self.n = len(s)
        self.opt = opt
        self.hash1 = [0] * (self.n + 1)
        self.power1 = [1] * (self.n + 1)
        if opt == 2:  # rollinghash by 2 mod
            self.hash2 = [0] * (self.n + 1)
            self.power2 = [1] * (self.n + 1)

        for i, e in enumerate(s):
            self.hash1[i + 1] = (self.hash1[i] * self.__class__.BASE1 + ord(e)) % self.__class__.MOD1
            self.power1[i + 1] = (self.power1[i] * self.__class__.BASE1) % self.__class__.MOD1
        if opt == 2:  # rollinghash by 2 mod
            for i, e in enumerate(s):
                self.hash2[i + 1] = (self.hash2[i] * self.__class__.BASE2 + ord(e)) % self.__class__.MOD2
                self.power2[i + 1] = (self.power2[i] * self.__class__.BASE2) % self.__class__.MOD2

    def get(self, l: int, r: int):
        res1 = self.hash1[r] - self.hash1[l] * self.power1[r - l] % self.__class__.MOD1
        if(res1 < 0):
            res1 += self.__class__.MOD1
        if self.opt == 2:
            res2 = self.hash2[r] - self.hash2[l] * self.power2[r - l] % self.__class__.MOD2
            if(res2 < 0):
                res2 += self.__class__.MOD2
        return (res1, res2) if self.opt == 2 else res1
# END CUT HERE

def ABC131E():
    N = ii()
    S = li()
    rh = RollingHash(S, opt=1)
    def check(n: int):
        d = dict()
        for i in range(N - n + 1):
            p = rh.get(i, i + n)
            if p in d:
                if(i - d[p] >= n):
                    return True
            else:
                d[p] = i
        return False
    ok, ng = 0, N // 2 + 1
    while ng - ok > 1:
        mid = (ok + ng) // 2
        if check(mid):
            ok = mid
        else:
            ng = mid
    print(ok)



if __name__ == '__main__':
    ABC131E()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# 天気の入力
s = int(input())
# 出力
lis = ['Sunny', 'Cloudy', 'Rainy']
index = lis.index(s)
index = (index+1)%len(lis)
print(lis[index])

Submission status: Runtime Error

Solution code:
N, K, Q = [int(x) for x in input().split(' ')]
points = [0 for x in range(N)]

for q in range(Q):
  index = int(input())-1
  points[index] += 1

for n in range(N):
  print('Yes' if (Q-points[n]) < K else 'No')

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    d = {"Sunny":1 , "Cloudy":2, "Rainy":0}
    a = ["Sunny", "Cloudy", "Rainy"]
    print(a[d[input()]])
    return

#B
def B():
    s = S()
    for i, si in enumerate(s):
        if i % 2:
            if si == "R":
                print("No")
                return
        else:
            if si == "L":
                print("No")
                return
    print("Yes")
    return

#C
def C():
    n, k, q = LI()
    d = [0] * n
    for _ in range(q):
        a = II() - 1
        d[a] += 1
    for a in d:
        if k - (q - a) > 0:
            print("Yes")
        else:
            print("No")
    return

#D
def D():
    n, = LI()
    a = LI()
    q = []
    for ai in a:
        heappush(q, ai)
    for _ in range(m):
        heappush(q, heappop(q) / 2)
    ans = 0
    while q:
        ans += int(heappop(q))
    print(ans)
    return

#E
def E():
    return

#F
def F():
    return

#Solve
if __name__ == '__main__':
    A()

Submission status: Runtime Error

Solution code:
s = list(input())
if s[0] = "R":
  print("Sunny")
elif s[0] = "S":
  print("Cloudy")
else:
  print("Rainy")

Submission status: Runtime Error

Solution code:
#atcoder beginner contest 141

weather = input("")

if weather == "Sunny":
    print("Cloudy")
elif weather == "Cloudy":
    prinnt("Rainy")
elif weather == "Rainy":
    print("Sunny")

Submission status: Runtime Error

Solution code:
L=list(map(int,input().split()))
N=L[0]
K=L[1]
Q=L[2]
point=[K-Q]*N
for i in range(Q):
  ans=int(input())
  point[ans-1]+=1
for i in range(N):
  if point[i]>0 :
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

Solution code:
#coding:utf-8

import sys

N = int(input())
S = input()

T = len(S)

for t in reversed(range(T+1)):
    i = 0
    while 0 < len(S[i:i+t-1]) and len(S[i:i+t-1]) <= len(S[i+t-1:]):
        if S[i:i+t-1] in S[i+t-1:]:
            print(len(S[i:i+t-1]))
            sys.exit()
        i += 1
print('0')

Submission status: Runtime Error

Solution code:
s=input()

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

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

Submission status: Runtime Error

Solution code:
I = input()
I = I.split(" ")
N = I[0]
K = I[1]
Q = I[2]

A = [0]*Q

for i in range(Q):
	A[i] = int(input())

point = [0]*N

for i in range(Q):
	point[A[i]-1] = point[A[i]-1] + 1

for i in range(Q):
	if point[i] > 0:
		print("yes")
	else:
		print("no")