TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

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

ans = ""
for i in range(n):
  ascii = ord(s[i]) + n
  if ascii > ord('Z'):
    ascii -= ord('A')
  ans += char(ascii)

print(ans)

n = int(input())
s = input()

ans = ""
for c in s:
  ascii = ord(c) + n
  if ascii > ord('Z'):
    ascii -= 26
  ans += chr(ascii)

print(ans)

Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
n = int(input())
s = input()
l = len(s)
ans = ""
z = ord("Z") - 1
for i in range(l):
    k = ord(s[i]) + n
    if k > z:
        k = k - z + ord("A")
    ans = ans + chr(k)

print(ans)

n = int(input())
s = input()
l = len(s)
ans = ""
z = ord("Z")
for i in range(l):
    k = ord(s[i]) + n
    if k > z:
        k = k - z + (ord("A") - 1)
    ans = ans + chr(k)

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
def main(n: int, s: str):
    ans = ""
    for _s in s:
        ans += ascii[(ascii.index(_s) + n) % 26]

    print(ans)


if __name__ == "__main__":
    n = int(input())
    s = input()

    main(n, s)


from string import ascii_uppercase as ascii


def main(n: int, s: str):
    ans = ""
    for _s in s:
        ans += ascii[(ascii.index(_s) + n) % 26]

    print(ans)


if __name__ == "__main__":
    n = int(input())
    s = input()

    main(n, s)


Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
N = input()
S = list(input())
ans = ""
for s in S:
  i = (a.index(s)+N)%26
  ans += a[i]
print(ans)


a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
N = int(input())
S = list(input())
ans = ""
for s in S:
  i = (a.index(s)+N)%26
  ans += a[i]
print(ans)


Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

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

res =""

for ch in s:
    res += chr((ord(ch) + n) % 26)
print(res)

n = int(input())
s = input()

res =""

offset = ord("A")
for ch in s:
    if ord(ch) + n >= offset + 26:
        res += chr((ord(ch) + n) - 26)
    else:
        res += chr((ord(ch) + n))
print(res)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
N = int(input())
S = input()

A = ord('A')

T = [chr(A + (ord(c) - A + N) % 26) for c in S]

print(T)

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

A = ord('A')

T = ''.join([chr(A + (ord(c) - A + N) % 26) for c in S])

print(T)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
N=input()
s=input()
#ABCXYZ
print(N)
print(s)
L=[]
L.append('A')
L.append('B')
L.append('C')
L.append('D')
L.append('E')
L.append('F')
L.append('G')
L.append('H')
L.append('I')
L.append('J')
L.append('K')
L.append('L')
L.append('M')
L.append('N')
L.append('O')
L.append('P')
L.append('Q')
L.append('R')
L.append('S')
L.append('T')
L.append('U')
L.append('V')
L.append('W')
L.append('X')
L.append('Y')
L.append('Z')

answer=[]
for l in s:
  num=L.index(l)
  #print(type(num))
  #print(type(int(N)))
  newN=L.index(l)+int(N)
  n=newN%26
  answer.extend(L[n])  
  
answer="".join(answer)
print(answer)

N=input()
s=input()
#ABCXYZ
L=[]
L.append('A')
L.append('B')
L.append('C')
L.append('D')
L.append('E')
L.append('F')
L.append('G')
L.append('H')
L.append('I')
L.append('J')
L.append('K')
L.append('L')
L.append('M')
L.append('N')
L.append('O')
L.append('P')
L.append('Q')
L.append('R')
L.append('S')
L.append('T')
L.append('U')
L.append('V')
L.append('W')
L.append('X')
L.append('Y')
L.append('Z')

answer=[]
for l in s:
  num=L.index(l)
  #print(type(num))
  #print(type(int(N)))
  newN=L.index(l)+int(N)
  n=newN%26
  answer.extend(L[n])  
  
answer="".join(answer)
print(answer)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
n = int(input())
s = list(input())
res = []
for si in s:
    res.append(chr(ord(si) + n))
print(''.join(res).upper())


n = int(input())
s = list(input())
res = []
for si in s:
    new = ord(si) + n
    if new > 90:
        new += 6
    res.append(chr(new))
