TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: There are N people standing in a queue from west to east.  Given is a string S of length N representing the directions of the people. The i-th person from the west is facing west if the i-th character of S is `L`, and east if that character of S is `R`.  A person is happy if the person in front of him/her is facing the same direction. If no person is standing in front of a person, however, he/she is not happy.  You can perform the following operation any number of times between 0 and K (inclusive):  Operation: Choose integers l and r such that 1 \leq l \leq r \leq N, and rotate by 180 degrees the part of the queue: the l-th, (l+1)-th, ..., r-th persons. That is, for each i = 0, 1, ..., r-l, the (l + i)-th person from the west will stand the (r - i)-th from the west after the operation, facing east if he/she is facing west now, and vice versa.  What is the maximum possible number of happy people you can have?

Submission attempts (in order):
n, k = map(int, input().split())
s = input()
pre = s[0]
rsans = s[0]
first = s[0]

if s[0] == "R":
    second = "L"
else:
    second = "R"

for i in s[1:]:
    if i == second and k > 0:
        ans = ans + first
        pre = i
    elif i == first and pre == second:
        k -= 1
        ans = ans + i
        pre = i
    elif k == 0:
        ans = ans + i
    elif i == first and pre == first:
        ans = ans + i

pre = "0"
cnt = 0

for i in ans:
    if i == pre:
        cnt += 1
    pre = i

print(cnt)

n, k = map(int, input().split())
s = input()
pre = s[0]
rs = s[0]
first = s[0]

if s[0] == "R":
    second = "L"
else:
    second = "R"

for i in s[1:]:
    if i == second and k > 0:
        rs = rs + first
        pre = i
    elif i == first and pre == second:
        k -= 1
        rs = rs + i
        pre = i
    elif k == 0:
        rs = rs + i
    elif i == first and pre == first:
        rs = rs + i

pre = "0"
ans = 0

for i in rs:
    if i == pre:
        ans += 1
    pre = i

print(ans)

Verdicts: Runtime Error

Accepted
Problem: Given is a permutation P of \\{1, 2, \ldots, N\\}.  For a pair (L, R) (1 \le L \lt R \le N), let X_{L, R} be the second largest value among P_L, P_{L+1}, \ldots, P_R.  Find \displaystyle \sum_{L=1}^{N-1} \sum_{R=L+1}^{N} X_{L,R}.

Submission attempts (in order):
N = int(input())
P = list(map(int, input().split()))
 
left_bigger  = [0] + [i for i in range(N+1)]
right_bigger = [i+1 for i in range(N+1)] + [N+1]
 
E = [(v, i+1) for i, v in enumerate(P)]
E.sort()

ans = 0
for v,i in E:
    l0=left_bigger[i]
    l1=left_bigger[l0]
    r0=right_bigger[i]
    r1=right_bigger[r0]
    print(left_bigger)
    ans += ((r1-r0)*(i-l0) + (r0-i)*(l0-l1))*v
    left_bigger[r0]=l0
    right_bigger[l0]=r0
print(ans)




N = int(input())
P = list(map(int, input().split()))
 
left_bigger  = [0] + [i for i in range(N+1)]
right_bigger = [i+1 for i in range(N+1)] + [N+1]
 
E = [(v, i+1) for i, v in enumerate(P)]
E.sort()

ans = 0
for v,i in E:
    l0=left_bigger[i]
    l1=left_bigger[l0]
    r0=right_bigger[i]
    r1=right_bigger[r0]
    ans += ((r1-r0)*(i-l0) + (r0-i)*(l0-l1))*v
    left_bigger[r0]=l0
    right_bigger[l0]=r0
print(ans)




Verdicts: Runtime Error

Accepted
Problem: Given is a permutation P of \\{1, 2, \ldots, N\\}.  For a pair (L, R) (1 \le L \lt R \le N), let X_{L, R} be the second largest value among P_L, P_{L+1}, \ldots, P_R.  Find \displaystyle \sum_{L=1}^{N-1} \sum_{R=L+1}^{N} X_{L,R}.

Submission attempts (in order):
N = int(input())
P = list(map(int, input().split()))

index_lst = [0] * N
for index, i in enumerate(P):
    index_lst[i - 1] = index

left_next_Index = list(range(-1, N - 1)) + [-1]
right_next_Index = list(range(1, N + 1)) + [N]
# print (left_next_Index)
# print (right_next_Index)
ans = 0
for i in range(1, N):
    index = index_lst[i - 1]
    # print (i, index)
    l1 = left_next_Index[index]
    l2 = left_next_Index[l1]
    r1 = right_next_Index[index]
    r2 = right_next_Index[r1]
    # print ('l1 =', l1, ' l2 =', l2, ' r1 =', r1, ' r2 =', r2)
    ans += i * ((index - l1) * (r2 - r1) + (r1 - index) * (l1 -l2))

    left_next_Index[r1] = l1
    right_next_Index[l1] = r1

print (ans)

N = int(input())
P = list(map(int, input().split()))

index_lst = [0] * N
for index, i in enumerate(P):
    index_lst[i - 1] = index

