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())
 
s = list(s)
v = 5 * 10**15
a = []
for i in range(9):
  a.append(i ** v)

nuar = []
lear = []
co = 0
rear = 0

for i in s:
  for j in range(1,10):
    if int(i) == j:
      nuar.append(j)
      rear += a[j - 1]
      lear.append(rear)
      
for p in range(len(s)):
  if p == 0:
    if lear[p] >= k:
      print(nuar[p])
  elif lear[p] >= k and lear[p - 1] < k:
    print(nuar[p])
  
 

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

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


Verdicts: Time Limit Exceeded

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

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

if int(S[0]) > 1:
  ans = S[0]
elif K>=100:
  for i in range(len(S)):
    if int(S[i]) > 1:
      ans = S[i]
      break
    elif i==S-1:
      ans = 1
else:
  for i in range(len(S)):
    if int(S[i]) > 1:
      if i+1 <= K:
        ans = S[i]
        break
      else:
        ans = 1
        break
    elif i==S-1:
      ans = 1
print(ans)

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

for i in range(len(S)):
  if int(S[i]) == 1:
    continue
  else:
    if i+1 <= K:
      ans = S[i]
      break

print(ans)

Verdicts: Runtime Error

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

Submission attempts (in order):
s = input()
k = int(input())
idx = 0
while idx < len(s) and s[idx] == '1':
    idx += 1
if k < idx or k == len(s):
    print(1)
else:
    print(s[idx])


s = input()
k = int(input())
idx = 0
while idx < len(s) and s[idx] == '1':
    idx += 1
if k <= idx or idx == len(s):
    print(1)
else:
    print(s[idx])


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())
m = 0
for i in s:
  if i==1:
    m += 1
  else:
    break
if m>=k:
  print(1)
else:
  for i in s:
    if i!=1:
      print(i)
      break

s = input()
k = int(input())
m = 0
for i in s:
  if i=='1':
    m += 1
  else:
    break
if m>=k:
  print(1)
else:
  for i in s:
    if i!="1":
      print(i)
      break
    else:
      continue

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

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

def func(N, K):
    for n in range(len(N)):
        if N[n] != '1':
            if K > n:
                return N[n]
    return 1

print(func(input(), int(input())))

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())
sumtmp = 0

for i in s:
  sumlen += int(i)**(5 * (10)**15)
  if sumtmp >= k:
    print(i)

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

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

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

if s[0] == '1' and len(s) == 1:
  print(s[0])
if s[0] == '1' and s[:k] == ['1']*k and len(s) != 1:
  print(s[1])
elif s[0]!='1':
  print(s[0])

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

if s[0] == '1' and len(s) == 1:
  print(s[0])
if s[0] == '1' and s[:k] == ['1']*k:
  print(s[1])
elif s[0]!='1':
  print(s[0])

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

if k <= 100:
  for i in range(k):
    coun += 1
    if s[i] != '1':
      print(s[i])
      exit()
    if coun == k:
      print(1)
      exit()
else:
  for i in range(k):
    coun += 1
    if s[i] != '1':
      print(s[i])
      exit()
    if coun == 100:
      print(1)
      exit()
  

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

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

Submission attempts (in order):
s=list(input())
k=int(input())
for i in s:
    ans=i
    if i!=2:
        break
print(ans)

s=list(input())
k=int(input())
tmp=0
for i in s:
    ans=i
    if ans!="1":
        break
    else:
        tmp+=1
if tmp>=k:
    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 = input()
k = int(input())

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

print("1")

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

result = "1"
for i in range( min(len(s),k) ):
    if s[i] != "1":
        result = s[i]
        
print(result)

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

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

Verdicts: Wrong Answer

Wrong Answer

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

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

if S[0] == '1':
  count  = 0
  while S[i] == '1':
    count += 1
  if count >= K:
    print(1)
  else:
    print(S[count])
else:
  print(S[0])

S = input()
K = int(input())
count = 0

if S[0] != '1':
  print(S[0])
  exit()

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

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

Verdicts: Runtime Error

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

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

if K==1:
  print(N[0])
  
else:
  if N[0]==1:
    print(N[1])
  else:
    print(N[0])

N=input()
K=int(input())

for x in N[:min(len(N), K)]:
  if x=='1':
    pass
  else:
    print(x)
    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):