print(''.join(res).upper())


Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
s = [input() for i in range(2)]
N = int(s[0])
S = list(s[1])
eng = list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')
idx = np.array([eng.index(S[i]) for i in range(len(S))])
N_l = np.array([N]*len(S))
new_idx = idx + N_l
ans = [eng[i] for i in new_idx]
fin_ans = ''
for x in ans:
    fin_ans += x
print(fin_ans)

s = [input() for i in range(2)]
N = int(s[0])
S = list(s[1])
eng = list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')
idx = np.array([eng.index(S[i]) for i in range(len(S))])
N_l = np.array([N]*len(S))
new_idx = idx + N_l
ans = [eng[i] for i in new_idx]
fin_ans = ''
for x in ans:
    fin_ans += x
print(fin_ans)

import numpy as np
s = [input() for i in range(2)]
N = int(s[0])
S = list(s[1])
eng = list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')
idx = np.array([eng.index(S[i]) for i in range(len(S))])
N_l = np.array([N]*len(S))
new_idx = idx + N_l
ans = [eng[i] for i in new_idx]
fin_ans = ''
for x in ans:
    fin_ans += x
print(fin_ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
n=input()
s=list(input())
for i in range(len(s)):
    ord_s=int(ord(s[i]))
    ord_s+=int(n)
    s[i]=chr(ord_s)
print("".join(s))

n=input()
s=list(input())
for i in range(len(s)):
    ord_s=int(ord(s[i]))
    if ord_s+int(n)<=90:
        ord_s+=int(n)
        s[i]=chr(ord_s)
    else:
        ord_s=ord_s+int(n)-26
        s[i]=chr(ord_s)
print("".join(s))

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

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

a = [chr(i) for i in range(65, 65+26)]
c = []
for i in range(len(s)):
    j = 0
    while s[i] != a[j]:
        j+=1
    b = (j+n)%26
    c.append(a[b])
d = c[0]
print(c)
for i in range(len(c)-1):
    d += c[i+1]
print(d)

n = int(input())
s = input()

a = [chr(i) for i in range(65, 65+26)]
c = []
for i in range(len(s)):
    j = 0
    while s[i] != a[j]:
        j+=1
    b = (j+n)%26
    c.append(a[b])
d = c[0]
for i in range(len(c)-1):
    d += c[i+1]
print(d)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
N = int(input())
S = input()
ans = ""
for s in S:
  ans += chr((ord(S) + N - 65)%26 + 65)
print(ans)

N = int(input())
S = input()
ans = ""
for s in S:
  ans += chr((ord(s) + N)%26 + 65)
print(ans)

N = int(input())
S = input()
ans = ""
for s in S:
  ans += chr((ord(s) + N-65)%26 + 65)
print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
n = int(input())
ary = list(input())
alf = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

sort = []
for s in ary:
    next_index = alf.index(s) + n
    if next_index > 25:
        next_index - 1
    index = next_index % 25
    sort.append(alf[index])


print("".join(sort))


n = int(input())
s = list(input())
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

ans = ""
for c in s:
    ans += alphabet[(n + alphabet.index(c)) % 26]

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
n = int(input())
s = list(input(''))
a = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
b = 0
for i in range(len(s)):
    for j in range(len(a)):
        if s[i] == a[j]:
            if j+n > len(a)-1:
                s[i] = a[j+n-len(a)]
                print(s)
                break
            else:
                s[i] = a[j+n]
                print(s)
                break
print(''.join(s))

n = int(input())
s = list(input(''))
a = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
b = 0
for i in range(len(s)):
    for j in range(len(a)):
        if s[i] == a[j]:
            if j+n > len(a)-1:
                s[i] = a[j+n-len(a)]
                break
            else:
                s[i] = a[j+n]
                #print(s)
                break
print(''.join(s))

Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

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


A = list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')
print(A)
T=[]
for i in S:
    print(i)
    k=A.index(i)+int(N)
    print(k)
    t=A[k]
    T.append(t)

print(T)


N = input()
S = input()


A = list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')
print(A)
T =""
for i in S:
    print(i)
    k=A.index(i)+int(N)
    print(k)
    t=A[k]
    print(t)
    T +=t

print(T)


N = input()
S = input()

A = list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')
T =""
for i in S:
    k=A.index(i)+int(N)
    t=A[k]
    T +=t

print(T)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
n = int(input())
s = input()
ss = s * 2

print(ss[n:n+len(s)])


n = int(input())
s = input()

alp = "abcdefghijklmnopqrstuvwxyz".upper()
alp *= 2
ans = ""
for i in s:
    ind = alp.index(i)
    ans += alp[ind+n]
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):


