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

if k <= 5000000000000000:
  for n in s:
    if k == 0:
      print(n)
    elif n == '1':
      k = k-1
    else:
      print(n)

else:
  for n in s:
    if n == '1':
      k = k-1
    elif n == '2':
      if k >= 2ae0i0:
      else:
        print(n)
    else:
    print(n)


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

for n in s:
  if k < 0:
    print(s[s.index(n)-1])
  elif n == '1':
    k = k-1
  else:
    print(n)


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

if k <= 5000000000000000:
  for n in s:
    if k == 0:
      print(s[s.index(n)-1])
    elif n == '1':
      k = k-1
    else:
      print(n)

else:
  for n in s:
    if n == '1':
      k = k-1
    elif n == '2':
      if k >= 10**15:
        print()
      else:
        print(n)
    else:
      print(n)


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

c = 0
for ch in s:
  if not ch == '1':
    break
  c += 1
n = s[c] if c < len(S) else None
a = n if n and c < K else S[0]
print(a)


s = input()
K = (int)(input())
k = K
for n in s:
  if k == 0:
    print(n)
  elif n == '1':
    k = k-1
  else:
    print(n)
if k == 0:
  print(s[K-1])


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

for n in s:
  if k == 0:
    print(s[s.index(n)-1])
  elif n == '1':
    k = k-1
  else:
    print(n)


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

c = 0
for c in s:
  if not c == '1':
    break
  c += 1
n = s[c] if c < len(S) else None
a = n if n and c < K else S[0]
print(a)


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

c = 0
for ch in s:
  if not ch == '1':
    break
  c += 1
n = s[c] if c < len(s) else None
a = n if n and c < k else s[0]
print(a)


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

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

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

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

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

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

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

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, s in enumerate(S, 1):
  if s == 1:
    if i == K:
      print(s)
      break
    else:
      continue
  else:
    print(s)
    break

S = input()
K = int(input())
 
for i, s in enumerate(S, 1):
  if s == '1':
    if i == K:
      print(s)
      break
    else:
      continue
  else:
    print(s)
    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):
n=list(input())
k=int(input())
if len(n)==1:
  print('1')
else:
  one_list=[]
  while len(n)!=0:
    if n[0]=='1':
      one_list.append(n.pop(0))
    else:
      break
  print(one_list)
  if k<=len(one_list):
    print('1')
  else:
    print(n[0])

n=list(input())
k=int(input())
if len(n)==1:
  print('1')
else:
  one_list=[]
  while len(n)!=0:
    if n[0]=='1':
      one_list.append(n.pop(0))
    else:
      break
  if 0<len(one_list)<=k:
    print('1')
  else:
    print(n[0])



n=list(input())
k=int(input())
if len(n)==1:
  print('1')
else:
  one_list=[]
  while len(n)!=0:
    if n[0]=='1':
      one_list.pop(n.pop(0))
    else:
      break
  if 0<len(one_list)<=k:
    print('1')
  else:
    print(n[0])

n=list(input())
k=int(input())
if len(n)==1:
  print('1')
else:
  one_list=[]
  while 1==1:
    if n[0]=='1':
      one_list.pop(n.pop(0))
    else:
      break
  if 0<len(one_list)<=k:
    print('1')
  else:
    print(n[0])



n=list(input())
k=int(input())
if len(n)==1 and n[0]=='1':
  print('1')
else:
  one_list=[]
  while len(n)!=0:
    if n[0]=='1':
      one_list.append(n.pop(0))
    else:
      break
  if k<=len(one_list):
    print('1')
  else:
    print(n[0])



Verdicts: Wrong Answer

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 = list(map(int, input()))
k = int(input())

ans = 1

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

print(ans)
		
	

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

ans = 1

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

print(ans)
		
	

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

ans = 1

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

print(ans)

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

if K == 1:
    print(S[0])
    exit()
else:
    for i in range(K):
        if S[i] != '1':
            print(S{i})
            exit()
