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

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

S = input()
K = int(input())
 
if K == 1:
  print(int(S[0]))
elif len(S) == 1:
  print(int(S))
elif S[0] == "1":
  print(int(S[0]))
else:
  print(int(S[1]))

S = input()
K = int(input())
 
one = True
for i in range(K):
  if S[i] != "1":
    print(int(S[i]))
    one = False
    break
if one:
  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):
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def solve():
    s = input()
    n = int(input())
    idx = 0
    slen = len(s)
    while idx < slen and s[idx] == "1":
        idx += 1
    if idx < n or idx == slen:
        print(1)
    else:
        print(s[idx])


if __name__ == "__main__":
    solve()


s, _ = [input() for _ in range(2)]
s = s.rstrip("1")
print(s[0] if s else "1")


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


def solve():
    s = input()
    n = int(input())
    idx = 0
    slen = len(s)
    while idx < slen and s[idx] == "1":
        idx += 1
        if idx == n:
            print(1)
            return
    if idx == slen:
        print(1)
    else:
        print(s[idx])


if __name__ == "__main__":
    solve()


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=input();
K=input();
i = 0;
for i in range(len(S)) :
    if int(S[i]) > 1 :
        print(S[i]);
        break;
    elif i >= K :
        print(1);


S=input();
K=input();
i = 0;
for i in range(len(S)) :
    if int(S[i]) > 1 :
        print(S[i]);
        break;
    elif i + 1 >= K :
        print(1);


S=input();
K=input();
i = 0;
for i in range(len(S)) :
    if int(S[i]) > 1 :
        print(S[i]);
        break;
    elif i + 1 >= K :
        print(1);


S=input();
K=input();
i = 0;
for i in range(len(S)) :
    if int(S[i]) > 1 :
        print(S[i]);
        break;
    elif i + 1 >= int(K) :
        print(1);
        break;


Verdicts: Runtime Error

Runtime Error

Runtime Error

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

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

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

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(int(s[i]))
        break
else:
    print(1)

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

for i in range(K):
    if S[i]!='1':
        print(int(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())
fl=0
t=0
ans='1'
for i in range(len(s)):
  if s[i]=='1' and fl==0:
    t+=1
  else:
    if fl==0:
      ans=s[i]
      fl=1
if t<=k:
  ans='1'
print(ans)

s=input()
k=int(input())
fl=0
t=0
for i in range(len(s)):
  if s[i]=='1' and fl=0:
    t+=1
  else:
    if fl==0:
      ans=s[i]
      fl=1
if t<=k:
  ans='1'
print(ans)

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

Verdicts: Wrong Answer

Runtime Error

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

Submission attempts (in order):
import sys
s = input()
n = int(input())
if n == 1:
	print(s[0])
	sys.exit()
if 
for i in s:
	if i != '1':
		print(i)
		sys.exit()
print(1)

import sys
s = input()
n = int(input())
cnt = 0
if n == 1:
	print(s[0])
	sys.exit()
for i in s:
	if i == '1':
		cnt += 1
	else:
		break
if n <= cnt:
	print(1)
	sys.exit()
	
for i in s:
	if i != '1':
		print(i)
		sys.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 = str(input())
k = int(input())


print(s[0])

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

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

ans = 1
for i in range(k):
    #print("hoge")
    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):
import math, string, fractions, heapq, re, array, bisect, sys, random, time, copy
import itertools as it
import operator as op
import collections as cl
import functools as ft

def LI(): return list(map(int, input().split()))
def LI_(): return list(map(lambda x: int(x) - 1, input().split()))
def LF(): return list(map(float, input().split()))
def LS(): return input().split()
def I(): return int(input())
def F(): return float(input())
def S(): return input()


wait_time = 5 * 10**15

if __name__ == "__main__":
    s = S()
    k = input()

    result = ''
    for letter in s:
        if letter != '1':
            result = letter
            break

    if not result:
        result = '1'


import math, string, fractions, heapq, re, array, bisect, sys, random, time, copy
import itertools as it
import operator as op
import collections as cl
import functools as ft

