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):
S = input()
K = input()
count = 0
for i in range(len(S)):
    if S[i]=="1":
        count+=1
    else:
        break
        
print(1) if K <= count else print(S[count])


S = input()
K = input()
count = 0
for i in range(len(S)):
    if S[i]=="1":
        count+=1
    else:
        break
        
print(1) if int(K) <= count else print(S[count])


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())

D=5000000000000000

tmp=0
for s in S:
  tmp+=int(s)*5000000000000000 if s!='1' else 1
  if tmp>K:
    print(s)

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

D=5000000000000000

tmp=0
for s in S:
  t=1
  for _ in range(D):
    t=t*int(s)
    if tmp+t>=K:
      print(s)
      break
  else:
    continue
  break

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

D=5000000000000000

tmp=0
for s in S:
  tmp+=int(s)*5000000000000000 if s!='1' else 1
  if tmp>K:
    print(s)

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

D=5000000000000000

tmp=0
for s in S:
  t=1
  for _ in range(D):
    t=t*int(s)
    if tmp+t>=K:
      print(s)
      break
  else:
    tmp+=t
    continue
  break

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

D=5000000000000000

tmp=0
for s in S:
  if s=='1':
    tmp+=1
    if tmp>=K:
      print(s)
      break
    continue
    
  t=1
  for _ in range(D):
    t=t*int(s)
    if tmp+t>=K:
      print(s)
      break
  else:
    tmp+=t
    continue
  break

Verdicts: Wrong Answer

Time Limit Exceeded

Runtime Error

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):
s=input()
k=int(input())
on=[int(j) for j in range(2,10)]
i=0
if int(s[0]) in on:
    print(s[0])

while int(s[i]) not in on:
    if s[i] in on:
        print(s[i])
        break
    elif i==k-1:
        print(s[k-1])
        break
    i+=1

s=input()
k=int(input())
on=[int(j) for j in range(2,10)]
i=0
if int(s[0]) in on:
    print(s[0])

while int(s[i]) not in on:
    if s[i] in on:
        print(s[i])
        break
    elif i==k-1:
        print(s[k-1])
        break
    i+=1

s=input()
k=int(input())
on=[int(j) for j in range(2,10)]
for i in range(k):
    if int(s[i]) in on:
        print(s[i])
        break
    elif i==k-1:
        print('1')
    else:
        i+=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 = int(input())
K = int(input())
S_list = [int(x) for x in list(str(S))]

def saiki(i):
  if i == len(S_list):
    print(S_list[i-1])
    exit()
  if S_list[i] > 2:
    print(S_list[i])
    exit()
  if S_list[i] == 2:
    if K > 5*1000000000000000:
      print(2)
      exit()
    else:
      saiki(i+1)
  if S_list[i] == 1:
    saiki(i+1)

print(saiki(0))

S = int(input())
K = int(input())
S_list = [int(x) for x in list(str(S))]
 
def saiki(i):
  if i == len(S_list):
    print("1")
    exit()
  if K == i:
    print("1")
    exit()
  if S_list[i] > 1:
    print(S_list[i])
    exit()
  if S_list[i] == 1:
    saiki(i+1)
 
print(saiki(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):
s = input()
k = int(input())
ans = 1
for i in range(k):
    if i!= '1':
        ans = i
        break
print(ans)

s = 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 = list(input())
K = int(input())

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

S = list(str(input()))
K = int(input())
#rint(S)
ans = 1
for i in range(K):
    #print(i)
    if S[i] != '1' :
        ans = S[i]
        break
print(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 = str(input())
k = int(input())
c = 0
for i in range(len(s)):
    if s[i] == "1":
        c += 1
    else:
        continue
if c >= k:
    print(1)
    break
for i in range(len(s)):
    if s[i] != "1":
        print(s[i])
        break


s = str(input())
k = int(input())
c = 0
for i in range(len(s)):
    if s[i] == "1":
        c += 1
    else:
        break

if c >= k:
    print("1")
else:
    for i in range(len(s)):
        if s[i] != "1":
            print(s[i])
            break


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 sys

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

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

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

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())
ret = "1"
for i in K:
    if len(S) <= K:
        break
    if i != "1":
        ret = i
        break
print(ret)


S = input()
K = int(input())
ret = "1"
for i in K:
    if len(S) <= K:
        break
    if S[i] != "1":
        ret = S[i]
        break
print(ret)


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


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):
a = int(input())
 