print(1)


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

if K == 1:
    print(S[0])
    exit()
else:
    for i in range(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):
import sys

input = sys.stdin.readline

def main():
    ans = 0
    s = input()
    k = int(input())
    for i in range(len(s)):
        if s[i] != '1':
            if k > i+1:
                ans = s[i]
            else:
                ans = '1'
    print(ans)

if __name__ == '__main__':
    main()

import sys

input = sys.stdin.readline

def main():
    ans = 0
    s = input().rstrip('\n')
    k = int(input())
    for i in range(len(s)):
        if s[i] != '1':
            if k < i+1:
                ans = s[i]
            else:
                ans = '1'
    print(ans)

if __name__ == '__main__':
    main()

import sys

input = sys.stdin.readline

def main():
    ans = ''
    index = 0
    s = input().rstrip('\n')
    k = int(input())
    for i in range(len(s)):
        if s[i] != '1':
            ans = s[i]
            index = i
            break
    if ans == '' or k < index+1:
        ans = '1'
    print(ans)

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 int(s[0]) == 1:
  one_count = 0
  i = 0
  while s[i] == 1:
    one_count += 1
    i += 1
  if k <= one_count:
    print(1)
  else:
    print(s[one_count])
else:
  print(s[0])


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

if int(s[0]) == 1:
  one_count = 0
  i = 0
  while i < len(s) and int(s[i]) == 1:
    one_count += 1
    i += 1
  if k <= one_count:
    print(1)
  else:
    print(s[one_count])
else:
  print(s[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):
    for s in S[:K]:
        if s!="1":
            break
    else:
        print("1")
else:
	for s in S:
    	if s!="1" :
        	print(s)
        	break

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

N=input()
for count in range(len(N)):  
    if N[count]!="1":    break
if int(input())>count:    print(N[count])
else:    print(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):
S,K=input().split()
k=int(K)
for i in range(0,k):
    if S[i]!="1":
        print(S[i])
        break
else:
    print("1")


S=input()
k=int(input())
for i in range(0,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())
for i in range(5*10**15):
    s = s.replace('2','22')
    s = s.replace('3','333')
    s = s.replace('4','4444')
    s = s.replace('5','55555')
    s = s.replace('6','666666')
    s = s.replace('7','7777777')
    s = s.replace('8','88888888')
    s = s.replace('9','999999999')
    s = s[:k]
print(s)

s = input()
k = int(input())
cnt = 0
while s[:1] == '1':
    s = s[1:]
    cnt +=1
if k <= cnt:
    print('1')
else:
    print(s[: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):
import sys
import numpy as np

n = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))

print(sum(A)-n)

import sys

s = sys.stdin.readline().rstrip()
k = int(sys.stdin.readline())

num=0
cnt1=0
for c in s:
    if c =='1':
        cnt1 +=1
    else:
        num = c
        break
#print(cnt1, num)

if k<=cnt1:
    print(1)
else:
    print(num)

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(len(s)):
  if s[i]!=1:
    print(s[i])
    exit()
print(1)

s=input()
k=int(input())
for i in range(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):
import sys
s = input()
k = int(input())
end = False
for i in range(min(len(s), k)):
    if s[i] != '1':
        print(s[i])
        sys.exit
print(1)

s = input()
k = int(input())
end = False
for i in range(min(len(s), k)):
    if s[i] != '1':
        print(s[i])
        end = True
        break
if end == False:
    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):
