Problem:


﻿Score: 300 points

Problem Statement

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?

Constraints

S is a string of length between 1 and 100 (inclusive).

K is an integer between 1 and 10^{18} (inclusive).

The length of the string after 5 \times 10^{15} days is at least K.

Input

Input is given from Standard Input in the following format:

S
K

Output

Print the K-th character from the left in Mr. Infinity's string after 5 \times 10^{15} days.

Sample Input 1

1214
4

Sample Output 1

2

The string S changes as follows:  

Now: 1214

After one day: 12214444

After two days: 1222214444444444444444

After three days: 12222222214444444444444444444444444444444444444444444444444444444444444444

The first five characters in the string after 5 \times 10^{15} days is 12222. As K=4, we should print the fourth character, 2.

Sample Input 2

3
157

Sample Output 2

3

The initial string is 3. The string after 5 \times 10^{15} days consists only of 3.

Sample Input 3

299792458
9460730472580800

Sample Output 3

2



Sample input:
1214
4


Sample output:
2

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
S = list(map(int, list(input())[: -1]))
K = int(input())
if S[0] == 1:
  if K == 1: print(1)
  else: print(S[1])
else: print(S[0])

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
if S[0]==1:
    if K==1:
        print(1)
    else:
        print(S[1])
else:
    print(S[0])

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

notone = 1
notonei = 101
for i, n in enumerate(s):
    if n != "1":
        notone = int(n)
        notonei = i
        break

if k < notonei:
    print(1)
else:
    print(notone)

Submission status: Wrong Answer

Solution code:
import sys
import math

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

Submission status: Wrong Answer

Solution code:
import sys
import math

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

Submission status: Wrong Answer

Solution code:
import sys
import math

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

Submission status: Wrong Answer

Solution code:
import sys
import math

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

Submission status: Wrong Answer

Solution code:
import sys
import math

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

Submission status: Wrong Answer

Solution code:
import sys
import math

s = input()
k = int(input())
TRI = 5 * 10 ** 15
if (len(s) == 1):
    print(s)
else:
    s1 = s[0]
    s2 = s[1]
    if (s1 == s2 == '1'):
        for i in range(len(s)):
            if (s[i] != '1'):
                print(s[i])
                sys.exit()
    else:
        if (s1 == '1'):
            print(s2)
        else:
            print(s1)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

all1 = True
if k <= len(s):
    for i in range(k-1):
        if s[i] != '1':
            all1 = False
    if all1:
        print(s[k-1])
        exit()
if s[0] == '1':
    if len(s) == 1:
        print(s[0])
    else:
        print(s[1])
else:
    print(s[0])

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

all1 = True
if len(s) > k:
    for i in range(k):
        if s[i] != '1':
            all1 = False
    if all1:
        print(s[k-1])
        exit()
if s[0] == '1':
    if len(s) == 1:
        print(s[0])
    else:
        print(s[1])
else:
    print(s[0])

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

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

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())

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

if i == K-1:
  print(1)

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())

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

if i == K:
  print(1)

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
one = True
for i in range(len(S)):
  one = one and S[i]=='1'
  if not one: break
print(S[i])

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())

print(S[0])

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

import sys
# import math
# from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)


def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1               # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    s = input()
    _ = input()
    if len(s) == 1:
        print(s[0])
    elif s[0] == '1':
        print(s[1])
    else:
        print(s[0])


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
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]))

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())

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

elif int(s[0])==1:
    num=1
    for i in range(1, len(s)):
        if int(s[i])!=1:
            num=int(s[i])
            break

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

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())

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

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

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
if(k-1 < len(s)):
    if(s[k-1] == '1'):
        print(1)
        exit()
for i in s:
    if(i != '1'):
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
for i in s:
    if(i != '1'):
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
S = [int(i) for i in input()]
K = int(input())

ans = 1
for i in S:
    if i!=1:
        ans=i
        break
print(i)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

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

Submission status: Wrong Answer

Solution code:
n = input()

k = int(input())
if k == 1:
    print(n[0])
else:
    if len(n) == 1:
        print(n)
    else:
        if n[0] == "1":
            print(n[1])
        else:
            print(n[0])

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

if sum(map(int, list(S[:K]))) == K:
    print(1)
else:
    for si in S:
        if si != '1':
            print(si)
            break

Submission status: Wrong Answer

Solution code:
s = list(input())
k = int(input())
cnt = 0
if k >= len(s):
    x = len(s)
else:
    x = k

for i in range(x):
    if s[i] == 1:
        cnt += 1
if cnt == len(s):
    print(1)
else:
    for j in s:
        if int(j) > 1:
            print(int(j))
            break

Submission status: Wrong Answer

Solution code:
s = list(input())
k = int(input())
cnt = 0
if k >= len(s):
    x = len(s)