if a<105:
    print(0)
elif 105<= a < 135:
    print(1)
elif 135<= a < 165:
    print(2)
else:
    print(3)


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

for i,a in enumerate(s):
    if (a != '1' ) or k==i+1:
        ans = int(a)
        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())
if K==1:
    print(S[0])
else:
    ans=1
    for i in range(len(S)):
        if S[i]==1:
            pass
        else:
            ans=S[i]
            break
    print(ans)

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

i=0
while i<=len(S)-1:
    if S[i]=="1":
        i+=1
    else:
        break

if K<=i:
    print("1")
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=str(input())
K=int(input())

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



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

for i in range(K):
    if S[i] != '1':
        print(S[i])
        exit()
        
print(S[K-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(len(s)):
    if s[i]=='1':
        pass
    else:
        if i+1<=k:
            print(s[i])
        break
print(1)

s=str(input())
k=int(input())
a=0
for i in range(len(s)):
    if s[i]=='1':
        pass
    else:
        if i+1<=k:
            print(s[i])
            a=1
        break
if a==0:
    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=list(str(input()))
k=int(input())
for i in range(len(S)):
    si=int(S[i])
    ti=si**(5*10**15)
    if k<=ti:
        print(S[i])
        break
    else:
        k-=ti

S=list(str(input()))
k=int(input())
A=[]
for i in range(len(S)):
    si=int(S[i])
    ti=si**(k-1)
    while ti > 0:
        A.append(S[i])
        ti=ti-1
print("".join(A))

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

Verdicts: 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 = input()
if len(K) > 100:
    K = 110
else:
    K = int(K)


def main():
    if S[0] != '1':
        print(S[0])
        return

    i = 0
    while i < len(S) - 1 and S[i] == '1':
        i += 1

    if K-1 <= i:
        print('1')
        return

    if i == len(S) - 1:
        print(S[i])
        return

    print(S[i+1])


if __name__ == '__main__':
    main()


S = input()
K = int(input()) - 1


def main():
    if S[0] != '1':
        print(S[0])
        return

    i = 0
    while i < len(S) - 1 and S[i] == '1':
        i += 1

    if K <= i:
        print('1')
        return

    print(S[i+1])


if __name__ == '__main__':
    main()


S = input()
K = input()
if len(K) > 100:
    K = 110
else:
    K = int(K)


def main():
    if S[0] != '1':
        print(S[0])
        return

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

    if i == len(S) - 1:
        print('1')
        return

    if K <= i:
        print('1')
        return

    print(S[i])


if __name__ == '__main__':
    main()


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 s[0] != '1':
    print(s[1])


s = 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())
ans=0
for i in range(len(s)):
    if s[i]!=1:
        ans=s[i]
        break
    else:
        bns+=1
if k<=bns:
    print(1)
else:
    print(ans)

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

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

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


Verdicts: Runtime Error

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())
kazu=5*10**5

for i in range(len(S)):
    print(K)
    if K<=int(S[i])**kazu:
        print(int(S[i]))
        break
    else:
        K-=int(S[i])**kazu


S=input()
K=int(input())
kazu=5*10**5

for i in range(len(S)):
    print(K)
    if K<=int(S[i])**kazu:
        print(int(S[i]))
        break
    else:
        K=K-int(S[i])**kazu


S=input()
K=int(input())
kazu=5*10**5

for i in range(len(S)):
    if K<=int(S[i])**kazu:
        print(int(S[i]))
        break
    else:
        K=K-int(S[i])**kazu


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 math
S = list(map(int, input()))
K = int(input())
after_S = 0
days = 5000000000000000-1
for n in S:
    if n == 1:
        after_S += 1
        if math.log(after_S) >= math.log(n):
            print(n)
            break

    after_S += days * math.log(n)
    if after_S >= math.log(K):
        print(n)
        break

S = list(map(int, input()))
K = int(input())
if len(S) == 1:
    print(S[0])
    exit()

cnt = 0
for s in S:
    if s == 1:
        cnt += 1
if K <= cnt:
    print(1)
else:
    print(S[cnt])


