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):
days = 5000000000000000

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

ss = str(s)
for i in range(len(ss)):
    if ss[i] != "1":
        break
    if k - 1 == i:
        print(1)
        exit(0)

print(str(s)[0])


days = 5000000000000000

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

ss = str(s)
for i in range(len(ss)):
    if ss[i] != "0":
        break
    if k - 1 == i:
        print(1)
        exit(0)

print(str(s)[0])


days = 5000000000000000

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

ss = str(s)
for i in range(len(ss)):
    if ss[i] != "1":
        print(ss[i])
        break
    if k - 1 == i:
        print(1)
        break


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()
if s.count("1")==len(s):
    print(1)
else:
    i=0
    while s[i]!="1":
        i+=1
    print(s[i])

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

s=input()
k=int(input())-1
if s.count("1")==len(s):
    t=k
    print(1)
else:
    i=0
    while s[i]=="1":
        i+=1
    if k<i:
        print(1)
    else:
        print(s[i])

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
s = input()
k = int(input())
infinity = 5 * (10 ** 15) - 1

import math

i = 0
while k > 0:
  print(s[i])
  k -= math.floor(infinity * math.log(int(s[i]), 10)) + 1
  i += 1
  print(k)
  
print(s[i-1])


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

for i in map(int, s[:k]):
  if i != 1:
    print(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):
n = input()
k = input()


if len(n) == 1:
  print(n)
else:
  if k == "1":
    print(n[0])
  else:
    for i  in range(max(int(k), len(n))):
      if n[i] != "1":
        print(n[i])
        exit
      else:
        print(1)

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


for i in range(len(n)):
  if i == k-1 or i == len(n)-1:
    print(n[i])
    exit()
  else:
    if n[i] != "1":
      print(n[i])
      exit()

Verdicts: Runtime Error

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

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

for i in range(len(S)):
    if S[i] != '1':
        print(S[i])
        break
    else:
        if i == N - 1:
            print(1)
            break
        else:
            continue

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

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


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

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

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())
co=0
for j in S:
	if j!='1' and int(j)<=K:
		print(j)
		co=1
		break
	else:
		break
if co==0:
	print('1')

S=input()
K=int(input())
co=0
for j in S:
	if j!='1' and j<=K:
		print(j)
		co=1
		break
if co==0:
	print('1')

S=input()
K=int(input())
a=0
for j in S:
	a=a+1
	if j!='1':
		print(j)
		break
	if a==K:
		print('1')
		break

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):
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>



#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, int(n) + 1)
#define RREP(i, n) RFOR(i, 0, n)
#define RREP1(i, n) RFOR(i, 1, int(n) + 1)
#define ALL(c) begin(c), end(c)

int _ = (
#ifndef LOCAL
    std::cin.tie(nullptr), std::ios::sync_with_stdio(false),
#endif
    std::cout.precision(10), std::cout.setf(std::ios::fixed));

using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <typename T> using vec = std::vector<T>;
using namespace std;

int main() {
  string S;
  ll K;
  cin >> S >> K;
  smatch m;
  regex_match(S, m, regex("^(1*)([1-9]*)$"));
  cout << ((m.length(1) >= K) ? '1' : m.str(2).front()) << endl;
  return 0;
}


import re

m = re.match(r'\A(1*)([1-9]*)\Z', input())
print('1' if len(m.group(1)) >= int(input()) else m.group(2)[0])


Verdicts: Runtime Error

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

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

if K == 1 or S[0] == 1:
    print(S[1])
for i,s in enumerate(S):
    if i + 1 == K:
        print(S[i])
        exit()
    if S[i] != 1:
        print(S[i])
        exit()

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

for i,s in enumerate(S):
    if i + 1 == K:
        print(S[i])
        exit()
    if S[i] != "1":
        print(S[i])
        exit()


Verdicts: Runtime Error

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

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

s = input()
k = int(input())
a = min(len(s),k)
z=1
for i in range(a):
	if s[i]=="1":
		pass
	else:
		z=s[i]
		break
print(z)

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())
l = [int(x) for x in list(str(S))]
flag=0
i=0
ans = 0
if len(l)>=K:
    ans = l[K-1]
else:
    while flag ==0:
        if l[i] == 1 or l[i]==0:
            i = i + 1
        else:
            flag=1
            ans = l[i]