numstr = input()
num = int(input())
def check():
    for i in range(len(numstr)):
        if numstr[i] != 1:
            return numstr[i]
print(check())
        


numstr = input()
num = int(input())
def check():
    infinity = ""
    for i in range(num):
        if numstr[i] is not "1":
            infinity = infinity + numstr[i]
            return infinity
        else:
            infinity = infinity + "1"
    return "1"
infinity = check()
print(infinity[len(infinity)-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):
inp1 = input()
inp1 = list(inp1)
inp2 = input()

ans = 1
for i in inp1:
    if i != '1'
        ans = int(i)
        break

print(ans)

inp1 = input()
inp1 = int(inp1)
inp2 = input()
inp2 = list(inp2)

ans = 1
for i in inp2:
    if i != '1'
        ans = int(i)
        break

print(ans)

inp1 = input()
inp1 = list(inp1)
inp2 = input()
inp2 = int(inp2)

ans = 1
count = 0
for i in inp1:
    if i != '1':
        ans = int(i)
        break
    else:
        count += 1

if count >= inp2:
    ans = 1

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())
flg = False
for i in range(K):
    if S[i] != '1':
        flg = True
if flg:
    print('1')
    exit()
for i in range(len(S)):
    if S[i] != '1':
        print(S[i])
        exit()
print('1')

S = input()
K = int(input())
flg = True
for i in range(K):
    if len(S) <= i:
        break
    if S[i] != '1':
        flg = False
if flg:
    print('1')
    exit()
for i in range(len(S)):
    if S[i] != '1':
        print(S[i])
        exit()
print('1')

Verdicts: Runtime Error

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

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

ans_idx = 0

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

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

ans_idx = 0

s = list(s)
for i in range(min(k, len(s))):
  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())
i = 0
ans = 0

while K > 0:
    K = K - S[i]**(5*10**16 + 1)
    ans = S[i]
    i += 1

print(ans)

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

ans = 0
n1 = 0

for i in S:
    if i != "1":
        s = int(i)
        break
    
    else:
        n1 += 1

if n1 >= K:
    print(1)

else:
    print(s)

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

if S[0] == '1':
    cnt = 0
    for s in S:
        if s == '1':
            cnt += 1
        else:
            not1 = s
            break
    if k <= cnt:
        print(1)
    else:
        print(not1)
else:
    print(S[0])


S = input()
k = int(input())

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

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

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

for i in S:
    if i == '1':
        K -= 1
        if K == 0:
            print(1)
            break
    else:
        print(i)
        break

Verdicts: Wrong Answer

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

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

res=''

if len(s)>=k:
	for i in range(k):
		if s[i]!=1:
			res=s[i]			
			break
		if i==k-1:
			res='1'
else:
	for i in range(len(s)):
		if s[i]!='1':
			res=s[i]
			break

print(res)

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

res=''

if len(s)>=k:
	for i in range(k):
		if s[i]!=1:
			res=s[i]			
			break
		if i==k:
			res='1'
else:
	for i in range(len(s)):
		if s[i]!='1':
			res=s[i]
			break

print(res)

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

res=''

if len(s)>=k:
	for i in range(k):
		if s[i]!='1':
			res=s[i]			
			break
		if i==k-1:
			res='1'
else:
	for i in range(len(s)):
		if s[i]!='1':
			res=s[i]
			break

print(res)

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

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


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


Verdicts: Wrong Answer

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

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

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

elif int(s[0])==1:

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

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

elif int(s[0])!=1:
    print(int(s[0]))

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

cnt=0
for i in range(len(s)):
    if s[i]=="1":
        cnt+=1
    else:
        ans_index=i
        break

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

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

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

S=input()
K=int(input())
if S[0]!='1':
    print(S[0])
else:
    flag=True
    for i in range(len(S)):
        if S[i]!='1':
            if K<=i:
                print('1')
            else:
                print(S[i])
            flag=False
            break
    if flag:
        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):
#include <bits/stdc++.h>
// 

#include <algorithm>
#include <string>
#include <math.h>
using namespace std;
typedef long long ll;

#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,a,b) for(int i=(a);i<(b);i++)