S = list(map(int, input()))
K = int(input())
if len(S) == 1:
    print(S[0])
    exit()

cnt = 0
for s in S:
    if s == 1:
        cnt += 1
    else:
        break

if K <= cnt:
    print(1)
else:
    print(S[cnt])


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())
for i in range(min(len(S), K)):
    if S[i] > 1:
        print(S[i])
        exit()
print(1)

S = input()
K = int(input())
for i in range(min(len(S), K)):
    if int(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())
n=0
for i in s:
    if int(i)==1:
        n+=1
    else:
        break
if n < k:
    pritn(s[n])
else:
    print(1)

s=input()
k=int(input())
n=0
for i in s:
    if i =='1':
        n+=1
    else:
        break
if n < k:
    print(s[n])
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):
a=input()
k=int(input())
x=5*pow(10,15)
i=0
while k>0:
    k-=pow(int(a[i]),x)
    i+=1
print(a[i-1])

a=input()
k=int(input())
if int(a)<10:
    a=str(int(a)*11)
i=0
x=0
while k>0:
    if a[i]=='1':
        k-=1
        i+=1
        x=1
    else: k=-1   
print(a[i-x])

a=input()
k=int(input())
x=5*pow(10,15)
i=0
while k>0:
    k-=int(str(a)[i])*x
    i+=1
print(str(a)[i-1])

a=input()
k=int(input())
x=5*math.pow(10,15)
i=0
while k>0:
    k-=int(str(a)[i])*x
    i+=1
print(str(a)[i-1])


a=input()
k=int(input())
if int(a)<10:
    a=str(int(a)*11)
i=0
x=0

while k>=0:
    if a[i]=='1':
        k-=1
        i+=1
        if k==0:
            x=1
            k=-1
    else: 
        k=-1


print(a[i-x])

Verdicts: Time Limit Exceeded

Wrong Answer

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())
while True:
    if S[0]!="1":
        print(S[0])
        break
    else:
        continue

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

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

Verdicts: 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())

count_1=0
while s[0]==1:
  count_1+=1
  s.remove[0]
if count_1>=k:
  print('1')
else:
  print(s[0])

s=input()
S=''
k=int(input())
for num in s:
  S+=num*(int(num)**5000000000000000)
print(S[k])

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

count_1=0
while s!='':
  if s[0]=='1':
    count_1+=1
    s=s.lstrip('1')
if count_1>=k:
  print('1')
else:
  print(s[0])


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

count_1=0
while s!='':
  if s[0]=='1':
    count_1+=1
    s=s[1:]
  else:
    break
if count_1>=k:
  print('1')
else:
  print(s[0])


Verdicts: Wrong Answer

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=[int(i) for i in input()]
k=int(input())
a=5000000000000000
for i in s:
  k-=i**a
  if k<0:
    print(i)

s=[int(i) for i in input()]
k=int(input())
#2^10^15=
a=0
for i in s:
  if i==1:
    a+=1
  else:
    break
if k<=a:
  print(1)
else:
  print(s[a])

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())
n=1
while n <= 5000e12:
    if len(S) > K:
        S = S[:K-1]
    str_new_number = ""
    for str_number in S:
        number = int(str_number)
        str_new_number = str_new_number + str_number*number
    S = str_new_number
    n += 1
print(S[K-1])


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

k = 1
while k <= K:
    if S[k-1] != "1":
        print(S[k-1])
        break
    k += 1
else:
    print(1)


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):
S = input()
K = int(input())

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

S = 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())

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

S = input()
K = int(input())
judge = 1

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

if judge != 0:
    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())


a=0
b=0
for i in range(len(S)):
    if int(S[i]) > 1:
        a=i
        b=S[i]
        break
# print(a)
# print(b)
if K< a:
    print (S[a])
    
else:
    print (b)
    
else:
    print (b)

S = 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())
count=0
for i in s:
    count+=int(i)**(5*(10**10))
    if count>=k:
        print(i)
        break

s=input()
k=int(input())
count=0
ans=''
for i in range(k):
    if s[i]=='1':
        count+=1
    else:
        ans=s[i]
        break
print(1 if count==k else 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):
S = list(input())
K = int(input())

ref = 0
for i in range(len(S)):
    if S[i] == "1":
        ref += 1
    else:
        break