def LI(): return list(map(int, input().split()))
def LI_(): return list(map(lambda x: int(x) - 1, input().split()))
def LF(): return list(map(float, input().split()))
def LS(): return input().split()
def I(): return int(input())
def F(): return float(input())
def S(): return input()


def count_first_1(s):
    count = 0
    first_letter = ''

    for letter in s:
        if letter == '1':
            count += 1
        else:
            first_letter = letter
            break

    return count, first_letter


if __name__ == "__main__":
    s = S()
    k = I()

    count, first_letter = count_first_1(s)

    if not first_letter:
        result = '1'

    elif count >= k:
        result = '1'

    else:
        result = first_letter

    print(result)


Verdicts: Wrong Answer

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

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

ind = -1
for i in range(len(S)):
  if S[i] == 1
    ind = i
  else:
    break

if ind == -1:
  print(S[0])
elif ind + 1 >= K:
  print(1)
else:
  print(S[ind+1])


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

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

if ind == -1:
  print(S[0])
elif ind + 1 >= K:
  print(1)
else:
  print(S[ind+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())

if len(S)==1:
    print(S[0])
    
else:
    lst = []
    for i in range(len(S)):
        if S[i]!='1':
            lst.append(i)
        
    if lst==[]:
        print('1')
    else    
        if K<lst[0]:
            print('1')
        else:
            print(S[lst[0]])

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

if len(S)==1:
    print(S[0])
    
else:
    lst = []
    for i in range(len(S)):
        if S[i]!='1':
            lst.append(i)
        
    if lst==[]:
        print('1')
    else:
        if K<lst[0]+1:
            print('1')
        else:
            print(S[lst[0]])

Verdicts: Runtime Error

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

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

list = [i for i in str(S)]
list.sort()

if K <= len(list):
    if int(list[K-1]) == 1:
        ans = 1
else:
    for i in list:
        if int(i) > 1:
            ans = min(ans,int(i))

print(ans)

S = int(input())
K = int(input())
f = 0
ans = 10

list = [i for i in str(S)]
 
for i in range(K):
    if int(list[i]) > 1:
        ans = min(ans,int(list[i]))
        f = 1
        break

if f == 0:
    print(1)
else:
    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,k=input(),int(input())
for i in s[:k]:
    if i!="1":
        print(i)
        break
    print(1)
    break

s,k=input(),int(input())
a=True
for i in s[:k]:
    if i!="1":
        print(i)
        a=True
        break
    a=False
if not a:
    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())

for c in s:
    if c!=1:
        res=c
        break

print(res)

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

i=0
for c in s:
    if c!="1":
        res=c
        #print(i,res)
        break
    i+=1

if k>i:
    print(res)
else:
    print(1)

Verdicts: Wrong Answer

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

Submission attempts (in order):
n=int(input())
k=int(input())
j=0
for i in range(100,-1,-1):
  if(int(n%pow(10,i))==0):
  else:
    s.append(int(n%pow(10,i)))
    n-=s[j]
    j+=1
if(s[0]=1):
  print(s[1])
else:
  print(s[0])

#coding:utf-8
n=input()
count=0
l=int(input())
for i in range(len(n)):
  if(n[i]=='1'):
    count+=1
    if(l==count):
      print(n[i])
      break;
    continue
  else:
    print(n[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):
S=input()
K=int(input())
count=0
for i in range(len(S)):
  if S[i]==1:
    count+=1
  else:
    break
if count>=K:
  print(1)
else:
  print(S[count])

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

if count>=K:
  print(1)
else:
  print(S[count])

Verdicts: Wrong Answer

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

Submission attempts (in order):
s=list(input())
k=int(input())
if k==1 or len(s)==1:
  print(s[0])
else:
  for i in range(len(s)):
    num = int(s[i])**500000000
    if k-num<=0:
      print(s[i])
      break
      

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

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

S = list(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())
count_ones = 0
inf_n = 0
for c in S:
  n = int(c)
  if n == 1:
    count_ones += 1
  if n > 2:
    inf_n = n
    break
if K <= count_ones:
  print(1)
else:
  print(inf_n)
    

S = input()
K = int(input())
count_ones = 0
inf_n = 0
for c in S:
  n = int(c)
  if n == 1:
    count_ones += 1
  else:
    inf_n = n
    break
if K <= count_ones:
  print(1)
else:
  print(inf_n)

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 math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]

