TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
N,K=map(int,input().split())
print(1 if N%K != 0 else 0)

S=list(input())
K=int(input())
#print(S)
for i in range(K):
    n=int(S[i])
    if n==1:
        if K-1==i:
            print(1)
            exit(0)
    else:
        print(n)
        exit(0)

Verdicts: Runtime Error

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
S = list(input())
K = int(input())

for i in range(K):
    if i>=len(S):
        print('1')
        exit()
    if S[i]!='1':
        print(S[i])
        exit()
    else:
        print('1')
        exit()
    
    

S = list(input())
K = int(input())

for i in range(min(len(S),K)):
    if S[i]!='1':
        print(S[i])
        exit()
print('1')
    
    
    


Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
S = int(input())
K = int(input())
if K == 1:
	print(S[0])
	exit()
i = 0
while S[i] == "1":
	i += 1
print(S[i])


S = input()
K = int(input())

if K == 1:
	print(S[0])
else:
	i = 0
	K -= 1
	while S[i] == "1" and K > 0:
		i += 1
		K -= 1
	print((i,S[i]))


S = input()
K = int(input())
if K == 1:
	print(S[0])
	exit()
else:
	i = 0
	K -= 1
	while S[i] == "1" and K > 0:
		i += 1
		K -= 1
	print(S[i])



Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
S=int(input())
K=int(input())
a=[]
while S !=0:
  s=S%10
  a.append(s)
  S //=10
m=0
for i in range(1,len(a)+1):
  m += a[-i]*5000000000000000
  if m>=K:
    ans=i
    break
print(a[-ans])

S=int(input())
K=int(input())

a=[]
while S !=0:
  s=S%10
  a.append(s)
  S //=10
m=0

for i in range(1,len(a)+1):
  if a[-i]!=1:
    if i>K:
      ans=1
    else:
      ans=i
    break
  else:
    ans=1

print(a[-ans])

Verdicts: Runtime Error

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
S = list(input())
print(S)
size = len(S)
K = int(input())
for i in range(size):
    if S[i] == "1" and K == 1 :
        print("1")
        exit()
    else :
        if S[i] == "1":
            K -= 1
        else : 
            print(S[i])
            exit()

S = list(input())
size = len(S)
K = int(input())
for i in range(size):
    if S[i] == "1" and K == 1 :
        print("1")
        exit()
    else :
        if S[i] == "1":
            K -= 1
        else : 
            print(S[i])
            exit()

Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
N,K = map(int,input().split())
listn = list(str(N))
a = []
if len(str(N)) < K:
    for i in range(len(str(N))):
        if listn[i] != str(1):
            a.append(str(listn[i]))
else:
    for i in range(K):
        if listn[i] != str(1):
            a.append(str(listn[i]))
if a == []:
    print(1)
else:
    print(a[0])


N,K = map(int,input().split())
listn = list(str(N))
for i in range(K):
    if listn[i] != str(1):
        a.append(str(listn[i]))
if a == []:
    print(1)
else:
    print(a[0])

N, K = [int(input()) for _ in range(2)]
listn = list(str(N))
a = []
if len(str(N)) < K:
    for i in range(len(str(N))):
        if listn[i] != str(1):
            a.append(str(listn[i]))
else:
    for i in range(K):
        if listn[i] != str(1):
            a.append(str(listn[i]))
if a == []:
    print(1)
else:
    print(a[0])

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
import sys
S = input()
K = int(input())
result = [0,0]
for i in len(s):
  if S[i] != 1:
    result[0] = i+1
    result[1] = S[i]
print(1 if K<result[0] else result[1] )


import sys
S = input()
K = int(input())
for i in S:
  if i != 1:
    print(i)
    sys.exit()
print(1)

import sys
S = input()
K = int(input())
result = [0,""]
for i in S:
  if i != "1":
    result[1] = i
    break
  else:
    result[0] += 1
print(1 if K<=result[0] else result[1] )


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
import sys
S=input()
li=''.join(S)
S1=len(li)
m=[]

K=int(input())
ans=str(K)
k1=''.join(ans)
k2=len(k1)
print(k2)
for i in range(0,S1):
    if li[i]!='1' and (i+1)<K:
        if li[i]==2 and k2>=1505000000000001+i:
            pass
        else:
            print(li[i])
            sys.exit()