print(ans)

S = int(input())
K = int(input())
l = [int(x) for x in list(str(S))]
length = len(l)
flag=0
i=0
ans = 0
while flag ==0:
    if l[i] == 1 or l[i]==0:
        i = i + 1
    else:
        flag=1
        ans = l[i]
if len(l)>=K:
    ans = S[K-1]
print(ans)


S = int(input())
K = int(input())
l = [int(x) for x in list(str(S))]
flag=0
i=0
j=0
ans = 0
if len(l)>=K:
    while j<K:
        if l[j] == 1 or l[j]==0:
            j = j + 1
        else:
            ans = l[j]
else:
    while flag ==0:
        if l[i] == 1 or l[i]==0:
            i = i + 1
        else:
            flag=1
            ans = l[i]
print(ans)


S = int(input())
K = int(input())
l = [int(x) for x in list(str(S))]
flag=0
i=0
j=0
ans = 0
if len(l)>=K:
    while j<K:
        if l[j] == 1 or l[j]==0:
            j = j + 1
        else:
            ans = l[j]
else:
    while flag ==0:
        if l[i] == 1 or l[i]==0:
            i = i + 1
        else:
            flag=1
            ans = l[i]
print(ans)

S = int(input())
K = int(input())
l = [int(x) for x in list(str(S))]
length = len(l)
flag=0
i=0
ans = 0
while flag ==0:
    if l[i] == 1 or l[i]==0:
        i = i + 1
    else:
        flag=1
        ans = l[i]
if len(l)>=K:
    ans = l[K-1]
print(ans)


S = int(input())
l = [int(x) for x in list(str(S))]
K = int(input())
length = len(l)
flag=0
i=0
ans = 0
while flag ==0:
    if l[i] == 1:
        i = i + 1
    else:
        flag=1
        ans = l[i]
if len(S)>=K:
    ans = S[K-1]
print(ans)
        

S = int(input())
K = int(input())
l = [int(x) for x in list(str(S))]
flag=0
flag2=0
i=0
j=0
ans = 0
if K<=len(l):
    while j<K and flag2 == 0:
        if l[j] == 1 or l[j]==0:
            ans = l[j]
            j = j + 1
        else:
            flag2 =1
            ans = l[j]
else:
    while flag ==0:
        if l[i] == 1 or l[i]==0:
            i = i + 1
        else:
            flag=1
            ans = l[i]
print(ans)


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

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

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


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

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


Verdicts: Runtime Error

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

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


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

print(ans)


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


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


ans = "1" if K-1 < i else S[i]
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()
n=int(input())

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

s=input()
n=int(input())

for i in range(n):
  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())
 
i = 0

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

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

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


Verdicts: Wrong Answer

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

Submission attempts (in order):
import sys
input=sys.stdin.readline

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

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


import sys
input=sys.stdin.readline

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

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

s=input()
k=int(input())
if s.count('1') == len(s):
  print(1)
else:
  count = 0
  for i in s:
    if i != '1':
      print(i)
      break
    else:
      count+=1
      if count == 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):
if __name__ == '__main__':
    
    S = str(input())
    K = int(input())
    for i, n in enumerate(S):
        if n+1 == K:
            print(i)
            break
        if i != '1':
            print(i)
            break


if __name__ == '__main__':
    
    S = input()
    K = int(input())
    for i in S:
        if i == K:
            print(n)
            break
        if i != '1':
	    print(n)
	    break

if __name__ == '__main__':
    
    S = str(input())
    K = int(input())
    for n, i in enumerate(S):
        if n+1 == K:
            print(i)
            break
        if i != '1':
            print(i)
            break


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=float(input())
lis=list(S)
ss=set(lis)

if len(ss)==1:
  print(S[0])
else:
  if K<=len(S):
    check_list=lis[:K]
    check_set=set(check_list)
    if len(check_set)==1:
      print(check_list[0])
    else:
      for num in lis:
        if int(num)!=1:
          print(int(num))
        break            
  else:
    for num in lis:
      if int(num)!=1:
        print(int(num))
        break

S=input()
K=float(input())
lis=list(S)
ss=set(lis)

if len(ss)==1:
  print(S[0])