def main():
    s = s_input()
    k = i_input()
    if k == 1:
        print(s[0])
    else:
        for i in range(k-1):
            if s[i] != "1":
                print(s[i+1])
                exit()
        print(s[-1])


if __name__=="__main__":
    main()


from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())

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

for i in range(K):
	if S[i] == '1':
		continue
	else:
		print(S[i])
		sys.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):
n = input()
k = input()

for i in n:
    if i != "1":
        print(int(i))

N = int(input())
if N < 105:
    print("0")
elif N < 135:
    print("1")
elif N < 165:
    print("2")
elif N < 189:
    print("3")
elif N < 195:
    print("4")
else:
    print("5")


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

for i in range(len(n)):
    if n[i] != "1":
        x = i
        break

if k <= i:
    print(1)
else:
    print(n[i])

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

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

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

for i in range(len(s)):
    if s[i] == '1':
        continue
    else:
        break
if i == 0:
    print(s[0])
elif i < k:
    print(s[i + 1])
else:
    print(1)

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

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

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

for i in range(len(s)):
    if s[i] == '1':
        continue
    else:
        break
if i == 0:
    print(s[0])
elif i < k:
    print(s[i])
else:
    print(1)

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):
n = list(str(input()))
k = int(input())
for i in range(n):
  if n[i] != "1":
    print(n[i])
    exit()
print("1")

n = list(str(input()))
k = int(input())
for i in range(min(k,len(n))):
  if n[i] != "1":
    print(n[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())
flag = True

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

if flag:
    print(1)


S = input()
K = int(input())
flag = True

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

if flag:
    print(1)


S = input()
K = int(input())
flag = True

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

if flag:
    print(1)


Verdicts: Wrong Answer

Runtime Error

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

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

sum=0
for i in range(0,len(S)):
    if(S[i]==1):
        sum+=1
    else:
        tmp=S[i]
        for j in range(2,5000000000000000):
            tmp*=S[i]
            print(tmp)
            if(sum+tmp>=K):
                print(S[i])
                exit()
            else:
                sum+=tmp



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

sum=0
for i in range(0,len(S)):
    if(S[i]==1):
        sum+=1
        if(sum>=K):
                print(S[i])
                exit()
    else:
        tmp=S[i]
        for j in range(2,5000000000000000):
            tmp*=S[i]
            if(sum+tmp>=K):
                print(S[i])
                exit()
            else:
                sum+=tmp



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

s = input()
k = int(input())
if len(s) == 1:
    print(s)
else:
    if s[0] != 1:
        print(s[0])
    else:
        print(s[1])

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

if len(s) == 1:
    print(s)
elif len(set(s)) == 1:
    print(s[0])
else:
    t = s.replace('1','')
    if k < len(s) - len(t):
        print(1)
    else:
        print(t[0])

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):
def resolve():
    s = input()
    k = int(input())
    c = 0
    for i in s:
        if i == "1":
            c += 1
        else:
            c += int(i)**((5*10**16)-1)
        if k <= c:
            print(i)
            break
resolve()

def resolve():
    s = input()
    k = int(input())
    c = 0
    for i in range(k):
        if s[i] != "1":
            print(s[i])
            break
        if i == k-1:
            print(1)
resolve()

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

tmp = 0
for each in s:
  if each > 1:
    print(each)
    break
  tmp += 1
  if tmp == k:
    print(1)
    break

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

tmp = 0
for each in s:
  if int(each) > 1:
    print(each)
    break
  tmp += 1
  if tmp == k:
    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 = list(input())
K = int(input())

if len(S) == 1 or K == 1:
    print(S[0])

elif S[0] == 1:
    print(S[1])

else:
    print(S[0])

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

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

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

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

elif S[0] == 1:
    print(S[1])

else:
    print(S[0])

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

if len(S) == 1 or K == 1:
    print(S[0])

elif S[0] == 1 and K >= 2:
    print(S[1])