else:
    x = k

for i in range(x):
    if s[i] == 1:
        cnt += 1
if cnt == len(s):
    print(1)
else:
    for j in s:
        if int(j) >= 1:
            print(int(j))
            break

Submission status: Wrong Answer

Solution code:
s = list(input())
k = int(input())
cnt = 0
if k >= len(s):
    x = len(s)
else:
    x = k

for i in range(x):
    if s[i] == 1:
        cnt += 1
if cnt == len(s):
    print(1)
else:
    for j in s:
        if int(j) >= 2:
            print(j)
            break

Submission status: Wrong Answer

Solution code:
s = list(input())
k = int(input())
for i in range(k):
    if s[i] != 1:
        l = [i for i in s if i != 1]
        print(l[0])
        break
else:
    print(1)

Submission status: Wrong Answer

Solution code:
s = list(input())
k = int(input())
if k >= 2 and s[0] == 1:
    print(s[1])
if len(s) == 1:
    print(s[0])
else:
    print(s[0])

Submission status: Wrong Answer

Solution code:
s = input()

k = int(input())

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

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

if K == 1:
    print(S[0])
else:
    if all(s == "1" for s in S[:K]):
        print(1)
    else:
        print(S[1] if S[0] == "1" else S[0])

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

if K == 1:
    print(S[0])