left_next_Index = list(range(-1, N - 1)) + [-1, -1]
right_next_Index = list(range(1, N + 1)) + [N, N]
# print (left_next_Index)
# print (right_next_Index)
ans = 0
for i in range(1, N):
    index = index_lst[i - 1]
    # print (i, index)
    l1 = left_next_Index[index]
    l2 = left_next_Index[l1]
    r1 = right_next_Index[index]
    r2 = right_next_Index[r1]
    # print ('l1 =', l1, ' l2 =', l2, ' r1 =', r1, ' r2 =', r2)
    ans += i * ((index - l1) * (r2 - r1) + (r1 - index) * (l1 -l2))

    left_next_Index[r1] = l1
    right_next_Index[l1] = r1

print (ans)

Verdicts: Wrong Answer

Accepted
Problem: Given is a permutation P of \\{1, 2, \ldots, N\\}.  For a pair (L, R) (1 \le L \lt R \le N), let X_{L, R} be the second largest value among P_L, P_{L+1}, \ldots, P_R.  Find \displaystyle \sum_{L=1}^{N-1} \sum_{R=L+1}^{N} X_{L,R}.

Submission attempts (in order):
import bisect
N = int(input())
P = map(int, input().split())
P_id = [0]*(N + 1)

for i in range(N):
    P_id[P[i]] = i

A = [- 1, P_id[N], N] 

res = 0
for i in range(N - 1, 0, - 1):
    j = bisect.bisect_left(A, P_id[i])
    A.insert(j, P_id[i])
    l1 = A[j - 1]
    r1 = A[j + 1]
    l2 = l1
    r2 = r1
    if l1 != - 1:
        l2 = A[j - 2]
    if r1 != N:
        r2 = A[j + 2]
    
    res += i*((A[j] - l1)*(r2 - r1) + (l1 - l2)*(r1 - A[j]))

print(res)

N = int(input())
P_id = [0]*(N + 1) 
for index, p in enumerate(map(int, input().split())):
    P_id[p] = index

left_next_index = list(range(- 1, N - 1)) + ['うんこ', - 1] 
right_next_index = list(range(1, N + 1)) + [N, 'うんこ']

res = 0
for p in range(1, N):
    l1 = left_next_index[P_id[p]]
    l2 = left_next_index[l1]
    r1 = right_next_index[P_id[p]]
    r2 = right_next_index[r1]
    
    res += p*((l1 - l2)*(r1 - P_id[p]) + (P_id[p] - l1)*(r2 - r1))
    
    left_next_index[r1] = l1
    right_next_index[l1] = r1
    
print(res)

Verdicts: Runtime Error

Accepted
Problem: Given is a permutation P of \\{1, 2, \ldots, N\\}.  For a pair (L, R) (1 \le L \lt R \le N), let X_{L, R} be the second largest value among P_L, P_{L+1}, \ldots, P_R.  Find \displaystyle \sum_{L=1}^{N-1} \sum_{R=L+1}^{N} X_{L,R}.

Submission attempts (in order):
class B():
    def __init__(self,N):
        self.N = N
        self.node = [0]*(self.N+1)
        self.cnt = 0

    def add(self,x): 
        self.cnt += 1
        while x <= self.N:
            self.node[x] += 1
            x += x & -x

    def delete(self,x): 
        self.cnt -= 1
        while x <= self.N:
            self.node[x] -= 1
            x += x & -x

    def count(self,x): 
        tmp = 0
        while x > 0:
            tmp += self.node[x]
            x -= x & -x
        return tmp

    def get_max(self):
        return self.get_ith(self.cnt)

    def get_ith(self,i): 
        NG = -1
        OK = self.N+1
        while OK-NG > 1:
            mid = (OK+NG)//2
            #print(OK,NG,self.count(mid))
            if self.count(mid) >= i:
                OK = mid
            else:
                NG = mid
        return OK

    def search_low(self,x): 
        xcn = self.count(x)
        NG = -1
        OK = x
        while OK-NG > 1:
            mid = (OK+NG)//2
            #print(OK,NG,self.count(mid))
            if self.count(mid) >= xcn:
                OK = mid
            else:
                NG = mid
        return OK

    def search_high(self,x): 
        xcn = self.count(x)
        NG = x
        OK = self.N + 1
        while OK-NG > 1:
            mid = (OK+NG)//2
            #print(OK,NG,self.count(mid))
            if self.count(mid) > xcn:
                OK = mid
            else:
                NG = mid
        return OK

import sys

stdin = sys.stdin