else:
  if K<=len(S):
    check_list=lis[:int(K)]
    check_set=set(check_list)
    if len(check_set)==1:
      print(check_list[0])
    else:
      for num in lis:
        if int(num)!=1:
          print(int(num))
          break            
  else:
    for num in lis:
      if int(num)!=1:
        print(int(num))
        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())
mi=5*(10**14)
i=0
while k>=0:
  k-=s[i]*mi
  i+=1
print(s[i])

s=list(int(input()))
k=int(input())
for i in range(len(s)):
  k-=s[i]*5(10**15)
  if k<s[i+1]:
    break
    
print(s[i+1])
    


s=list(input())
k=int(input())
ss=[]
t=5*(10**15)
for i in range(len(s)):
               ss.append(int(s[i]))
for i in range(len(s)):
  k-=ss[i]**t
  if k<ss[i+1]:
    print(ss[i+1])
    break
  elif k==0:
    print(ss[i])
    break
    



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


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

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

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

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

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

s = input()
k = int(input())
for i,j in enumerate(s):
  if j == "1":
    if (i+1) == k:
      print("1")
      break
  else:
    print(j)
    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())
for int(c) in s:
  if c != 1:
    print(c)
    exit(0)

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

for c in s:
  if c == '1':
    k -= 1
    if k == 0:
      print(1)
      break
  else:
    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 = int(input())
k = int(input())

for i in str(s):
    if i == '1':
        pass
    else:
        print(i)

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

for i in str(s):
    if i == '1':
        if k == 1:
            print(1)
            break
        else:
            k -= 1
    else:
        print(i)
        break

Verdicts: Wrong Answer

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

Submission attempts (in order):
S=input()
a=int(input())
List=list(S)
res = 1
for i in range(a):
  if List[i] != "1":
    res = List[i]
print(res)

S=input()
a=int(input())
List=list(S)
res = 1
for i in range(a):
  if List[i] != "1":
    res = List[i]
    break
print(res)

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
reina@v157-7-237-130:~/magic/kyogi/Atcoder/abc/b101_125/b106$ cat ./c1.py
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
p=5000000000000000
s=input()
n=int(input())

chk=1
ans=f=0
for i in s:
    chk=1
    if i=="1": 
        ans+=1
        continue
    for j in range(p-1):
        chk*=int(i)
        if ans+chk>=p:
            print(i)
            f=1
            break
    ans+=chk
    if f==1: break
if f==0: print(s[-1])

#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
p=5000000000000000
s=input()
n=int(input())

ans=chk=1
for i in s:
    chk=1
    for j in range(2,p):
        chk*=int(i)
        ans+=chk
        if ans>=p:
            print(i)
            exit()

reina@v157-7-237-130:~/magic/kyogi/Atcoder/abc/b101_125/b106$ cat ./c1.py
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
p=5000000000000000
s=input()
n=int(input())

chk=1
ans=f=0
for i in s:
    chk=1
    if i=="1": 
        ans+=1
        continue
    for j in range(p-1):
        chk*=int(i)
        if ans+chk>=p:
            print(i)
            f=1
            break
    ans+=chk
    if f==1: break
if f==0: print(s[-1])
reina@v157-7-237-130:~/mag

s=input()
k=int(input())
x=-1
y=""
for a,i in enumerate(s):
    if i!="1":
        x=a
        y=i
        break

if x!=-1 and x+1<=k: print(y)
else: print(1)


Verdicts: Runtime Error

Time Limit Exceeded

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

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

Verdicts: Runtime Error

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

Submission attempts (in order):
S = [int(i) for i in input()]
K = int(input())
for i in S:
    K -= i**(5*10**15)
    if K <= 0:
        print(i)

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

Verdicts: Wrong Answer

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

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

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

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

i = 0
counter = 0
while counter < K:
	counter += int(S[i])**5e15
	i += 1
print(S[i])

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

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

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

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

Verdicts: Wrong Answer

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

if len(s)>=k:
    for i in range(k):
        if s[i]=='1':
            answer = 1
elif s[0]!= '1' and len(s)>1:
    answer = s[0]
else:
    if k ==0 or len(s)==1:
        answer =s[0]
    else:
        answer =s[1]

print(answer)