print('1')


import sys
S=input()
li=''.join(S)
S1=len(li)
m=[]

K=int(input())
ans=str(K)
k1=''.join(ans)
k2=len(k1)

for i in range(0,S1):
    if li[i]!='1' and i<K:
        print(li[i])
        sys.exit()

print('1')


Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
# coding: utf-8
s = input()

if s[0] == 1:
    print(1)
else:
    print(s[0])

# coding: utf-8
s = input()
k = int(input())


if s[0] == 1:
    for i in range(k):
        if s[i] != 1:
            print(s[i])
            exit()
        
    print(1)
else:
    print(s[0])

# coding: utf-8
s = input()
k = int(input())

for i in range(k):
    if s[i] != '1':
        print(s[i])
        exit()

print(1)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
import sys
s = input()
k = input()

for i in range(len(s)):
    if s[i] != "1" and i + 1 < k:
        print(s[i])
        sys.exit(0)
print(1)


import sys
s = input()
k = int(input())

for i in range(k):
    if s[i] != "1" :
        print(s[i])
        sys.exit(0)
print(1)


Verdicts: Runtime Error

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
import math

print(math.log10(2**5000000000000000))

s = list(str(input()))
k = int(input())
ans = '1'

for i in range(k):
  if s[i] != '1':
    ans = s[i]
    break
  if len(s)-1 == i:
    break
    
print(int(ans))

Verdicts: Time Limit Exceeded

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
n=list(input())
m=int(input())
i=0
for t in range(len(n)):
  if n[t]!="1":
    i=t+1
    break
if m<i:
  print(1)
else:
  print(int(n[i]))


n=list(input())
m=int(input())
i=0
for t in range(100):
  if n[t]=="1":
    pass
  else:
    i=t+1
if m=>i:
  print(str(n[i]))
else:
  print(1)


n=list(input())
m=int(input())
i=0
for t in range(len(n)):
  if n[t]=="1":
    pass
  else:
    i=t+1
    break
if m>=i:
  print(int(n[i]))
else:
  print(1)

n=list(input())
m=int(input())
i=0
for t in range(len(n)):
  if n[t]!="1":
    i=t+1
    break
if m<i:
  print(1)
else:
  print(int(n[i-1]))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
S = input().strip()
K = int(input().strip())
for i in range(K):
  if S[i] == 1:
    continue
  else:
    print(S[i])
    exit()
print(S[K])

S = input().strip()
K = int(input().strip())
for i in range(K):
  if S[i] == '1':
    continue
  else:
    print(S[i])
    exit()
print(S[K-1])


Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
S = list(input())
K = int(input())

for i in range(K):
	if S[i] != 1:
		break
	
if S[i] != 1:
	print(S[i])
else:
	print(1)

S = list(input())
K = int(input())

for i in range(K):
	if S[i] != 1:
		break
	
if S[i] != 1:
	print(S[i])
else:
	print(1)

S = list(input())
K = int(input())

for i in range(K):
	if S[i] != '1':
		break
	
if S[i] != 1:
	print(S[i])
else:
	print(1)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

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

n = -1
for i, ki = enumerate(s):
  if ki!='1':
	n = i+1
    break
    
if n<0 or k<n:
  print(1)
else:
  print(s[n-1])


s = input()
k = int(input())

n = -1
for i, ki in enumerate(s):
  if ki!='1':
    n = i+1
    break
    
if n<0 or k<n:
  print(1)
else:
  print(s[n-1])


Verdicts: Runtime Error

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
S = str(input())
K = int(input())
for i in range(K):
  if S[i] != "1":
    print(S[i]) 
else:
  print(S[K-1])

S = str(input())
K = int(input())
for i in range(K):
  if S[i] != "1":
    print(S[i])
    break
else:
  print(1)

Verdicts: Runtime Error

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
s = input()
k = int(input())
flag = 1
for i in range(min(k,s)):
    if s[i]!='1':
        flag = 0
        break
if flag:
    print(1)
else:
    print(s[1])


s = input()
k = int(input())
flag = 1
for i in range(min(k,len(s))):
    if s[i]!='1':
        flag = 0
        a = s[i]
        break