from sys import stdin
S = (stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
cnt = 0
for i in S:
    if i == "1":
        cnt += 1
    else:
        ans = i
if cnt == K:
    ans = 1
print(ans)

from sys import stdin
S = (stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
cnt = 0
for i in S:
    if i == "1":
        cnt += 1
    else:
        ans = int(i)
if cnt >= K:
    ans = 1
print(ans)

from sys import stdin
S = (stdin.readline().rstrip())
K = int(stdin.readline().rstrip())
cnt = 0
for i in S:
    if i == "1":
        cnt += 1
    else:
        ans = int(i)
        break
if cnt >= K:
    ans = 1
print(ans)

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())
count = 0
for t in S:
  if t == 1:
    count += 1
  else:
    break
if K <= count:
  print(1)
else:
  print(int(S[count]))

S = input()
K = int(input())
count = 0
for t in S:
  if int(t) == 1:
    count += 1
  else:
    break
if K <= count:
  print(1)
else:
  print(int(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):
s = input()
k = int(input())



co = 0
for i in s:
    co += 1
    if i == "1":
        if k == co:
            print(1)
            break
        else:
            continue
    else:
        print(int(i))


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


gosentyo = 5 * (10 ** 15)



flg = 0
if k <= 100:
    for i in range(len(s)-1):
        if s[i] != "1":
            print(s[i])
            break
        else:
            if k-1 == i:
                print(1)
                flg = 1
                break

if flg == 0:
    for i in range(len(s)):
        if s[i] == "1":
            continue
        else:
            print(s[i])
            break


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



co = 0
for i in s:
    co += 1
    if i == "1":
        if k == co:
            print(1)
            break
        else:
            continue
    else:
        print(str(i))


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



co = 0
for i in s:
    co += 1
    if i == "1":
        if k == co:
            print(1)
            break
        else:
            continue
    else:
        print(i)


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




co = 0
for i in s:
    co += 1
    if i == "1":
        if k == co:
            print(1)
            break
        else:
            continue
    else:
        print(i)


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


gosentyo = 5 * (10 ** 15)



flg = 0
if k <= 100:
    for i in range(len(s)-1):
        if s[i] != "1":
            print(s[i])
            break
        else:
            if k-1 == i:
                print(1)
                flg = 1
                break

if flg == 0:
    for i in range(len(s)):
        if i == len(s)-1:
            print(1)
        if s[i] == "1":
            continue
        else:
            print(s[i])
            break


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



co = 0
for i in s:
    co += 1
    if i == "1":
        if k == co:
            print(1)
            break
        else:
            continue
    else:
        print(int(i))
        break


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

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):
MOD = 1000000007
def fast_power(base, power):
    """
    Returns the result of a^b i.e. a**b
    We assume that a >= 1 and b >= 0

    Remember two things!
     - Divide power by 2 and multiply base to itself (if the power is even)
     - Decrement power by 1 to make it even and then follow the first step
    """

    result = 1
    while power > 0:
        # If power is odd
        if power % 2 == 1:
            result = (result * base) % MOD

        # Divide the power by 2
        power = power / 2
        # Multiply base to itself
        base = (base * base) % MOD

    return result


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

tyo = 5e15

char = [int(ss) for ss in s]

res = 0

_sum = 0
ok = 0

for i in range(k):
    _sum = _sum + (fast_power(s[i], tyo))
    if _sum >= k and ok == 0:
        res = s[i]
        ok = 1

# for num in char:

#     if _sum >= k and ok == 0:
#         res = num
#         ok = 1

print(res)


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

char = [ss for ss in s]


res = '1'

_sum = 0
for num in range(k):
    if num != '1':
        res = num
        break

print(res)


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

char = [ss for ss in s]


res = '1'

_sum = 0
for i in range(k):
    if s[i] != '1':
        res = s[i]
        break

print(res)


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):
#!/usr/bin/env python

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

flag = True
for i in range(k):
    if s[i] == '1':
        print(s[i])
        flag = False

if flag:
    print(s[1])


#!/usr/bin/env python

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

flag = True
for i in range(k):
    if s[i] == '1':
        print(s[i])
        flag = False

if flag:
    print(s[1])


#!/usr/bin/env python


def main():
    s = input().strip()
    k = int(input().strip())

    if s[0] != '1':
        print(s[0])
        return

    count_c = 0
    for c in s:
        if c == '1':
            count_c += 1

    if k <= count_c:
        print(s[k-1])
    else:
        print(s[count_c])