else:
    if all(s == "1" for s in S[:K - 1]):
        print(1)
    else:
        print(S[1] if S[0] == "1" else S[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
for c in s:
  if c != '1':
    print(c)
    break
else:
  print(1)

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    K = int(input())
    idx = 0
    num = ""

    all_one = True
    for i in range(len(S)):
        idx = i
        num = S[i]

        if S[i] != "1":
            all_one = False
            break

    if all_one == True:
        print("1")
    else:
        if idx >= K - 1:
            print("1")
        else:
            print(num)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    K = int(input())
    idx = 0
    num = ""

    all_one = True
    for i in range(len(S)):
        idx = i
        num = S[i]

        if S[i] != "1":
            all_one = False
            break

    if idx >= K - 1 and all_one == True:
        print("1")
    else:
        print(num)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    K = int(input())
    idx = 0
    num = ""

    for i in range(len(S)):

        idx = i
        num = S[i]

        if S[i] != "1":
            break

    if idx >= K - 1:
        print("1")
    else:
        print(num)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    K = int(input())
    idx = 0
    num = ""

    for i in range(len(S)):

        idx = i
        num = S[i]

        if S[i] != "1":
            break

    print(num)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    K = int(input())
    idx = 0
    num = ""

    all_one = True

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

    if all_one:
        print("1")
    else:
        if idx >= K - 1:
            print("1")
        else:
            print(num)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    K = int(input())
    idx = 0
    num = ""
    for i in range(len(S)):
        if S[i] != "1":
            idx = i
            num = S[i]
            break
    
    if idx + 1 >= K:
        print("1")
    else:
        print(num)
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys

s = input()

for t in s:
    if(t != "1"):
        print(t)
        sys.exit()

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())


if k == 1:
    print(s[0])
elif k >= 2 and s[0] == '1':
    print(s[1])
else:
    print(s[0])

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

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

nth = i + 1
if are_all_one or K < nth:
    print(1)

answer = S[i]
print(answer)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

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

nth = i + 1
if K < nth:
    print(1)

answer = S[i]
print(answer)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

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

nth = i + 1
if nth < K:
    print(1)

answer = S[i]
print(answer)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

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

if i < K:
    print(1)

answer = S[i]
print(answer)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

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

answer = S[i]
print(answer)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

if len(S) == 1:
    print(S)
    exit()

answer = S[1]
print(answer)

Submission status: Wrong Answer

Solution code:
s=input()
for i in list(s):
    if i!="1":print(i);exit()

Submission status: Wrong Answer

Solution code:
n = input()
k = int(input())

if n.count("1") == k:
  print(1)
  exit()

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

Submission status: Wrong Answer

Solution code:
n = input()
k = int(input())

if n.count("1") == len(n):
  print(1)
  exit()

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

Submission status: Wrong Answer

Solution code:
a = input()[:int(input())]
j = set(sorted(set(a), key=a.index)[:2])
j.discard("1")
print(list(j)[0] if j else 1)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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

Submission status: Wrong Answer

Solution code:
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

Submission status: Wrong Answer

Solution code:
def resolve():
    s = input()
    k = int(input())
    cnt = -1
    for i in range(len(s)):
        if s[i] != '1':
            break
        cnt = i + 1
    if cnt > k:
        print(1)
    else:
        print(s[cnt] if len(s) > cnt > -1 else s[0])

if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

Solution code:
S = list(input())
K = int(input())

for i in S:
    if i != "1":
        print(i)
        exit()
print("1")

Submission status: Wrong Answer

Solution code:
S = list(input())
K = int(input())

for i in S:
    if i != "1":
        print(i)
        exit()
print(1)

Submission status: Wrong Answer

Solution code:
s = input()
n = int(input())

one_cnt = []
ans = 0
for i in range(len(s)):
    if s[i] == "1":
        one_cnt = i
    else:
        ans = s[i]
        break

print(ans if n - 1 != one_cnt else 1)

Submission status: Wrong Answer

Solution code:

s = input()
k = int(input())
for si in s:
    if si != '1' or k == 0:
        print(si)
        break
    else:
        k -= 1
else:
    print(1)

Submission status: Wrong Answer

Solution code:

s = input()
k = int(input())
for si in s:
    if si != '1':
        print(si)
        break
else:
    print(1)

Submission status: Wrong Answer

Solution code:

s = input()
k = int(input())
for si in s:
    if si != '1':
        print(si)
        break

Submission status: Wrong Answer

Solution code:

s = input()
k = int(input())
for si in s:
    k -= int(si)*10**12*5000 if int(si) != 1 else 1
    if k <= 0:
        print(si)
        break

Submission status: Wrong Answer

Solution code:
import sys
readline = sys.stdin.readline

def main():
    S = readline().rstrip()
    K = int(readline())

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def myAnswer(S:list,K:int) -> int:
   if(K == 1): return S[0]
   ans = ""
   for s in S:
      if(s != "1"):
         ans = s
         break
   return ans

def modelAnswer():
   tmp=1
def main():
   S = list(input())
   K = int(input())
   print(myAnswer(S[:],K))

if __name__ == '__main__':
   main()

Submission status: Wrong Answer

Solution code:
line = input()
N = int(input())
for i in range(len(line)):
  if not line[i] == '1':
    print(line[i])
    break
  elif i+1 == N:
    print("1")

Submission status: Wrong Answer

Solution code:
line = input()
N = int(input())
for i in line:
  if not i == '1':
    print(i)
    break

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
flag = False
for i in range(len(s)):
    if s[i] != '1':
        id = s[i]
        flag = True
        break
if flag:
    print(id)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
s = str(input())
k = int(input())
ans=0
m=0
for x in s:
  if(int(x)==1):
    continue
    m+=1
  else:
    ans=int(x)
    break

if m<k:
  print(ans)
else:
  print(1)

Submission status: Wrong Answer

Solution code:
s = str(input())
k = int(input())
ans=0
for x in s:
  if(int(x)==1):
    continue
  else:
    ans=int(x)
    break
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
for i in range(min(k,len(s))):
    if s[i] != 1:
        print(s[i])
        exit()
else:
    print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
l = len(s)
pos = 0

for i in range(l):
    if s[i] != "1":
        pos = i
        break

print(s[pos])

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
k = int(input())
for i in range(n):
  if s[i] == '1':
    k -= 1
  else:
    k = -1
 
  if k < 0:
    print(s[i])
    break

Submission status: Wrong Answer

Solution code:
import sys

s, k = sys.stdin.read().split()
k = int(k)

def main():
    for i in range(len(s)):
        if s[i] != '1':
            print(1 if k < i + 1 else s[i])
            return

if __name__ ==  '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from itertools import groupby
n = list(input())
k = int(input())
if n == 1:
    print(1)
    exit()
li = []
for key,v in groupby(n):
    li.append(list(v))

if li[0][0] == "1":
    if len(li[0])>= k:
        print(1)

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

Submission status: Wrong Answer

Solution code:
from itertools import groupby
n = list(input())
k = int(input())
li = []
for key,v in groupby(n):
    li.append(list(v))

if li[0][0] == "1":
    if len(li[0])>= k:
        print(1)

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

Submission status: Wrong Answer

Solution code:
n = input()
m = int(input())
cnt = 0
for i in range(len(n)):
    if n[i] == "1" :
        cnt +=1
    else:
        if  cnt >=m:
            print(1)
        else:
            break
for i in range(len(n)):
    if n[i] != "1":
        print(n[i])
        break

Submission status: Wrong Answer

Solution code:
n = input()
m = int(input())
cnt = 0
for i in range(len(n)):
    if n[i] == "1" :
        cnt +=1
    else:
        if  cnt >m:
            print(1)
        else:
            break
for i in range(len(n)):
    if n[i] != "1":
        print(n[i])
        break

Submission status: Wrong Answer

Solution code:
n = list(input())
m = int(input())
n = [int(x) for x in n]

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

Submission status: Wrong Answer

Solution code:
S = list(input())
K = int(input())

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

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

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

Submission status: Wrong Answer

Solution code:
S = list(input())
K = int(input())

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

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

else:
    print(S[0])

Submission status: Wrong Answer

Solution code:
S = list(input())
K = int(input())

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

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

else:
    print(S[0])

Submission status: Wrong Answer

Solution code:
s = input()
n = int(input())
for i in s:
    if n == 1:
        print(i)
        exit()
    else:
        if i == "1":
            continue
        else:
            print(i)
            exit()

Submission status: Wrong Answer

Solution code:
s = input()
for i in s:
    if i == "1":
        continue
    else:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
s=input()
n=int(input())
l=[]
for x in s:
    l.append(x)
    if x!="1":break
print(l[min(len(l)-1,n)])

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())