ni = lambda: int(ns())
nl = lambda: list(map(int, stdin.readline().split()))
nm = lambda: map(int, stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
p = nl()
q = [0]*(n+1)
for i in range(n):
    q[p[i]] = i+1
ans = 0
b = B(n)
b.add(q[-1])
for i in range(n-1,0,-1):
  v = q[i]
  l1 = b.search_low(v)
  r1 = b.search_high(v)
  l2 = b.search_low(l1)
  r2 = b.search_high(r1)
  ans += i*((r1-v)*(l1-l2) + (v-l1)*(r2-r1))
  b.add(v)
print(ans)

import sys

stdin = sys.stdin

ni = lambda: int(ns())
nl = lambda: list(map(int, stdin.readline().split()))
nm = lambda: map(int, stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
p = nl()
q = [0]*(n+1)
for i in range(n):
    q[p[i]] = i+1
    
ans = 0
l = [0] + [i for i in range(n+1)]
r = [i+1 for i in range(n+1)] + [n+1]

for i in range(1,n+1):
    v = q[i]
    l1,r1 = l[v],r[v]
    l2,r2 = l[l1],r[r1]
    ans += i*((v-l1)*(r2-r1) + (r1-v)*(l1-l2))
    l[r1] = l1
    r[l1] = r1
  
print(ans)


Verdicts: Runtime Error

Accepted
Problem: Given is a permutation P of \\{1, 2, \ldots, N\\}.  For a pair (L, R) (1 \le L \lt R \le N), let X_{L, R} be the second largest value among P_L, P_{L+1}, \ldots, P_R.  Find \displaystyle \sum_{L=1}^{N-1} \sum_{R=L+1}^{N} X_{L,R}.

Submission attempts (in order):
import numpy as np

n = int(input())
p = list(map(int,input().split()))
q = [(v,i) for i,v in enumerate(p)]
q.sort(reverse=True)
print(q)
flg = [-1,-1,n,n]
ans = 0

for v,i in q:
    print("(v,i)=({},{})".format(v,i))
    if not flg:
        flg.append(i)
        print(flg)
        continue
    else:
        flg_arr = np.array(flg)
        flg_low = flg_arr[flg_arr<i]
        print("flg_low:{}".format(flg_low))
        flg_upp = flg_arr[flg_arr>i]
        print("flg_upp:{}".format(flg_upp))

        # if (flg_low.size >= 2) and (flg_upp.size >= 2):
        ans += v*(  (flg_low[-1]-flg_low[-2])*(flg_upp[0]-i)+
                    (flg_upp[1]-flg_upp[0])*(i-flg_low[-1]))
        # elif flg_low.size >= 2 and

        flg = list(flg_arr)
        flg.append(i)
        flg.sort()
        print(flg)
print(ans)


#!/usr/bin/env python3
N=int(input())
p=list(map(int,input().split()))
LL = [0] + [i for i in range(N+1)]
RR = [i+1 for i in range(N+1)] + [N+1]
E = [(v, i+1) for i, v in enumerate(p)]
E.sort()
ans=0
for v, i in E:
  r0 = RR[i]
  r1 = RR[r0]
  l0 = LL[i]
  l1 = LL[l0]
  RR[l0] = r0
  LL[r0] = l0

  ans += ((r1 - r0)*(i-l0)+(r0-i)*(l0 - l1))*v

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Given is a permutation P of \\{1, 2, \ldots, N\\}.  For a pair (L, R) (1 \le L \lt R \le N), let X_{L, R} be the second largest value among P_L, P_{L+1}, \ldots, P_R.  Find \displaystyle \sum_{L=1}^{N-1} \sum_{R=L+1}^{N} X_{L,R}.

Submission attempts (in order):
#!/usr/bin/env python3
ans=0
n=int(input())
p=list(map(int,input().split()))
b=[0]*(n+1)
for i in range(n):
    b[p[i]]=i+1
LL=[0]+[i for i in range(n+1)]
RR=[i for i in range(n+1)]+[n+1]
for i in range(1,n+1):
    l1=LL[b[i]]
    l0=LL[l1]
    r0=RR[b[i]]
    r1=RR[r0]
    ans+=((l1-l0)*(r1-b[i])+(r1-r0)*(b[i]-l1))*i
print(ans)


#!/usr/bin/env python3
ans=0
n=int(input())
p=list(map(int,input().split()))
b=[0]*(n+1)
for i in range(n):
    b[p[i]]=i+1
LL=[0]+[i for i in range(n+1)]
RR=[i for i in range(1,n+2)]+[n+1]
for i in range(1,n+1):
    l1=LL[b[i]]
    l0=LL[l1]
    r0=RR[b[i]]
    r1=RR[r0]
    ans+=((l1-l0)*(r0-b[i])+(r1-r0)*(b[i]-l1))*i
    LL[r0]=l1
    RR[l1]=r0

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Given is a permutation P of \\{1, 2, \ldots, N\\}.  For a pair (L, R) (1 \le L \lt R \le N), let X_{L, R} be the second largest value among P_L, P_{L+1}, \ldots, P_R.  Find \displaystyle \sum_{L=1}^{N-1} \sum_{R=L+1}^{N} X_{L,R}.

Submission attempts (in order):
#n = int(input())

n = 10000
ListP = [i for i in range(n)]
points = 0
ListPos2 = [0] * (n + 1)
for i, a in enumerate(ListP):
	ListPos2[a] = i + 1
ListPos = [0, 0] + [ListPos2[n]] + [n+1, n+1]

ListTPos = [0] * (n + 1) + [n+1]
ListTPos[ListPos2[n]] = ListPos2[n]
pos = 0
for i in reversed(range(1,n)):
	posi = ListPos2[i]
	ListTPos[posi] =  posi
	for j in ListTPos[posi+1:]:
		if (j > 0):
			pos = ListPos.index(j)
			ListPos.insert(pos, posi)
			
			break
	l1 = ListPos[pos-1]
	l2 = ListPos[pos-2]
	h1 = ListPos[pos+1]
	h2 = ListPos[pos+2]
	points += i * ((posi-l1)*(h2-h1) + (h1-posi)*(l1-l2))
	#low1 = ListPos[pos] - ListPos[pos-1]
	#low2 = ListPos[pos-1] - ListPos[pos-2]
	#high1 = ListPos[pos+1] - ListPos[pos]
	#high2 = ListPos[pos+2] - ListPos[pos+1]
	
	#print(i, ListPos)
	#print(points, low1, high2, high1, low2)
print(points)

n = int(input())
p = [int(i) for i in input().split()]

pos_list = [0] * n
for ind, i in enumerate(p):
	pos_list[i-1] = ind

left_nextInd = list(range(-1, n-1)) + [-1, -1]
right_nextInd = list(range(1, n+1)) + [n, n]

answer = 0
for i in range(1, n):
	ind = pos_list[i-1]
	l1 = left_nextInd[ind]
	l2 = left_nextInd[l1]
	r1 = right_nextInd[ind]
	r2 = right_nextInd[r1]

	answer += i * ((ind-l1) * (r2-r1) + (r1-ind) * (l1-l2))

	left_nextInd[r1] = l1
	right_nextInd[l1] = r1
print(answer)

Verdicts: Wrong Answer

Accepted
Problem: We have one slime.  You can set the _health_ of this slime to any integer value of your choice.  A slime reproduces every second by spawning another slime that has strictly less health. You can freely choose the health of each new slime. The first reproduction of our slime will happen in one second.  Determine if it is possible to set the healths of our first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals a multiset S.  Here S is a multiset containing 2^N (possibly duplicated) integers: S_1,~S_2,~...,~S_{2^N}.

Submission attempts (in order):
from collections import Counter
n = int(input())
a = [int(item) for item in input().split()]
cnt = Counter(a)

t = 1
used = 0
initialized = False
for c in range(2**18, 0, -1):
    if c in cnt.keys():
        print(c, t, used)
        if not initialized:
            if cnt[c] > 1:
                print("No")
                exit()
            initialized = True
        if cnt[c] > t:
            print("No")
            exit()
        t = (used + 1) * n - used
        used += cnt[c]
print("Yes")

from collections import Counter
n = int(input())
a = [int(item) for item in input().split()]
cnt = Counter(a)

key_num = len(cnt.keys())
rank = [0] * key_num 
keys = list(cnt.keys())
keys.sort(reverse=True)
for i, key in enumerate(keys):
    rank[i] = cnt[key]
cur = [0] * key_num 
cur[0] = 1
for i in range(n):
    tmp = cur[:]
    free = 0
    for j in range(key_num):
        if rank[j] > cur[j] and free > 0:
            if cur[j] + free > rank[j]:
                free -= rank[j] - cur[j]
                cur[j] = rank[j]
            else:
                cur[j] += free
                free = 0
        free += tmp[j] 
if sum(cur) == 2**n:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: We have one slime.  You can set the _health_ of this slime to any integer value of your choice.  A slime reproduces every second by spawning another slime that has strictly less health. You can freely choose the health of each new slime. The first reproduction of our slime will happen in one second.  Determine if it is possible to set the healths of our first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals a multiset S.  Here S is a multiset containing 2^N (possibly duplicated) integers: S_1,~S_2,~...,~S_{2^N}.

Submission attempts (in order):
N = int(input())
S = list(map(int, input().split()))

S.sort()

parent = [S.pop()]
rest = S
for _ in range(N):
	n_parent = []
	n_rest = []

	for p in parent[::-1]:
		while rest:
			x = rest.pop()
			if x < p:
				n_parent.append(x)
				break
			else:
				n_rest.append(x)
	parent += n_parent
	parent.sort()
	rest = rest + n_rest[::-1]

if len(parent) == (2**N):
	pritn("Yes")
else:
	print('No')



N = int(input())
S = list(map(int, input().split()))

S.sort()

parent = [S.pop()]
rest = S
for _ in range(N):
	n_parent = []
	n_rest = []

	for p in parent[::-1]:
		while rest:
			x = rest.pop()
			if x < p:
				next_parent.append(x)
				break
			else:
				next_rest.append(x)
	parent += next_parent
	parent.sort()
	rest = rest + next_rest[::-1]

if len(parent) == (2**N):
	pritn("Yes")
else:
	print('No')



N = int(input())
S = list(map(int, input().split()))

S.sort()

parent = [S.pop()]
rest = S
for _ in range(N):
	n_parent = []
	n_rest = []

	for p in parent[::-1]:
		while rest:
			x = rest.pop()
			if x < p:
				n_parent.append(x)
				break
			else:
				n_rest.append(x)
	parent += n_parent
	parent.sort()
	rest = rest + n_rest[::-1]

if len(parent) == (2**N):
	print("Yes")
else:
	print('No')



Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have one slime.  You can set the _health_ of this slime to any integer value of your choice.  A slime reproduces every second by spawning another slime that has strictly less health. You can freely choose the health of each new slime. The first reproduction of our slime will happen in one second.  Determine if it is possible to set the healths of our first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals a multiset S.  Here S is a multiset containing 2^N (possibly duplicated) integers: S_1,~S_2,~...,~S_{2^N}.

Submission attempts (in order):
#!/usr/bin/env python3
n = int(input())
a = list(map(int, input().split()))
a.sort()
parent = [a[-1]]
rest = a[:-1]

for _ in range(n):
    next_parent = []
    next_rest = []
    print(parent)
    for i in parent:
        while(rest):
            x = rest.pop()
            if x < i:
                next_parent.append(x)
                break
            else:
                next_rest.append(x)
                continue
    parent = next_parent + parent
    next_rest.reverse()
    rest += next_rest

if len(parent) == 2**n:
    print("Yes")
else:
    print("No") 


#!/usr/bin/env python3
n = int(input())
a = list(map(int, input().split()))
a.sort()
parent = [a[-1]]
rest = a[:-1]

for _ in range(n):
    next_parent = []
    next_rest = []
    for i in parent[::-1]:
        while(rest):
            x = rest.pop()
            if x < i:
                next_parent.append(x)
                break
            else:
                next_rest.append(x)
                continue
    parent += next_parent
    parent.sort()
    next_rest.reverse()
    rest += next_rest

if len(parent) == 2**n:
    print("Yes")
else:
    print("No") 


Verdicts: Wrong Answer

Accepted
Problem: We have one slime.  You can set the _health_ of this slime to any integer value of your choice.  A slime reproduces every second by spawning another slime that has strictly less health. You can freely choose the health of each new slime. The first reproduction of our slime will happen in one second.  Determine if it is possible to set the healths of our first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals a multiset S.  Here S is a multiset containing 2^N (possibly duplicated) integers: S_1,~S_2,~...,~S_{2^N}.

Submission attempts (in order):
N=int(input())
S=list(map(int,input().split()))
S.sort(reverse=True)
p = [S.pop(0)]
c = S
f = True

for i in range(N):
    np = []
    nc = []
    for p_ in p:
        for k in range(len(c)):
            if c[k] < p_:
                np.append(c.pop(k))
                break
        f = False
    p += np
    p.sort(reverse=True)

print("Yes" if f else "No")

N=int(input())
S=list(map(int,input().split()))
S.sort()
S.reverse()
print(S)
p = [S.pop(0)]
c = S
f = False

for i in range(N):
    np = []
    nc = []
    for j in range(len(p)):
        for k in range(len(c)):
            if c[k] < p[j]:
                np.append(c.pop(k))
                f = True
                break
        if f == False:
            print("No")
            exit(0)
        f = False
    print(np)
    p += np
    p.sort()
    p.reverse()

print("Yes")

N=int(input())
S=list(map(int,input().split()))
S.sort()
p = [S.pop(0)]
r = S

for i in range(N):
    for p_ in p[::-1]:
        for k in range(len(r)):
            if r[k] < p_:
                p.append(r.pop(k))
                break
    p.sort()

print("Yes" if len(r)==0 else "No")

N=int(input())
S=list(map(int,input().split()))
S.sort()
p=[S.pop(-1)]
r=S

for i in range(N):
    nr=[]
    for p_ in p[::-1]:
        while r:
            nr.append(r.pop())
            if nr[-1]<p_:
                p.append(nr[-1])
                break
    p.sort()
    r+=nr[::-1]

print("Yes" if len(r)==0 else "No")

N=int(input())
S=list(map(int,input().split()))
S.sort()
p=S[-1:]
r=S[:-1]
for i in range(N):
    nr=[]
    for p_ in p[::-1]:
        while r:
            r_=r.pop()
            if r_<p_:
                p.append(r_)
                break
            nr.append(r_)
    p.sort()
    r+=nr[::-1]
print("Yes" if len(r)==0 else "No")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have one slime.  You can set the _health_ of this slime to any integer value of your choice.  A slime reproduces every second by spawning another slime that has strictly less health. You can freely choose the health of each new slime. The first reproduction of our slime will happen in one second.  Determine if it is possible to set the healths of our first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals a multiset S.  Here S is a multiset containing 2^N (possibly duplicated) integers: S_1,~S_2,~...,~S_{2^N}.

Submission attempts (in order):
import sys
import collections

def main():
    N,*S = map(int, open(0).read().split())

    S = sorted(S)

    g = [S.pop(-1)]

    for _ in range(N):
        g = sorted(g,reverse=True)
        parents = g[:]
        for p in parents:
            for si, s in enumerate(S[::-1]):
                if p > s:
                    g.append(s)
                    del S[-si]
                    break;
            else:
                print('No')
                sys.exit()
    print('Yes')

if __name__=='__main__':
    main()

import sys

def main():
    N,*S = map(int, open(0).read().split())
    S = sorted(S)

    g = [S.pop(-1)]

    for gen in range(N):
        tmp = []
        for p in g[:2**gen]:
            while S:
                s = S.pop(-1)
                if p > s:
                    g.append(s)
                    break
                else:
                    tmp.append(s)
            else:
                print('No')
                sys.exit()
        S.extend(tmp[::-1])
        g.sort(reverse=True)
    print('Yes')

if __name__=='__main__':
    main()

Verdicts: Wrong Answer

Accepted
Problem: We have one slime.  You can set the _health_ of this slime to any integer value of your choice.  A slime reproduces every second by spawning another slime that has strictly less health. You can freely choose the health of each new slime. The first reproduction of our slime will happen in one second.  Determine if it is possible to set the healths of our first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals a multiset S.  Here S is a multiset containing 2^N (possibly duplicated) integers: S_1,~S_2,~...,~S_{2^N}.

Submission attempts (in order):
n = int(input())
a = [int(i) for i in input().split()]
a.sort()

big = [a[n-1]]
rest = a[:-1]

for _ in range(n):
    nr = []
    for b in big[::-1]:
        while rest:
            r = rest.pop()
            if r < b:
                big.append(r)
                break
            nr.append(r)
    big.sort()
    rest += nr[::-1]
print("Yes" if len(rest)==0 else "No")
            

n = int(input())
a = [int(i) for i in input().split()]
a.sort()

big =  [a[-1]]
rest = a[:-1]


for i in range(n):
    not_yet = []
    count = 0
    for b in big:
        if count==2**i:
            break
        while rest:
            r = rest.pop()
            if r < b:
                big.append(r)
                count += 1
                break
            not_yet.append(r)
    big.sort(reverse=True)
    rest += not_yet[::-1]
print("Yes" if len(rest)==0 else "No")

Verdicts: Wrong Answer

Accepted
Problem: We have one slime.  You can set the _health_ of this slime to any integer value of your choice.  A slime reproduces every second by spawning another slime that has strictly less health. You can freely choose the health of each new slime. The first reproduction of our slime will happen in one second.  Determine if it is possible to set the healths of our first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals a multiset S.  Here S is a multiset containing 2^N (possibly duplicated) integers: S_1,~S_2,~...,~S_{2^N}.

Submission attempts (in order):
def f_f():
    n = int(input())
    *s, = map(int, input().split())
    s.sort()
    p1, p2 = [s[-1]], []
    s[-1] = -1
    o = "Yes"
    for _ in range(n):
        j = len(s)
        while j>-1 and p1:
            j -= 1
            if s[j]<0:
                pass
            elif p1[-1]>s[j]:
                p2 += [s[j], p1.pop()]
                s[j] = -1
                j = len(s)
        print(s)        
        if p1:
            o="No"
            break
        p1, p2 = sorted(p2), []
    print(o)

if __name__ == "__main__":
    f_f()



def f_f():
    n, *s = map(int, open(0).read().split())
    s.sort()
    ps, next_ps, cs = [s.pop()], [], []
    for _ in range(n):
        for p in ps:
            while s:
                c = s.pop()
                if p>c:
                    next_ps.append(c)
                    break
                else:
                    cs.append(c)
        s, ps, next_ps, cs = s+cs[::-1], sorted(ps+next_ps, reverse=True), [], []

    print("No" if s else "Yes")

if __name__ == "__main__":
    f_f()


Verdicts: Wrong Answer

Accepted
Problem: We have one slime.  You can set the _health_ of this slime to any integer value of your choice.  A slime reproduces every second by spawning another slime that has strictly less health. You can freely choose the health of each new slime. The first reproduction of our slime will happen in one second.  Determine if it is possible to set the healths of our first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals a multiset S.  Here S is a multiset containing 2^N (possibly duplicated) integers: S_1,~S_2,~...,~S_{2^N}.

Submission attempts (in order):
import math
def cmb(n,r):
  return math.factorial(n)//(math.factorial(r)*math.factorial(n-r))
n=int(input())
a=list(map(int,input().split()))
a.sort()
print(*a)
ls=[0]
cnt=0
for i in range(1,2**n):
  if a[i]>a[i-1]:
    cnt+=1
  ls.append(cnt)
lmt = []
for i in range(n+1):
  lmt.extend([i]*cmb(n,i))
bias = ls[-1]-lmt[-1]
for x,l in zip(ls,lmt):
  if x-l > bias:
    print("No")
    break
else:
  print("Yes")

import math
def cmb(n,r):
  return math.factorial(n)//(math.factorial(r)*math.factorial(n-r))
n=int(input())
a=list(map(int,input().split()))
a.sort()
ls=[0]
cnt=0
for i in range(1,2**n):
  if a[i]>a[i-1]:
    cnt+=1
  ls.append(cnt)
lmt = []
for i in range(n+1):
  lmt.extend([i]*cmb(n,i))
bias = ls[-1]-lmt[-1]
jdg = 0
ulmt = 0
for i in range(n):
  jdg += ls.count(i)
  ulmt += 2**(n-i-1)
  if jdg > ulmt:
    print("No")
    exit()
for x,l in zip(ls,lmt):
  if x-l > bias:
    print("No")
    break
else:
  print("Yes")

Verdicts: Wrong Answer

Accepted
Problem: We have one slime.  You can set the _health_ of this slime to any integer value of your choice.  A slime reproduces every second by spawning another slime that has strictly less health. You can freely choose the health of each new slime. The first reproduction of our slime will happen in one second.  Determine if it is possible to set the healths of our first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals a multiset S.  Here S is a multiset containing 2^N (possibly duplicated) integers: S_1,~S_2,~...,~S_{2^N}.

Submission attempts (in order):
N = int(input())
S = list(map(int, input().split()))
S.sort(reverse=True)

n = [0] * (2**N)
n[0] = N
_n = N-2
for i in range(1, 2**N):
  nn = n[i-1] - 1
  if nn >= 0:
    n[i] = nn
  else:
    n[i] = _n
    _n -= 1
    if _n < 0:
      n[i+1] = 1
      break


par = 0
idx = 1
res = True
while idx < 2**N:
  for i in range(n[par]):
    res *= S[par] > S[idx]
    if not res:
      print('No')
      quit()
    idx += 1
  par += 1

print(n)
print('Yes')

N = int(input())
N2 = 2**N
S = list(map(int, input().split()))
S.sort(reverse=True)

slimes = [S[0]]
S[0] = float('inf')
num = 1
min_idx = 1
for i in range(N):
  slimes.sort()
  n = num
  idx = min_idx
  is_continuous = True
  while n and idx<=N2-1:
    if S[idx] < slimes[n-1]:
      slimes.append(S[idx])
      S[idx] = float('inf')
      idx += 1
      n -= 1
      min_idx += is_continuous:
    else:
      if S[idx] < float('inf'):
        is_continuous = False
      idx += 1
      min_idx += is_continuous
  
  if n:
    print('No')
    quit()
  
  num *= 2

print('Yes')

N = int(input())
N2 = 2**N
S = list(map(int, input().split()))
S.sort(reverse=True)

slimes = [S[0]]
INF = S[0] + 1
S[0] = INF
num = 1
min_idx = 1
for i in range(N):
  slimes.sort()
  n = num
  idx = min_idx
  is_continuous = True
  while n and idx<=N2-1:
    if S[idx] < slimes[n-1]:
      slimes.append(S[idx])
      S[idx] = INF
      idx += 1
      n -= 1
      min_idx += is_continuous
    else:
      if S[idx] < INF:
        is_continuous = False
      idx += 1
      min_idx += is_continuous
  
  if n:
    print('No')
    quit()
  
  num *= 2

print('Yes')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
n = int(input())

ans = n*(n-1)//2
print(ans)

s = input()
t = input()

c=0
for i in range(3):
    if s[i]==t[i]:
        c+= 1
print(c)

Verdicts: Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
s1=input()
s2=input()
c=0
for i in range(3):
  for j in range(3):
    if s1[i]==s2[j]:
      c+=1
print(c)


s1=input()
s2=input()
c=0
for i,j in zip(range(3),range(3)):
    if s1[i]==s2[j]:
      c+=1
print(c)

Verdicts: Wrong Answer

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
S = input()
T = input()

print(sum([s == t for s, t in zip(S, T)])

S = input()
T = input()

print(sum([s == t for s, t in zip(S, T)]))


Verdicts: Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
A_B = input().split()
print(int(A_B[1])//(int(A_B[0])-1))

A_B = input().split()
print((int(A_B[1])-1)//(int(A_B[0])-1))

A_B = input().split()
print(-(-(int(A_B[1])-1)//int(A_B[0])))


A_B = input().split()
print((int(A_B[1])-1)//(int(A_B[0])-1))

A_B = input().split()
print((int(A_B[1])-1)//(int(A_B[0])-1))


S = input().split(" ")

L = input().split(" ")


S1 = S[0]
S2 = S[1]
S3 = S[2]
L1 = L[0]
L2 = L[1]
L3 = L[2]


if S1 == L1 and S2 == L2  S3 == L3:
  print(3)

elif S1 != L1 and S2 != L2  S3 != L3:
  print(0)

elif (S1 == L1 and S2 != L2  S3 != L3) or (S1 != L1 and S2 == L2  S3 != L3) or (S1 != L1 and S2 != L2  S3 == L3):
  print(1)

else:
  print(2)
end


S = list(input())

L = list(input())
 

S1 = S[0]
S2 = S[1]
S3 = S[2]
L1 = L[0]
L2 = L[1]
L3 = L[2]
 

if S1 == L1 and S2 == L2 and S3 == L3:
  print(3)

elif S1 != L1 and S2 != L2 and S3 != L3:
  print(0)

elif (S1 == L1 and S2 != L2 and S3 != L3) or (S1 != L1 and S2 == L2 and S3 != L3) or (S1 != L1 and S2 != L2 and S3 == L3):
  print(1)

else:
  print(2)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
a,b = map(int, input().split())
i=1
sum = a
if sum<=b:
	while sum<=b:
		sum+=a-1
		i+=1
print(i)


s = input()
t = input()
ans  =0
for i in range(3):
	if s[i]==t[i]:
		ans += 1
print(ans)

Verdicts: Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
s = input()
t = input()

ans = 0
for i in range(3):
    if s[i]==t[i]:
        ans+=1
    i+=
print(ans)

s = input()
t = input()

ans = 0
for i in range(3):
    if s[i]==t[i]:
        ans+=1
    i+=1
print(ans)

Verdicts: Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
S = list(input())
T = list(input())
ans = 0

for i in range(3):
  if S[i] = T[i]:
    ans += 1

print(ans)

S = list(input())
T = list(input())
ans = 0

for i in range(3):
  if S[i] == T[i]:
    ans += 1

print(ans)

Verdicts: Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
s = str(input())
t = str(input())
p = 0
res = 0
for a in s:
  if a == s[p]:
    res = res + 1
  p = p + 1
print(res)
  

s = str(input())
t = str(input())
p = 0
res = 0
for a in s:
  if a == t[p]:
    res = res + 1
  p = p + 1
print(res)
  

Verdicts: Wrong Answer

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
A,B=map(int(input().split())
c=A
x=1
while c>B:
        c=c-1+A
        x+=1
print(x)


S=input().split()
T=input().split()
c=0
for i in S
 if S[i]==T[i]:
   c+=1
print(c)


S=input()
T=input()
c=0
for i in S
 if S[i]==T[i]:
   c+=1
print(c)

S=input()
T=input()
m=0
for i in range(3):
    if S[i]==T[i]:
        m+=1
print(m)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
### INPUT
N = int(input())
A = list(map(int,input().split()))
A.extend([1000])
cont = 0
CN = [0]
b = N-1
### MAIN
for i in range(b):
    s = i
    while (A[s]>A[s+1]) and ((s+1)!=(b+1)):
        cont = cont + 1
        s = 1 + s
    if  cont != 0:
        CN.extend([cont])
        cont = 0
### MAX
print(max(CN))


### INPUT
N = int(input())
A = list(map(int,input().split()))
cont = 0
CN = [0]
b = N-1
### MAIN
for i in range(b):
    s = i
    while A[s]>=A[s+1] and s+1!=b:
        cont = cont + 1
        s = 1 + s
    if  (A[s]>=A[s+1]) and (s+1==b):
        cont =cont + 1
    if  cont != 0:
        CN.extend([cont])
        cont = 0
### MAX

print(max(CN))


t = list(input())
s = list(input())
cnt = 0
for a in range(3):
    if s[a] == t[a]:
        cnt = cnt + 1

print(cnt)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
e=input(S)
r=input(T)
x=0
for i in range(3):
    if e[i]==r[i]:
        x+=1
print(x)

e=input(”S"）
r=input(”T")
x=0
for i in range(3):
    if e[i]==r[i]:
        x+=1
print(x)

A, B = map(int, input().split())
k = 1
s=0
while k < B:
    k += A - 1
    s += 1
print(s)

e=input(S)
r=input(T)
x=0
for i in range(3):
    if e[i]==r[i]:
        x+=1
print(x)

S=input()
T=input()
x=0
for i in range(3):
    if S[i]==T[i]:
        x += 1
print(x)
        

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
N = int(input())
N -= 1
ans = N * (1 + N) / 2
print(ans)

S = input()
T = input()
ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans += 1
print(ans)


Verdicts: Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
perint("TEST")

s = input() 
t = input() 
count = 0


for i in range(3):
  if s[i] == t[i]:
    count += 1
print(count)

Verdicts: Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
S=input()
T=input()
ans=0
if S[0]==T[0]:
	ans += 1
if S[1]==T[1]:
	ans += 1
if S[2]==T[2]:
	ans += 1
ans

S=str(input())
T=str(input())
ans=0
if S[0]==T[0]:
    ans+=1
if S[1]==T[1]:
    ans+=1
if S[2]==T[2]:
    ans+=1
ans


ans=0
if S[0]==T[0]:
	ans += 1
if S[1]==T[1]
	ans += 1
if S[2]==T[2]
	ans += 1
ans

S=input()
T=input()
ans=0
if S[0]==T[0]:
	ans += 1
if S[1]==T[1]
	ans += 1
if S[2]==T[2]
	ans += 1
ans

S=str(input())
T=str(input())
ans=0
if S[0]==T[0]:
	ans += 1
if S[1]==T[1]:
	ans += 1
if S[2]==T[2]:
	ans += 1
ans

S=input()
T=input()
ans=0
if S[0]==T[0]:
    ans+=1
if S[1]==T[1]:
    ans+=1
if S[2]==T[2]:
    ans+=1
ans

S=str(input())
T=str(input())
ans=0
if S[0]==T[0]:
	ans+=1
if S[1]==T[1]:
	ans+=1
if S[2]==T[2]:
	ans+=1
ans

S=input()
T=input()
int(ans)=0
if S[0]==T[0]:
	ans += 1
if S[1]==T[1]:
	ans += 1
if S[2]==T[2]:
	ans += 1
ans

S=input()
T=input()
ans=0
if S[0]==T[0]:
    ans+=1
if S[1]==T[1]:
    ans+=1
if S[2]==T[2]:
    ans+=1
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
print("aa")

str1 = input()
str2 = input()
result = 0
for i in range(3):
  if str1[i] == str2[i]:
    result += 1
    
print(result)

Verdicts: Wrong Answer

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
import sys
a,b=map(int,input().split())
if b==1:
  print("0")
  sys.exit()
p=1
ans=0
for i in range(0,20):
  p+=a-1
  ans+=1
  if p>=b:
    print(ans)
    sys.exit()

s=input()
t=input()
count=0
for i in range(3):
  if s[i]==t[i]:
    count += 1
print(count)

Verdicts: Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
a, b = map(int, input().split())
cnt = 0
soc = 1
while soc < b:
    soc += a - 1
    cnt += 1
print(cnt)


a, b = map(int, input().split())
cnt = 0
soc = 1
while soc < b:
    soc += a - 1
    cnt += 1
print(cnt)

s = input()
t = input()
cnt = 0
for i in range(3):
    if s[i] == t[i]:
        cnt += 1
print(cnt)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
S = input()
T = input()
count = 0
for i in range(3):
  if S[3] == T[3]:
    count += 1
print(count)   
  

S = input()
T = input()
count = 0
for i in range(3):
  if S[i] == T[i]:
    count += 1
print(count)   
  

Verdicts: Runtime Error

Accepted
Problem: You will be given a string S of length 3 representing the weather forecast for three days in the past.  The i-th character (1 \leq i \leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  You will also be given a string T of length 3 representing the actual weather on those three days.  The i-th character (1 \leq i \leq 3) of S represents the actual weather on the i-th day. `S`, `C`, and `R` stand for sunny, cloudy, and rainy, respectively.  Print the number of days for which the forecast was correct.

Submission attempts (in order):
s=input()
t=input()
print(s[0]==t[0]+s[2]==t[2]+s[1]==t[1])

s=input()
t=input()
print(int(s[0]==t[0])+int(s[2]==t[2])+int(s[1]==t[1]))

Verdicts: Wrong Answer

Accepted