main()


#!/usr/bin/env python


def main():
    s = input().strip()
    k = int(input().strip())

    
    if s[0] != '1':
        print(s[0])
        return

    count_one = 0
    for c in s:
        if c == '1':
            count_one += 1
        else:
            break

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


main()


Verdicts: Runtime Error

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

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

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


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

Verdicts: Wrong Answer

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())
ans = 1
for i in range(min(len(S), K)):
  if S[i] == 1:
    continue
  else:
    ans = int(S[i])
    break
print(ans)

 
  
  
    

S = input()
K = int(input())
ans = 1
for i in range(min(len(S), K)):
  if S[i] == '1':
    continue
  else:
    ans = int(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().rstrip()
K = int(input())
c = 0
for item in S:
  if item == "1":
    c+=1
  else:
    break
n = S[c] if c < len(S) else None
a = n if n and c < K and else S[0]
print(a)

S = input().rstrip()
K = int(input())
a = S[1] if K > 1 and S[0] == "1" and len(S) > 1 else S[0]

S = input().rstrip()
K = int(input())
c = 0
for item in S:
  if not item == "1":
    break
  c+=1
n = S[c] if c < len(S) else None
a = n if n and c < K else S[0]
print(a)

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

for i in S:
  if i != 1:
    print(i)
    exit()
    
print(S[0])

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

c = "1"

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

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):
l=list(input())
k=int(input())
m=[0]*len(l)
for i in range(len(l)):
    var=pow(int(l[i]),5*pow(10,15))
    if(i==0):
        m[i]+=var
    if(i>=1):
        m[i]+=(m[i-1]+var)
    if(k<=m[i]):
        print(l[i])
        exit()

l=list(input())
k=int(input())
m=[0]*len(l)
for i in range(len(l)):
    var=pow(int(l[i]),100)
    if(i==0):
        m[i]+=var
    if(i>=1):
        m[i]+=(m[i-1]+var)
    if(k<=m[i]):
        print(l[i])
        exit()

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())
k=1
for s in S:
    if s!=1:
        print(s)
        exit()
    if k==K:
        print(s)
        exit()
    k+=1

S=input()
k=int(input())
for s in S:
    if s!=1:
        print(s)
        exit()

S=input()
K=int(input())
for s in S:
    if s!=1:
        print(s)
        break

S=input()
K=int(input())
for s in S:
    if s!=1:
        print(s)
        break
else:
    print(1)

S=input()
K=int(input())
k=0
for s in S:
    k+=1
    if k==K:
        print(s)
        exit()
    if s!="1":
        print(s)
        break
else:
    print(1)

Verdicts: Wrong Answer

Wrong Answer

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 S[K+1]:
    if i != "1":
        print(i)
        break
else:
    print(i)

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

count = 0
while count < K:
    if S[count] != "1":
        print(S[count])
        break
    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=list(input())
k=int(input())

if S[0]=='1':
  if k==1:
    print(S[0])  
  elif k<(10**14+1):
    print(S[2])
  else:
    print(S[1])

elif S[0]=='2':
  if k<(10**14+1):
    print(S[0])
  else:
    if S[1]!=1:
      print(S[1])
    else:
      print(S[2])
      
else:
  print(S[0])

import re
S=str(input())
k=int(input())

if set(S)=={'1'}:
  print(1)
  