if flag:
    print(1)
else:
    print(a)


Verdicts: Runtime Error

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
s=input()
k=int(input())
i=0
while i<k:
  if s[i]!=1:
    x=s[i]
    break
  i+=1
if i==k:
  x=1
print(x)

s=input()
k=int(input())
f=0
for i in range(k):
  if s[i]!='1':
    x=s[i]
    f=1
    break
print(x) if f==1 else print(1)

Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
s = input()
k = int(input())
if k == 1 and s[0] == '1':
  print(s[0])
elif s[0] == 1:
  print(s[1])
else:
  print(s[0])

s = input()
k = int(input())
i = 0
l = len(s)
while s[i] == '1':
  if i >= l-1:
    break
  i += 1
if i == 0 or k <= i:
  print(s[0])
else:
  print(s[i])

Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
s = input()
k = int(input())
ans = "1"
for i in s[:k]:
    if i!= "1":
        ans = i
        exit()
print(ans)

s = input()
k = int(input())
ans = "1"
for i in s[:k]:
    if a!= "1":
        ans = a
        exit()
print(ans)

s = input()
k = int(input())
ans = "1"
for i in s[:k]:
    if i != "1":
        ans = i
        break
print(ans)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
inf = 5*10**15
S = input()
K = int(input())

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

S = input()
K = int(input())

for i in S:
    if K == 1:
        print(i)
        break
    elif i == "1":
        K -= 1
    else:
        print(i)
        break

Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
s = list(input())
k = input()

if k == '1':
    print(s[0])
else:
    n = min(int(k), len(s))
    f = True
    for i in range(n):
        if s[i] != '1':
            print(s[i])
            f = False
    if f:
        print(1)

s = list(input())
k = input()

if k == '1':
    print(s[0])
else:
    n = min(int(k), len(s))
    f = True
    for i in range(n):
        if s[i] != '1':
            print(s[i])
            f = False
            break
    if f:
        print(1)

Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

S = input()
K = input()
S = str(S)
K = int(K)

for i in range(K):
    if S[i] != 1:
        break
    else:
        print("1")

print(S[i])


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

S = str(input())
K = int(input())

ans = "1"
for i in range(K):
    if S[i] != "1":
        ans = S[i]
        break

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
s = input()
k = int(input())
ans = 1
for i in range(len(s)):
  if s[i] != 1:
    if i <= k:
      ans = int(s[i])
      break
print(ans)

s = input()
k = int(input())
ans = 1
for i in range(len(s)):
  if s[i] != 1:
    ans = s[i]
    break
print(ans)

s = input()
k = int(input())
ans = 1
for i in range(len(s)):
  if s[i] != 1:
    if i < k:
      ans = s[i]
      break
print(ans)

s = input()
k = int(input())
ans = 1
for i in range(len(s)):
  if s[i] != 1:
    if i <= k-1:
      ans = int(s[i])
      break
print(ans)

s = input()
k = int(input())
anstr = ""
for i in range(len(s)):
  anstr += s[i]*(int(s[i])**5000000000000000)
  if len(anstr) > k:
    break
print(anstr[k-1])

s = input()
k = int(input())
anstr = ""
for i in range(len(s)):
  anstr += s[i]*(int(s[i])**5000000000000000)
print(anstr[k-1])

s = input()
k = int(input())
ans = 1
for i in range(len(s)):
  if s[i] != 1:
    if i < k:
      ans = int(s[i])
      break
print(ans)

s = input()
k = int(input())
ans = 1
for i in range(len(s)):
  if s[i] != "1":
    if i <= k-1:
      ans = int(s[i])
      break
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Time Limit Exceeded

Time Limit Exceeded

Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
s = input()
k = int(input()) - 1

cnt1 = 0
for i in range(len(s)):
  if s[i] == 1:
    cnt1 += 1

if cnt1 >= k:
  print(1)
else:
  print(s[cnt1])

s = input()
k = int(input()) - 1
 
cnt1 = 0
for i in range(len(s)):
  if s[i] == '1':
    cnt1 += 1
  else:
    break
 
print(cnt1, k)
if cnt1 > k:
  print(1)
else:
  print(s[cnt1])

s = input()
k = int(input()) - 1
 
cnt1 = 0
for i in range(len(s)):
  if s[i] == '1':
    cnt1 += 1
  else:
    break
 
#print(cnt1, k)
if cnt1 > k:
  print(1)
else:
  print(s[cnt1])

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
s=input()
k=int(input())
t=''
for v in s:
    if int(v)*(5**12)<=k:
        break
print(v)

s=input()
len_s=len(s)
cnt=0
k=int(input())
for v in s:
    if v!='1':
        print(int(v))
        break
    else:
        cnt+=1
        if k==cnt:
            print(1)
            break

Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
S = str(input())
K = int(input())
if S.count("1") == S(len):
    print(1)
    exit(0)
for s in S:
    if s != "1":
        print(s)
        exit()


S = str(input())
K = int(input())
for i in range(0, K):
    if S[i] != "1":
        print(S[i])
        exit()
print(1)


Verdicts: Runtime Error

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

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

for i in range(K):
    if S[i] != '1':
        print(S[i])
        exit()
    
    if i == k - 1:
        print('1')
        exit()




S = input()
K = int(input())

for i in range(K):
    if S[i] != '1':
        print(S[i])
        exit()
    
    if i == K - 1:
        print('1')
        exit()




Verdicts: Runtime Error

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

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

for i in range(0, len(S)):
    if int(S[i])*5000000000000000 > K:
        print(S[i])
        break



S = input()
K = int(input())

for i in range(0, len(S)):
    if S[i] == '1':
        if K == i+1:
            print(S[i])
            break
        elif S[i+1] != '1':
            print(S[i+1])
            break
    else:
        print(S[0])
        break



Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
s = input()
k = input()
 
flag = True
 
for i in range(len(k)):
  if s[i] != 1:
    print(s[i])
    flag = False
    break
    
if flag:
  print("1")

s = input()
k = input()

flag = True

for i in range(len(k)):
  if s[i] != 1:
    prtin(s[i])
    flag = false
    break
    
if flag:
  print("1")


s = list(input())
k = int(input())
 
flag = True

for i in range(k):
  if s[i] != "1":
    print(s[i])
    flag = False
    break

if flag:
  print("1")

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

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

s,k = [ input() for i in range(2) ]

count = 0
while count != len(s) and s[count]=="1":
    count += 1

print(count)

if int(k) <= count:
    print(1)
else:
    print(s[count])


# coding: utf-8

s,k = [ input() for i in range(2) ]

count = 0
while count != len(s) and s[count]=="1":
    count += 1

if int(k) <= count:
    print(1)
else:
    print(s[count])

Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
#coding: utf-8
N = input()
K = int(input())
if N[0] == 1:
    for i in range(1, K+1):
        if N[i] != 1:
            print(N[i])
            break
        else:
            print(1)
            break
else:
    print(N[0])

#coding: utf-8
N = input()
K = int(input())
if N[0] == 1:
    for i in range(1, len(N)):
        if N[i] != 1:
            print(N[i])
            break
else:
    print(N[0])

#coding: utf-8
N = input()
K = int(input())
ans = 0
for i in range(min(K, len(N))):
    if int(N[i]) != 1:
        ans = N[i]
        #print(N[i])
        break
print(ans if ans != 0 else 1)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
n = input()
k = int(input())
if len(n) > 1:
  if k > 1:
    if n[0] is not '1':
      print(n[0])
    else:
      print(1)
  else:
    print(n[0])
else:
  print(n[0])

n = input()
k = int(input())
if len(n) > 1:
  for i in range(k):
    if n[i] is not '1':
      print(n[i])
      exit()
print(n[0])

Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

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

if(k == 1):
    print(n[0])
elif(len(n)==1):
    print(n)
elif(n[0]== '1'):
    i = 1
    while(n[i] == '1' or i + 1 < len(n)):
        i += 1
    if(k <= i):
        print(1)
    else:
        print(n[i])
else:
    print(n[0])

s = input()
if(s[0] != 1):
  print(s[0])
else:
  i = 1
  while(s[i] == 1):
    i += 1
    print(s[i])

n = input()
k = int(input())

if(k == 1):
    print(n[0])
elif(len(n)==1):
    print(n)