for s in S:
    if s != '1':
        print(s)
        break

Submission status: Wrong Answer

Solution code:
import sys
S = input()
K = int(input())
for i in S:
  if i != 1:
    print(i)
    sys.exit()
print(1)

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    s=input()
    k=int(input())
    for i in range(min(100,k-1)):
        if s[i]!='1':
            print(s[i])
            break

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
  s, k = input(), int(input())
  n = s.find('1') + 1
  	
  if n >= k:
    print(1)
  else:
    print(s[n])

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
def main():
  s, k = input(), input()
  t = set(s)
  if len(t) == 1 or s[0] != '1':
    ans = s[0]
  else:
    ans = s[1]
  
  print(ans)
  
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
sl=list(s)
for i in range(len(sl)):
    if s[i]!='1':
        print(s[i])
        exit()
print(1)

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
sl=list(s)
for i in range(len(sl)):
    if s[i]!='1':
        print(s[i])
        exit()
    if k<len(sl):print(s[k-1])

Submission status: Wrong Answer

Solution code:


import collections


def solve():

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

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


if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
sl=list(s)
for i in range(len(sl)):
    if s[i]!='1':
        print(s[i])
        exit()
    if k<len(sl):print(s[k])

Submission status: Wrong Answer

Solution code:
S = list(input())
K = int(input())

for s in S:
    if s != '1':
        ans = s
        break
    else:
        ans = 1
        continue
print(ans)

Submission status: Wrong Answer

Solution code:
s = str(input())
S = [int(s[i]) for i in range(len(s))]
K = int(input())
ans = 1
count = 0
for i in range(len(S)):
    if S[i] != 1 and count == 0:
        ans = S[i]
        count += 1
print(ans)

Submission status: Wrong Answer

Solution code:
s = str(input())
k = int(input())


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

Submission status: Wrong Answer

Solution code:
s = str(input())
k = int(input())


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

Submission status: Wrong Answer

Solution code:

from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
import numpy as np
from functools import reduce

from collections import deque, Counter, defaultdict
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7

def main():
  n = input()
  k = int(input())
  l=len(n)
  for i in range(l):
    if n[i] == '1':
      if i == k-1:
        print(1)
    else:
      print(n[i])
      break
  
  
  
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
s=list(input())
k=int(input())
for i in s:
    ans=i
    if ans!="1":
        break
print(ans)

Submission status: Wrong Answer

Solution code:
s=list(input())
k=int(input())
for i in s:
    ans=i
    if i!=2:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc106/tasks/abc106_c

s = input()[:-1]
k = int(input())

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

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc106/tasks/abc106_c

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

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc106/tasks/abc106_c

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

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

Submission status: Wrong Answer

Solution code:
s_list = list(input())
k = int(input())
for s in s_list[:k + 1]:
    if s != "1":
        print(s)
        exit()
print(1)

Submission status: Wrong Answer

Solution code:
s_list = list(input())
k = int(input())
for s in s_list:
    if s != "1":
        print(s)
        exit()
print(1)

Submission status: Wrong Answer

Solution code:
s_list = list(input())
for s in s_list:
    if s != "1":
        print(s)
        exit()
else:
    print(1)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
for i in s:
    if i!='1':
        print(i)
        break

Submission status: Wrong Answer

Solution code:
s=input()
k=input()

for c in s:
  if c!='1':
    print(c)
else:
  print('1')

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
for c in s:
  if not int(c) == 1:
    print(c)
    break
else:
  print(1)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
for i in s:
    if i != "1":
        print(i)
        exit()
print(1)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
for i in s:
    if i != "1":
        print(i)
        break
print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def To_Infinity(s , k):

    ans = 0

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

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
S = input()
K = int(input())

if len(S) == 1:
  print(S)
  sys.exit()
 
for i in range(0,K):
    if S[i] == "1":
        pass
    else:
        print(S[i])
        sys.exit()

Submission status: Wrong Answer

Solution code:
def resolve():
    S = input()
    K = int(input())
    for s in S:
        i  = int(s)
        if K**(1/(10**15))<=(i**5):
            print(s)
            break


if '__main__' == __name__:
    resolve()