else:
  x=re.search(r'[2-9]',S).start()
      
  if S[0]=='1':
    if k<=x:
      print(S[0])
    else:
      print(S[x])     
  else:
    print(S[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):
b=list(input())
a=int(input())
if b[0]=="1":
  print(1)
else:
  print(b[1])


s=input()
k=int(input())
for i in range(k):
  if s[i]!="1":
    break
print(s[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):
N = list(input())
K = int(input())
for i in range(len(K)) :
  a = int(N[i])
  if a!=1:
    print(a)
    exit()
print(1)

N = list(input())
K = int(input())
for i in range(len(K)) :
  a = int(i)
  if a!=1:
    print(a)
    exit()
print(1)

N = list(input())
K = int(input())
for i in N :
  a = int(i)
  ans += a**(5*10**15)
  if ans>=K:
    print(a)

N = list(input())
K = int(input())
for i in range(K) :
  a = int(N[i])
  if a!=1:
    print(a)
    exit()
print(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):
import sys
import math

s=input()
k = int(input())
cnt = False
ans=0
for i in range(len(s),k):
    if s[i] != '1':
        ans = s[i]
        cnt = True
        break
    cnt+=1
if (not cnt):
    print(1)
else:
    print(ans)


import sys
import math

s=input()
k = int(input())
cnt = False
ans=0
for i in range(0,k):
    if s[i] != '1':
        ans = s[i]
        cnt = True
        break
if (not cnt):
    print(1)
else:
    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 = input()
k= int(input())
for i in range(k):
  if s[i] != 1:
    print(s[i])
    exit()
print(1)

s = input()

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

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):
# coding: utf-8
# Your code here!

s = input()
r = int(input())

if r <= len(s):
    print(s[r-1])
else:
    for i in s:
        if(i!="1"):
            print(i)
            break

# coding: utf-8
# Your code here!

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

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

S=input()
K=int(input())
tmp = 0
for i in S:
    if i=='1':
        tmp += 1
    else:
        break
if K <= tmp:
    print(1)
else:
    print(S[tmp])

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):
l=list(map(int,input().split()))
n=l[0]
m=l[1]
q=l[2]
lr=[]
pq=[]
for i in range(m):
    lr.append(input())
for i in range(q):
    pq.append(input())
w=0    
for i in range(q):
    ppqq=list(map(int,pq[i].split()))
    w=0
    for j in range(m):
        llrr=list(map(int,lr[j].split()))
        if llrr[0]>= ppqq[0] and llrr[1]<=ppqq[1]:
            w+=1
    print(w)


ss=input()
k=int(input())
s=[int(i) for i in ss ]
#ls=len(s)
j=0
q=0
w=0
while q==0:
    if s[j]==1:
        w+=1
        if k<=w:
            print(1)
            q=1
        j+=1
    else:
        print(s[j])
        q=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 = int(input())
k = int(input())


ind = 0
num = 1


for i in range(len(s)):
    ind = i+1
    if s[i] != 1:
        num = int(s[i])
        break
        
if k>= ind:
    ans = num
else:
    ans = 1
    
print(ans)

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


ind = 0
num = 1


for i in range(len(s)):
    ind = i+1
    if s[i] != 1:
        num = int(s[i])
        break
        
if k>= ind:
    ans = num
else:
    ans = 1
    
print(ans)

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




num = 1


for i in range(len(s)):
    ind = i+1
    if s[i] != '1':
        num = int(s[i])
        break
        
if k>= ind:
    ans = num
else:
    ans = 1
    
print(ans)

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



num = 1


for i in range(len(s)):
    ind = i+1
    if s[i] != '1':
        num = int(s[i])
        break
        
if k>= ind:
    ans = num
else:
    ans = 1
    
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):
def To_Infinity(s , k):

    ans = 0

    if s[0] == 1:
        if k == 1:
            ans = 1
        else:
            ans = s[1]
    else:
        ans = s[0]

    return ans
def main():
    s = list(int(input()))
    k = int(input())
    print(To_Infinity(s , k))

if __name__ == '__main__':
    main()

def To_Infinity(s , k):

    ans = ""

    s1 = s.lstrip("1")

    if k - (len(s) - len(s1)) > 0:
        ans = s1[0]
    else:
        ans = "1"

    return ans
def main():
    s = str(input())
    k = int(input())
    print(To_Infinity(s , k))

if __name__ == '__main__':
    main()

Verdicts: Runtime Error

Accepted