template<class T> inline void chmin(T& a, T b) {if (a > b) a = b;}
template<class T> inline void chmax(T& a, T b) {if (a < b) a = b;}


int main() {
  string s;cin >> s;
  int k;cin >> k;
  rep(i,k+3){
    if (s[i]!='1'){
      cout<<s[i]<<endl;
      return 0;
    }
  }
  cout<<1<<endl;  
}


import sys
s=input()
k=int(input())
for i in range(k):
  if s[i]!="1":
    print(s[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 = int(input())
k = int(input())
li = [int(k) for k in list(str(s))]
#print(li)
if k = 1:
  print(li[0])
else:
  print(li[1])

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

S = input()
K = int(input())
if S[0]*len(S) == S:
    print("1")
else:
    ans = 0
    ind = 0
    for i in range(len(S)):
        if S[i] != "1":
            ans = S[i]
            ind = i+1
    if ind > K:
        print("1")
    else:
        print(ans)

S = input()
K = int(input())
if S[0]*len(S) == S and S[0] == "1":
    print("1")
else:
    ans = 0
    ind = 0
    for i in range(len(S)):
        if S[i] != "1":
            ans = S[i]
            ind = i+1
            break
    if ind > K:
        print("1")
    else:
        print(ans)

Verdicts: Wrong Answer

Wrong Answer

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

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

ans = 1
for i in S:
	print(i,K)
	if i > '1':
		ans = i
	if K==1:
		ans = i
		break
	K-=1
print(ans)

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

ans = 1
for i in S:
	print(i,K)
	if i > '1':
		ans = i
		break
	if K==1:
		ans = i
		break
	K-=1
print(ans)

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

ans = 1
for i in S:
	print(i,K)
	if i != '1':
		ans = i
		break
	if K==1:
		ans = i
		break
	K-=1
print(ans)

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

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

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


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

s = str(input())
k = int(input())
counter = 0
for i in range(k):
    if i != "1" and i <= k-1:
        print(i)
        counter += 1
        break
if counter == 0:
    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

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
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = readline().decode().strip()
K = int(readline())
cnt = 0
ans = 0
if K <= len(N):
    ans = N[K - 1]
else:
    for i in N:
        if i == '1':
            continue
        else:
            ans = i
            break

print(ans)


import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = readline().decode().strip()
K = int(readline())
cnt = 0
ans = 0
for i in N:
    if len(N):
        ans = N[0]
        break
    if i == '1':
        cnt += 1
        continue
    else:
        if int(i) * 5000 * 10 ** 12 + cnt >= K:
            ans = i
            break
        else:
            ans = N[N.find(i) + 1]
            break

print(ans)


import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = readline().decode().strip()
K = int(readline())
ans = 1
for i in range(K):
    if i != '1':
        ans = i
        break

print(ans)


import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = readline().decode().strip()
K = int(readline())
ans = 1
for i in range(K):
    if N[i] != '1':
        ans = N[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())

S = "9999"
K = 1

ans = 1

for i in range(len(S)):
    if int(S[i]) == 1:
        pass
    else:
        ans = int(S[i])
        ones = i
        break

if not ones:
    ans = 1
elif K <= ones:
    ans = 1

print(ans)


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

ans = 1

for i in S:
    if int(i) == 1:
        pass
    else:
        ans = int(i)

print(ans)


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

ans = 1

for i in range(K):
    if S[i] == 1:
        pass
    else:
        ans = S[i]

print(ans)


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

ans = 1

for i in range(K):
    if int(S[i]) == 1:
        pass
    else:
        ans = int(S[i])
        break

print(ans)


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

lst = []
i = int(S)
while i > 0:
    lst.append(i%10)
    i //= 10 
lst.reverse()
print(lst[0])
if K == 1:
    print(lst[0])
else:
    if lst[0] == 1:
        print(lst[1])
    else:
        print(lst[0])

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

lst = []
while S > 0:
    lst.append(S%10)
    S //= 10 
lst.reverse()
#print(lst[0])
j = 0
n = 0
while lst[j] == 1:
    n = j+1
    j += 1
print('n =',n)
if K <= n:
    print(1)
else:
    print(lst[n])

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

lst = [100]
while S > 0:
    lst.append(S%10)
    S //= 10 
lst.reverse()
print(lst)
j = 0
n = 0
while lst[j] == 1:
    n = j+1
    j += 1
#print('n =',n)
if K <= n:
    print(1)
else:
    print(lst[n])

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

lst = [0]*100
while S > 0:
    lst.append(S%10)
    S //= 10 
lst.reverse()
#print(lst)
j = 0
n = 0
while lst[j] == 1:
    n = j+1
    j += 1
#print('n =',n)
if K <= n:
    print(1)
else:
    print(lst[n])

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


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


Verdicts: Wrong Answer

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

Submission attempts (in order):
try:print([i for i in input()[:int(input())]][0])
except:print(1)

print(max(1,input()[:int(input())].replace("1","")[:1]))

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

print(1or input()[:int(input())].replace('1','')[:1])

s=input()
k=int(input())
for i in s[:k]:
    if i!="1":
        print(i)
        exit()
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):
def reflesh_string(current_answer):
    index = min(K, len(current_answer))
    return current_answer[:index]
  
def update_string(string_answer):
    string_answer = string_answer.replace("1", "1")
    string_answer = string_answer.replace("2", "22")
    string_answer = string_answer.replace("3", "333")
    string_answer = string_answer.replace("4", "4444")
    string_answer = string_answer.replace("5", "55555")
    string_answer = string_answer.replace("6", "666666")
    string_answer = string_answer.replace("7", "7777777")
    string_answer = string_answer.replace("8", "88888888")
    string_answer = string_answer.replace("9", "999999999")
    return string_answer
  
def check_skip(current_answer):
    for i in range(2, 10):
        i = str(i)
        if(i in current_answer):
            return False
    return True
  
S = input().strip()
K = int(input().strip())
for c in range(5 * 10**15):
    S = update_string(S)
    S = reflesh_string(S)
    if(check_skip(S)):
        break
print(S[K-1])

S = input().strip()
K = int(input().strip())

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

Verdicts: Time Limit Exceeded

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

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

S = input()
K = int(input())
ans = "1"
for i in range(len(S)):
  if i >= K:
    break
  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 = input()

for i, k in enumerate(range(int(K))):
    if S[k] != '1':
        print(S[k])
        break
    if i == len(K)-1:
        print('1')

import math

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

ps = []

for s in S:
    i = int(s)
    if(i == 1):
        p == -1
    else:
        p = 5*(10**15) * math.log2(i)
    ps.append(p)

sum = 0
index = 0
for p in ps:
    if not p == -1:
        sum += p
    else:
        K -= 1
        
    if math.log2(K) < sum:
        print(S[index])
        break
        
    index += 1

# import math

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

ps = []

for s in S:
    i = int(s)
    if(i == 1):
        p = -1
    else:
        p = 5*(10**15) * math.log2(i)
    ps.append(p)

sum = 0
index = 0
    
if K == 1:
    print(S[0])
else:
    for p in ps:

        if not p == -1:
            sum += p
        else:
            K -= 1

        if math.log2(K) < sum:
            #print(index)
            print(S[index])
            break
        index += 1



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

for i, k in enumerate(range(K)):
    if S[k] != '1':
        print(S[k])
        break
    if i == K - 1:
        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):
s=input()
k=int(input())
if s[0]=="1":
  try:
    if s[k-1]=="1":
      print('1')
    else:
      print(s[s.rfind("1")+1])
  except IndexError:
    try:
      print(s[s.rfind("1")+1])
    except IndexError:
      print(s[-1])
else:
  print(s[0])




s=input()
k=int(input())
if s[0]=="1":
  if k>len(s):
    for i in s:
      if i!="1":
        print(i)
  else:
    print(s[k-1])
else:
  print(s[0])

s=input()
k=int(input())
if s[0]=="1":
  try:
    if s[k-1]=="1":
      print('1')
    else:
      print(s[s.rfind("1")+1])
  except IndexError:
    try:
      print(s[s.rfind("1")+1])
    except IndexError:
      print(s[s.rfind("1")])
else:
  print(s[0])




s=input()
k=int(input())
if s[0]=="1":
  try:
    if s[k-1]=="1":
      print('1')
    else:
      print(s[s.rfind("1")+1])
  except IndexError:
    print(s[s.rfind("1")+1])
else:
  print(s[0])


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

Wrong Answer

Runtime Error

Accepted