s = input()
k = int(input())
answer = 0
sub = 0

            
if s[0]!= '1':
    answer = s[0]
    sub = 1
else:
    if k ==0 or len(s)==1:
        answer =s[0]
        sub = 1
    else:
        if len(s)>=k:
            for i in range(k):
                s[i]!='1'
                sub = 1
        else:
            answer =s[1]
            sub = 1

if sub ==0:
    answer = '1'
print(answer)

s = input()
k = int(input())
answer = 0
sub = 0

            
if s[0]!= '1' and len(s)>1:
    answer = s[0]
    sub = 1
else:
    if k ==0 or len(s)==1:
        answer =s[0]
        sub = 1
    else:
        if len(s)>=k:
            for i in range(k):
                s[i]!='1'
                sub = 1
        else:
            answer =s[1]

if sub ==0:
    answer = '1'
print(answer)

s = input()
k = int(input())
answer = 0
sub = 0
count = k

            
if s[0]!= '1':
    answer = s[0]
else:
    if k ==0 or len(s)==1:
        answer =s[0]
    else:
        if len(s)>=k:
            for i in range(k):
                s[i]!='1'
                sub = 1
                count = min(i,count)
        if sub ==0:
            answer = '1'
        else:
            answer =s[count]

print(answer)

s = input()
k = int(input())
answer = 0
sub = 0
count = len(s)

for i in range(len(s)):
    if s[i]!='1':
        count = min(i,count)

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
s=input()
k=int(input())
for i in range(len(s)):
    if s[i]!=1:
        if (i+1)>=k:
            print("1")
        else:
            print(s[i])
        break

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

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

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
import sys

str_s = input()
k = input()

int_s = int(str_s)
k = int(k)

gosentyo = 5000000000000000
count = 0

# print(2 ** gosentyo)


for s in str_s:
    now_count = 1

    if int(s) == 1:
        count += 1
    else:
        for i in range(gosentyo):
            print(count,now_count)
            if (now_count + count >= k):
                print(s)
                sys.exit()
            now_count *= int(s)
        else:
            count += now_count


import sys

str_s = input()
k = input()

int_s = int(str_s)
k = int(k)

gosentyo = 5000000000000000
count = 0

# print(2 ** gosentyo)


for s in str_s:
    now_count = 1

    if int(s) == 1:
        count += 1
        if count >= k:
            print(s)
            sys.exit()
    else:
        for i in range(gosentyo):
            # print(count,now_count)
            if (now_count + count >= k):
                print(s)
                sys.exit()
            now_count *= int(s)
        else:
            count += now_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):
n = input()
m = input()

if n[0] == 1 and len(n) == 1:
	print(1)
elif n[0] == 1:
	print(n[1])
else:
	print(n[0])


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

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

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

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

S = input()
K = input()

#A = int(l[0])


length_1 = len(S)
K = int(K)

i =int(S)
v_1 = []
#cnt = []
while i > 0:
    v_1.append( i % 10 )
    #cnt.append(1)
    i //= 10 
v_1.reverse()

length_n = 0
target_v_num = 0

while length_n < K:
    V = v_1[target_v_num]
    length_n = length_n + 1
    if V > 1:
        length_n = length_n + K
    target_v_num = target_v_num + 1


print(V)


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



s = input()
k = int(input())
days = int(5e15)
for i in range(days):
    for j in range(2,10):
         s = s.replace(str(j), str(j)*j)

print(s[k-1])


s,k = [input() for i in range(2)]
for i in range(int(k)):
    if int(s[i]) > 1:
        print(s[i])
        exit()
print(1)



Verdicts: Runtime Error

Time Limit Exceeded

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

Submission attempts (in order):
#106_C
S=input()
K=int(input())
for i in range(len(S)):
    if S[i]!='1':
        ans=i
        break
print(ans)
print('1' if K<=ans else S[ans])

#106_C
S=input()
K=int(input())
ans=0
for i in range(len(S)):
    if S[i]!='1':
        ans=i
        break

print('1' if K<=ans else S[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):
ans = 0
if int(str(S)[0]) == 1 and K == 1:
    ans = 1
elif int(str(S)[0]) != 1:
    ans = int(str(S)[0])
else:
    ans = int(str(S)[1])
print(ans)

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

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

Verdicts: Runtime Error

Accepted