a = int(input())


S = str(input())

chr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
SS = []

for k in range(len(S)):
    for j in range(len(chr)):
        if S[k] == chr[j]:
            if (j+a) >= 25:
                SS += chr[j+a-25]
            else:
                SS += chr[j+a]

SS = ''.join(SS)

print(SS)


a = int(input())


S = str(input())

chr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
SS = []

for k in range(len(S)):
    for j in range(len(chr)):
        if S[k] == chr[j]:
            if (j+a) >= 25:
                SS += chr[j+a-26]
            else:
                SS += chr[j+a]

SS = ''.join(SS)

print(SS)

Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
N=input()
S=input()
abc=[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
out=[]
for i in S:
  ind=abc.index(i)
  ind+=2
  if index>26:
    index-=26
  out.append(abc(ind))
print(out)
  

N=input()
S=input()
abc=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
out=[]
for i in S:
  idx=abc.index(i)
  idx=idx+int(N)%26
  if idx>25:
      idx-=26
  out.append(abc[idx])
out1=''.join(out)
print(out1)


Verdicts: Runtime Error

Accepted
Problem: Takahashi is playing a board game called Sugoroku.  On the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.  The game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.  Additionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \leq i \leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.  Find the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.

Submission attempts (in order):
n, m = [int(x) for x in input().split()]

s = input()
c = n + 1

h = []
while True:
	d = m
	while d > 0:
		if c - d > 0:
			if s[c - d] == '0':
				break
		d -= 1
	
    
	print(h)
	print(c)
	if d == 0:
		print(-1)
		break
        
        
        
	c -= d
	h.append(d)
	if c == 0:
		h.reverse()
		print(h)
		print(" ".join(h))
		break

n, m = [int(x) for x in input().split()]

s = input()
c = n

h = []
while True:
	d = m
	while d > 0:
		if c - d >= 0:
			if s[c - d] == '0':
				break
		d -= 1

	if d == 0:
		print(-1)
		break
	
    
    
	c -= d
	h.append(str(d))
	if c == 0:
		h.reverse()
		print(' '.join(h))
		break

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is playing a board game called Sugoroku.  On the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.  The game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.  Additionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \leq i \leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.  Find the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.

Submission attempts (in order):
n,m=map(int,input().split())
s=input()
s=s[::-1]
r,l,cnt,k,=0,0,0,0
ans=[]
while 1:
  while cnt<m:
    r+=1
    if r==n:
      ans.append(r-k)
      print(r,l)
      print(*ans[::-1])
      exit()
    if s[r]=='0':
      l=r
    cnt+=1
  if r-l==m:
    print(-1)
    exit()
  ans.append(l-k)
  k=l
  cnt=r-l

n,m=map(int,input().split())
s=input()
s=s[::-1]
r,l,cnt,k,=0,0,0,0
ans=[]
while 1:
  while cnt<m:
    r+=1
    if r==n:
      ans.append(r-k)
      print(*ans[::-1])
      exit()
    if s[r]=='0':
      l=r
    cnt+=1
  if r-l==m:
    print(-1)
    exit()
  ans.append(l-k)
  k=l
  cnt=r-l

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is playing a board game called Sugoroku.  On the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.  The game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.  Additionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \leq i \leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.  Find the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.

Submission attempts (in order):

import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    
    return [read()[:-1] for _ in range(H)]


def read_col(H, n_cols):
    
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


N, M = read_ints()
S = read()[:-1]
S = S[::-1]
ans = []
cur_i = 0
while True:
    dice = M
    cur_i += dice
    if cur_i > N + 1:
        ans.append(N - (cur_i - M))
        break
    if cur_i = N = 1:
        break
    while S[cur_i] == '1':
        cur_i -= 1
        dice -= 1
        if dice == 0:
            print(-1)
            exit()
    ans.append(dice)
print(*ans[::-1])



import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    
    return [read()[:-1] for _ in range(H)]


def read_col(H, n_cols):
    
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


N, M = read_ints()
S = read()[:-1]
S = S[::-1]
ans = []
cur_i = 0
while True:
    dice = M
    cur_i += dice
    if cur_i > N:
        if N - (cur_i - M) == 0:
            pass
        else:
            ans.append(N - (cur_i - M))
        break
    # if cur_i == N + 1:
    #     ans.append(cur_i - N)
    #     break
    while S[cur_i] == '1':
        cur_i -= 1
        dice -= 1
        if dice == 0:
            print(-1)
            exit()
    ans.append(dice)
print(*ans[::-1])


Verdicts: Runtime Error

Accepted
Problem: Takahashi is playing a board game called Sugoroku.  On the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.  The game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.  Additionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \leq i \leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.  Find the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.

Submission attempts (in order):
n,m=map(int,input().split())
s=input()
x=n
a=[]
while x!=0:
  for i in range(min(m,x),0,-1):
    if s[x-i]=="0":
      x-=i
      a.append(i)
      break
    if i==1:print(-1);exit()
print(a[::-1])

n,m=map(int,input().split())
s=input()
x=n
a=0
while x!=0:
  for i in range(min(m,x),0,-1):
    if s[x-i]=="0":
      x-=i
      a=a*10+i
      break
    if i==min(m,x):print(-1);exit()
print(*list(str(a)))

n,m=map(int,input().split())
s=input()
x=n
a=0
while x!=0:
  for i in range(1,min(m,x)+1):
    if s[x-i]=="0":
      x-=i
      a=a*10+i
      break
    if i==min(m,x):print(-1);exit()
print(*list(str(a))[::-1])

n,m=map(int,input().split())
s=input()
x=n
a=0
while x!=0:
  for i in range(min(m,x),0,-1):
    if s[x-i]=="0":
      x-=i
      a=a*10+i
      break
    if i==1:print(-1);exit()
print(*list(str(a)))

n,m=map(int,input().split())
s=input()
x=n
a=0
while x!=0:
  for i in range(m,0,-1):
    if s[x-i]=="0":
      x-=i
      a=a*10+i
      break
    if i==1:print(-1);exit()
print(*list(str(a))[::-1])

n,m=map(int,input().split())
s=input()[::-1]
i=0
ans=[]
while i<n:
  for j in range(min(n-i,m),0,-1):
    if s[i+j]=="0":
      ans.append(j)
      i+=j
      break
    if j==1:print(-1);exit()
print(*ans[::-1])

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: Takahashi is playing a board game called Sugoroku.  On the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.  The game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.  Additionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \leq i \leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.  Find the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.

Submission attempts (in order):
def main():    
    N, M = map(int, input().split())
    S = input()
    p = N
    a = []
    while p > 0:
        for i in range(min(M, p), 0, -1):
            if S[p - i] == '0':
                p = p - i
                a.append(str(i))
                break
        else:
            return -1
    return ''.join(i for i in reversed(a))
print(main())


def main():    
    N, M = map(int, input().split())
    S = input()
    p = N
    a = []
    while p > 0:
        for i in range(min(M, p), 0, -1):
            if S[p - i] == '0':
                p = p - i
                a.append(str(i))
                break
        else:
            return -1
    return ' '.join(i for i in reversed(a))
print(main())


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is playing a board game called Sugoroku.  On the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.  The game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.  Additionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \leq i \leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.  Find the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.

Submission attempts (in order):
def main():
    import sys
    input = sys.stdin.readline
    n,m = map(int,input().split())
    l = list(input())
    l = l[::-1]
    count = [-1]*(n+1)
    count[0] = 0
    check = 1
    i = 0

    while i < n+1:
        if count[i] != -1:
            a = -1
            for j in range(1,m+1):
                if i+j < n+1 and l[i+j] != "1":
                    count[i+j] = check
                    a = i+j
            
            check += 1
            if a == -1:
                print(-1)
                exit()
            else:
                i = a
            
            if count[-1] != -1:
                break
    count = count[::-1]

    ans = []
    a = 0
    for i in range(check-2,-1,-1):
        b = count.index(i)
        ans.append(b-a)
        a = b
    print(*ans)

if __name__ == "__main__":
    main()


def main():
    
    n,m = map(int,input().split())
    l = list(input())[::-1]
    ans = []
    i = 0
    l[0] = 0

    while i < n+1:
        if l[i] == 0:
            a = -1
            for j in range(m,0,-1):
                if i+j < n+1 and l[i+j] != "1":
                    a = i+j
                    ans.append(j)
                    l[a] = 0
                    break
            if a == -1:
                print(-1)
                exit()
            else:
                i = a
            
            if l[-1] == 0:
                break
    
    print(*ans[::-1])

if __name__ == "__main__":
    main()


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is playing a board game called Sugoroku.  On the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.  The game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.  Additionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \leq i \leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.  Find the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.

Submission attempts (in order):
from bisect import bisect_right
N, M = map(int, input().split())
S = input()

A = [i for i, s in enumerate(S) if s == '0']
now = 0
ans = []

while True:
    right = bisect_right(A, now + M) - 1
    new = A[right]
    ans.append(new - now)
    if new == N:
        break
    if new == now:
        print(-1)
        exit()
    now = new
print(*ans)

from bisect import bisect_left

N, M = map(int, input().split())
S = [i for i, s in enumerate(input()) if s == '0']

ans = []
now = N
while now > 0:
    nxI = bisect_left(S, now - M)
    nx = S[nxI]

    if nx == now:
        print(-1)
        exit()

    ans.append(now - nx)
    now = nx

print(*ans[::-1])


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is playing a board game called Sugoroku.  On the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.  The game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.  Additionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \leq i \leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.  Find the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.

Submission attempts (in order):
n, m = map(int, input().split())
a = list(map(int, list(input())))
dp = [-1]*(n+1)
r = n
for i in reversed(range(n+1)):
  if a[i]:
    continue
  if i + m < r:
    r = i + m
    while a[r]:
      r -= 1
    if r == i:
      print(-1)
      exit(0)
  dp[i] = r
d = list()
cur = 0
while cur < n:
  d.append(dp[cur] - cur)
  cur = dp[cur]
print(*d)

n, m = map(int, input().split())
a = list(map(int, list(input())))
dp = [-1]*(n+1)
te = [-1]*(n+1)
te[n] = 0
g = [n]
c = 0
r = n
for i in reversed(range(n)):
  if a[i]:
    continue
  if i + m < r:
    r = i + m
    while a[r]:
      r -= 1
    if r == i:
      print(-1)
      exit(0)
  dp[i] = r
  te[i] = te[r] + 1
  if c < te[i]:
    c += 1
    g.append(i)
  g[te[i]] = i
g = g[::-1]
d = [y - x for x, y in zip(g,g[1:])]
print(*d)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is playing a board game called Sugoroku.  On the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.  The game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.  Additionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \leq i \leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.  Find the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.

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

count=0
count_1=0
count_2=0
answer=[]
ans=0

for i,s in enumerate(S):
    #print(i)
    if i==0:
        pass
    elif i==N:
        count_1+=1
        answer.append(count_1)
        #print("g")
    elif s=="0"and count_1<M-1:
        count_1+=1
        count=count_1
        count_2=0
        #print("a")
    elif s=="0" and count_1==(M-1):
        count_1+=1
        count_2=0
        answer.append(count_1)
        count=0
        count_1=count
        #print("b")
    else:
        if count_1<M-1 and count_2<M-1:
            count_1+=1
            count_2+=1
            #print("c")
        elif count_2==M-1:
            ans=-1
            #print("d")
            break
        elif count_1==M-1:
            count_2+=1
            answer.append(count)
            count_1=count_2
            count=count_1
            #print("e")
if ans==-1:
    print(-1)
else:
    print(" ".join(map(str,answer)))


N,M=map(int,input().split())
S=input()
S=S[::-1]
count=0
count_1=0
count_2=0
answer=[]
ans=0

for i,s in enumerate(S):
    #print(i)
    if i==0:
        pass
    elif i==N:
        count_1+=1
        answer.append(count_1)
        #print("g")
    elif s=="0"and count_1<M-1:
        count_1+=1
        count=count_1
        count_2=0
        #print("a")
    elif s=="0" and count_1==(M-1):
        count_1+=1
        count_2=0
        answer.append(count_1)
        count=0
        count_1=count
        #print("b")
    else:
        if count_1<M-1 and count_2<M-1:
            count_1+=1
            count_2+=1
            #print("c")
        elif count_2==M-1:
            ans=-1
            #print("d")
            break
        elif count_1==M-1:
            count_2+=1
            answer.append(count)
            count_1=count_2
            count=count_1
            #print("e")
if ans==-1:
    print(-1)
else:
    print(" ".join(map(str,answer[::-1])))


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is playing a board game called Sugoroku.  On the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.  The game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.  Additionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \leq i \leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.  Find the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.

Submission attempts (in order):
N,M=map(int,input().split())
S=input()
L=[]
P=0

import sys
while P<N:
    k=0
    for i in range(1,M+1):
        if P+i>N:
            break
        if S[P+i]=='0':
            k=i
    if k==0:
        print(-1)
        sys.exit()
    L.append(k)
    P+=k
    
print(*L)

N,M=map(int,input().split())
S=input()[::-1]
L=[]
P=0

import sys
while P<N:
    k=0
    for i in range(1,M+1):
        if P+i>N:
            break
        if S[P+i]=='0':
            k=i
    if k==0:
        print(-1)
        sys.exit()
    L.append(k)
    P+=k

L=L[::-1]
print(*L)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is playing a board game called Sugoroku.  On the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.  The game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.  Additionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \leq i \leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.  Find the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.

Submission attempts (in order):
n, m = [int(s) for s in input().split()]
s = [int(s) for s in input()]
board = [None]*(n+1)
left = 0
for i in range(1,n+1):
    if s[i]:
        continue
    left = max(left, i-m)
    while s[left]:
        left += 1
        if left >= i:
            break
    if left < i:
        board[i] = left
print(board)
if board[n] is None:
    print(-1)
else:
    steps = []
    j = n
    while True:
        step = j - board[j]
        steps.append(step)
        j = board[j]
        if j==0:
            break
    print(' '.join(str(s) for s in steps[::-1]))



n, m = [int(s) for s in input().split()]
s = [int(s) for s in input()]
board = [None]*(n+1)
left = 0
board[left] = 0
for i in range(1,n+1):
    if s[i]:
        continue
    left = max(left, i-m)
    while board[left] is None:
        left += 1
        if left == i:
            break
    if left < i:
        board[i] = left
# print(board)
if board[n] is None:
    print(-1)
else:
    steps = []
    j = n
    while True:
        step = j - board[j]
        steps.append(step)
        j = board[j]
        if j==0:
            break
    print(' '.join(str(s) for s in steps[::-1]))

Verdicts: Runtime Error

Accepted
Problem: Takahashi is playing a board game called Sugoroku.  On the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.  The game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.  Additionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \leq i \leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.  Find the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.

Submission attempts (in order):
N, M = [int(item) for item in input().split()]
S = input()
a=[]
s = S
n = N
while len(s)>1:
    for i in range(M, 0, -1):
        can = False
        if n<=i and s[0] == '0':
            a.append(i)
            s = ''
            break
        if n>=i and s[n-i] == '0':
            a.append(i)
            s = s[:n-i+1]
            n = n-i
            can = True
            break
    if not can and len(s)>1:
        print(-1)
        break
a=a[-1::-1]
if len(a):
    print(*a)

N, M = [int(item) for item in input().split()]
S = input()
a=[]
s = S
n = N
while n > 0:
    for i in range(M, 0, -1):
        can = False
        if n>=i and s[n-i] == '0':
            a.append(i)
            s = s[:n-i+1]
            print(s)
            n -= -i
            can = True
            break
    if not can and len(s)>1:
        print(-1)
        a=[]
        break
a=a[-1::-1]
if len(a):
    print(*a)

N, M = [int(item) for item in input().split()]
S = input()
a=[]
s = S
n = N
while n > 0:
    for i in range(M, 0, -1):
        can = False
        if n>=i and s[n-i] == '0':
            a.append(i)
            s = s[:n-i+1]
            n -= i
            can = True
            break
    if (not can) and len(s)>1:
        print(-1)
        a=[]
        break
a=a[-1::-1]
if len(a):
    print(*a)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi is playing a board game called Sugoroku.  On the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.  The game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.  Additionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \leq i \leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.  Find the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.

Submission attempts (in order):
def solve():
    from heapq import heappush, heappop
    from sys import stdin
    #f_i = stdin
    f_i = open('146_F_in_s3')#
    
    N, M = map(int, f_i.readline().split())
    M *= -1
    S = f_i.readline().rstrip()
    
    unvisited = [True] * (N + 1)
    unvisited[N] = False
    rec = [[] for i in range(N + 1)]
    hq = [(0, N)] # (cost, pos)
    
    while hq:
        cost, pos = heappop(hq)
        if pos == 0:
            break
        
        cost += 1
        for r in range(M, 0):
            next_pos = pos + r
            if unvisited[next_pos] and S[next_pos] == '0':
                unvisited[next_pos] = False
                rec[next_pos] = [r] + rec[pos]
                heappush(hq, (cost, next_pos))
    else:
        return -1
    
    return ' '.join(str(-r) for r in rec[0])

print(solve())

def solve():
    from collections import deque
    from sys import stdin
    f_i = stdin
    
    N, M = map(int, f_i.readline().split())
    S = f_i.readline().rstrip()
    
    pos = N
    rec = deque()
    while pos:
        for move in range(M, 0, -1):
            next_pos = pos - move
            if next_pos >= 0 and S[next_pos] == '0':
                pos = next_pos
                rec.appendleft(move)
                break
        else:
            print(-1)
            break
    else:
        print(' '.join(str(move) for move in rec))

solve()

Verdicts: Runtime Error

Accepted
Problem: Takahashi is playing a board game called Sugoroku.  On the board, there are N + 1 squares numbered 0 to N. Takahashi starts at Square 0, and he has to stop exactly at Square N to win the game.  The game uses a roulette with the M numbers from 1 to M. In each turn, Takahashi spins the roulette. If the number x comes up when he is at Square s, he moves to Square s+x. If this makes him go beyond Square N, he loses the game.  Additionally, some of the squares are Game Over Squares. He also loses the game if he stops at one of those squares. You are given a string S of length N + 1, representing which squares are Game Over Squares. For each i (0 \leq i \leq N), Square i is a Game Over Square if S[i] = 1 and not if S[i] = 0.  Find the sequence of numbers coming up in the roulette in which Takahashi can win the game in the fewest number of turns possible. If there are multiple such sequences, find the lexicographically smallest such sequence. If Takahashi cannot win the game, print -1.

Submission attempts (in order):
n= int(input())
a = list(map(int,input().split()))
now = a[0] 
a.sort()
res = 0
ans = 1
for i in range(n-1):
    if a[i+1] != now:
        ans+=1
        now = a[i+1]
if ans%2:print(ans)
else: print(ans-1)

n,m = map(int,input().split())
s = input()
dp = [0]*(n+1)
r = n

for i in range(n-1,-1,-1):
    if int(s[i]) == 1:
        dp[i] = -1
        continue
    while r > i+m:r-=1
    while dp[r] == -1:r -= 1
    if r == i:
        print(-1)
        exit(0)
    dp[i] = dp[r]+1
now = 0
ans = []
for i in range(n+1):
    if dp[i] == -1:continue
    if dp[i] != dp[now]:
        ans.append(i-now)
        now = i
print(*ans)
        
    
    

Verdicts: Runtime Error

Accepted
Problem: Given is an integer r.  How many times is the area of a circle of radius r larger than the area of a circle of radius 1?  It can be proved that the answer is always an integer under the constraints given.

Submission attempts (in order):
# -*- coding: utf-8 -*-

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    r = int(lines[0])

    return r


def solve(r):

    return r*r

def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()
	

# -*- coding: utf-8 -*-

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    r = int(lines[0])

    return (r, )


def solve(r):

    return r*r

def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()
	

Verdicts: Runtime Error

Accepted