elif(n[0]== '1'):
    i = 1
    while(n[i] == '1'):
        i += 1
        if(i == len(n)):
            break
    if(k <= i):
        print(1)
    else:
        print(n[i])
else:
    print(n[0])

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
S = input()
K = int(input())
if S[0] != "1" or K != 1 or len(S) == 1:
  print(S[0])
else :
  print(S[1])

S = input()
K = int(input())
result = "1"
for i in range(K):
  if S[i] != "1":
    result = S[i]
    break
print(result)

Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
s = input()
k = int(input())
cnt = 0
for i in s:
    if i == 1:
        cnt += 1
        if cnt == 4:
            print(1)
    else:
        print(i)
        break


s = input()
k = int(input())
cnt = 0
ans = 1
for i in s:
    if i == 1:
        cnt += 1
    else:
        ans = i
        break

if k <= cnt:
    print(1)
else:
    print(ans)

s = input()
k = int(input())
cnt = 0
ans = 1
for i in s:
    if i == "1":
        cnt += 1
    else:
        ans = i
        break

if k <= cnt:
    print(1)
else:
    print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
s=input()
k=int(input())
if len(s)==1 or s[0]!=1 or k==1:print(s[0])
else:print(s[1])

s=input()
k=int(input())-1
i=0
while s[i]=="1" and k:k,i=k-1,i+1
print(s[i])

Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

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

i = 0
while i < len(s):
    if int(s[i]) ** (500 * 10 **12) >= k:
#         print(i, s[i], int(s[i]) ** (500 * 10 *12))
        break
    i += 1
print(s[i])

import math
s = input()
k = int(input())

i = 0
while i < len(s):
    if int(math.log(s[i])) * (500 * 10 **12) >= math.log(k):
#         print(i, s[i], int(s[i]) ** (500 * 10 *12))
        break
    i += 1
print(s[i])

s = input()
k = int(input())

i = 0
while i < k - 1 and i < len(s):
    if s[i] != '1':
        break
    i += 1
print(s[i])


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

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

for i in range(k):
    if s[k] != "1":
        print(s[k])
        exit()
print(1)

s = input()
k = int(input())

for k_i in range(k):
    if s[k_i] != "1":
        print(s[k_i])
        exit()
print(1)

Verdicts: Runtime Error

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
def resolve():
    S = input()
    K = int(input())
    ans = []
    for i in range(len(S)):
        if S[i] == "1":
            ans.append("1")
        else:
            if len(ans) < K:
                print(S[i])
            else:
                print("1")
resolve()

def resolve():
    S = input()
    K = int(input())
    for i in range(K):
        if S[i] != "1":
            print(S[i])
            exit()
    print("1")
resolve()

Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
s = input()
k = int(input())
key = 0
for i in range(0,len(s)):
    if s[i] != 1:
        key = i
        break
if k < key:
    print(1)
else:
    print(s[key])

s = input()
k = int(input())
key = 0
for i in range(len(s)):
    if s[i] != str(1):
        key = i
        break 
if k < key + 1:
    print(1)
else:
    print(s[key])

Verdicts: Wrong Answer

Accepted
Problem: Mr. Infinity has a string S consisting of digits from `1` to `9`. Each time the date changes, this string changes as follows:    * Each occurrence of `2` in S is replaced with `22`. Similarly, each `3` becomes `333`, `4` becomes `4444`, `5` becomes `55555`, `6` becomes `666666`, `7` becomes `7777777`, `8` becomes `88888888` and `9` becomes `999999999`. `1` remains as `1`.  For example, if S is `1324`, it becomes `1333224444` the next day, and it becomes `133333333322224444444444444444` the day after next. You are interested in what the string looks like after 5 \times 10^{15} days. What is the K-th character from the left in the string after 5 \times 10^{15} days?

Submission attempts (in order):
s = list(input())
k = int(input())
if s[0] == "1":
    print(1)
elif len(s) == 1:
    print(s)
else:
    print(s[0])

import sys
s = list(input())
k = int(input())
if len(s) == 1:
    print(s[0])
elif k == 1:
    print(s[0])
else:
    for i in range(k):
        if s[i] != "1":
            print(s[i])
            sys.exit()
    print(1)

Verdicts: Wrong Answer

Accepted