elif S[1] != 1 and K >= 2:
    print(S[0])

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

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

Verdicts: Wrong Answer

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):
# coding:utf-8
s=input()
k=int(input())
list=list(s)
ans=1
for i in range(k):
    if not list[i] == 1:
        ans=list[i]
        break
print(ans)


# coding:utf-8
s=input()
k=int(input())
list=list(s)
ans=1
for i in range(k):
    if not list[i] == 1:
        ans=list[i]
        break
print(ans)


# coding:utf-8
s=input()
k=int(input())
lists=list(s)
ans=1
for i in range(min(k,len(lists))):
    if not lists[i] == "1":
        ans=lists[i]
        break
print(ans)


Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
N = int(input())
K = int(input())
n = N 
ans = 0
c = 0
co
while n > 10: 
    c = c + 1 
    n = n // 10
while c > 0: 
    m = N // (10 * c)
    d = m % 10
    if d == 1:
        co = co + 1
    else:
        ans = d
        break
    c = c - i
if K < co:
    ans = n
print(ans)

N = int(input())
K = int(input())
n = N 
ans = 0
c = 0
co = 0
while n > 10: 
    c = c + 1 
    n = n // 10
while c > 0: 
    m = N // (10 * c)
    d = m % 10
    if d == 1: 
        co = co + 1
    else:
        ans = d 
        break
    c = c - 1
if K < co: 
    ans = 1
print(ans)

N = int(input())
ans = 1
d = 1
while N>10:
    N = N //10
ans = N % 10
print(ans)

N = int(input())
K = int(input())
n = N 
ans = n
c = 0
co = 0

while n > 10: 
    c = c + 1 
    n = n // 10
#print(c)
while c > -1: 
    m = N // (10 ** c)
    d = m % 10
    #print(m)
    #print(d)
    if d == 1: 
        co = co + 1
    else:      
        ans = d 
        break
    c = c - 1
if K <= co: 
        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):
s = input()
k = int(input())
for i in len(s):
    if s[i] != '1' and i < k:
        print(s[i])
        exit()
print('1')

s = input()
k = int(input())
for i in range(len(s)):
    if s[i] != '1' and i < k:
        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())
ans = 1
for i in range(len(s)):
    if s[i] != '1' and k <= i:
        print(s[i])
        exit()
print(ans)

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

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

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
S, K = map(int, [input() for i in range(2)])
count = 0

for i in str(S):
    if i == 1:
        count += 1
        continue
    else:
        a = i
        break

if count >= K:
    print(1)
else:
    print(a)

S, K = map(int, [input() for i in range(2)])
count = 0
a = 0

for i in str(S):
    if int(i) == 1:
        count += 1
        continue
    else:
        a = int(i)
        break

if count >= K:
    print(1)
else:
    print(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())

for c in S:
	K-=1
    if K==0:
      print(c)
      break
    if c!='1':
      print(c)
      break

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

for c in S:
  K-=1
  if K==0:
    print(c)
    break
  if c!='1':
    print(c)
    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())

output = ''

if len(S) <= K:
    for letter in S:
        if letter != '1':
            output = l
            break
else :
    for i in range(K):
        if S[i] != '1':
            output = S[i]
            break
    
if output:
    print(output)
else :
    print('1')

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

output = ''

if len(S) <= K:
    for letter in S:
        if letter != '1':
            output = letter
            break
else :
    for i in range(K):
        if S[i] != '1':
            output = S[i]
            break

if output:
    print(output)
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):
#include<stdio.h>
int main(void)
{
    char s[101]; 
    unsigned long k;
    scanf("%s",&s);
    scanf("%u,&k);
    int len=0;
    int i;
    char ans[2]="1";
    while(s[len++])
    int c=len<k?k:len;
    for(i=0;i<c;i++)
    {
        if(s[i]!='1')
            {ans[0]=s[i];  break;}
    }
    printf("%s",ans);
return 0;
}

s=input()
k=input()
a=int(s[0])

for num in range(0,max(len(s),k)):
    if int(s[num])==1:
        print(1)
    else:
        print(s[num])

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

Verdicts: Runtime Error

Runtime Error

Accepted