ans = ""
if ref == 0:
    ans = S[0]
else:
    if ref >= K:
        ans = "1"
    else:
        ans = S[ref-1]

print(ans)

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

ref = 0
for i in range(len(S)):
    if S[i] == "1":
        ref += 1
    else:
        break

ans = ""
if ref == 0:
    ans = S[0]
else:
    if ref >= K:
        ans = "1"
    else:
        ans = S[ref]

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())

a = 0
b = 0

for i in range(len(S)):
    if S[i] = 1:
        a = i+1
    else:
        b = S[i]
        break

if K <= a:
    print(1)
else:
    print(b)


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

a = 0
b = 0

for i in range(len(S)):
    if S[i] == "1":
        a = i+1
    else:
        b = S[i]
        break

if K <= a:
    print(1)
else:
    print(b)


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):
sS = input().rstrip()
#iK = int(input())
if sS[0] == "1":
    if iK !=1:
        print(sS[1])
    else:
        print(sS[0])
else:
    print(sS[0])



sS = input().rstrip()
iK = int(input())

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


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 c in range(len(s)):
    if s[c] == 1:
        k -= 1
        if k >= 0:
            print(1)
            break
    else:
        print(s[c])
        break

s = input()
k = int(input())
for c in range(len(s)):
    if s[c] == 1:
        k -= 1
        if k < 0:
            print(1)
            break
    else:
        print(s[c])
        break

s = input()
k = int(input())
for c in range(len(s)):
    if s[c] == 1:
        k -= 1
        if k > 0:
            print(1)
            break
    else:
        print(s[c])
        break

s = input()
k,counter,n = int(input()),0,0
while counter < len(s):
    if s[counter] == "1":
        n += 1
    counter += 1
if n == len(s):
    print(1)
else:
    counter = 0
    while counter < k:
        if s[counter] != "1":
            print(s[counter])
            break

s = input()
k = int(input())
for c in range(min(len(s),k)):
    if s[c] != "1":
        print(s[c])
        exit()
print(1)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

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):
s = input().strip()
k = int(input())

count = 0
for i in range(k):
    c = s[i]
    if c != '1':
        print(c)
    else:
        count += 1
else:
    print('1')

s = input().strip()
k = int(input())

count = 0
for i in range(min(len(s), k)):
    c = s[i]
    if c != '1':
        print(c)
        break
    else:
        count += 1
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 = True

if len(s)==1:
    print(int(s))
    exit()

new = ''
for i in len(k):
    if s[i]!='1':
        flag = False
        new += i

if flag:
    print(1)
else:
    print(new[0])

s = input()
k = int(input())
flag = False

for i in range(min(len(s), k)):
    if s[i] != '1':
        ans = int(s[i])
        flag = True
        break

if flag:
    print(ans)
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):
"""
C - To Infinity
"""
s_list = input()
K = int(input())

print(s_list[0])

"""
C - To Infinity
"""
s_list = input()
K = int(input())


for s in range(min(len(s_list), K)):
    if s_list[s] != "1":
        print(s_list[s])
        break
else:
    print(s_list[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):
s = input()
k = int(input())

if k <= len(s):
  print(s[k-1])
elif s[:k] == '1'*k:
  print(1)
else:
  print(s.translate(str.maketrans('','','1'))[0])
  

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

i = 0
while s[i] == '1' or i+1 < k:
	i += 1  
print(int(s[i]))  

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

a = 0
for i in range(k+1):
  if s[i] != '1':
    a = 1
    print(int(s[i]))
    break
if a = 0:
  print(1)

s = list(map(int,list(input())))
k = int(input())

for j in range(1,5*(10**15)):
  a = ''
  for i in range(len(s)):
    a += str(s[i])*s[i]**j
  if len(a) >= k:
    print(a[k-1])
    break


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

i = 0

while s[i] == '1' and i < k-1:
  i += 1

print(int(s[i]))

Verdicts: Runtime Error

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):
str = map(int,list(input()))
for i in str :
  if i != 1 :
    print (i)
    break
print(1)

str = map(int,list(input()))
k = int (input())
counter = 1
for i in str :
  if i != 1 :
    ans = i
    break
  ans = 1
  if counter >= k:
      break
  counter += 1
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):
import sys
s=input()
k=int(input())

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

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted