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:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    s = input().rstrip()
    k = int(input())
    
    for i in s:
        if int(i) !=1:
            print(i)
            exit()
        else:
            continue
    print(1)

if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
# 
# 
# @stop_watch
def solve(S, N):
    ans = ''
    if N == 1:
        ans = S[0]
    else:
        if int(S[0]) == 1:
            ans = S[1]
        else:
            ans = S[0]
    print(ans)


if __name__ == '__main__':
    S = input()
    N = int(input())
    # N, M = map(int, input().split())
    # A = [int(i) for i in input().split()]
    # B = [int(i) for i in input().split()]
    # AB = [[int(i) for i in input().split()] for _ in range(N)]
    solve(S, N)

    # # test
    # from random import randint
    # from func import random_str
    # solve()

Submission status: Wrong Answer

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

if k == 1 or len(s) == 1:
    ans = list(s)[0]
else:
    ans = None
    for i, j in enumerate(list(s)):
        if j != '1' and i < k:
            ans = j
            break
        elif i >=k :
            ans = '1'
            break
        else:
            continue

if ans is None:
    ans = '2'
print(ans)

Submission status: Wrong Answer

Solution code:
a = input()
b = int(input())
cnt = b
for i in a:
  if cnt == 0:
    print("1")
    break
  else:
    if i =="1":
      cnt -= 1
    else:
      print(i)
      break

Submission status: Wrong Answer

Solution code:
a = input()
b = int(input())
cnt = b
for i in a:
  if cnt != 0:
    if i == "1":
      cnt -= 1
    else:
      print(i)
      break
  else:
    print("1")
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

url = "https://atcoder.jp//contests/abc106/tasks/abc106_c"

def main():
    s = input()
    k = int(input())
    ans = 0
    tyou = 500000000000000
    for v in s:
        if v == '1':
            continue
        ans += tyou ** int(v)
        if ans >= k:
            print(v)
            exit()



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
 
if s[0] == "1":
  if k == 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:
  print(s[1])
else:
  print(s[0])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys

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


s=list(s)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    s = S()
    k = max(len(s),I())

    ans = 1

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

    print(ans)
main()

Submission status: Wrong Answer

Solution code:
a=input()
b=int(input())
c=1
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
  if c>=b:
    print(1)
  else:
    print(a[c+1])

Submission status: Wrong Answer

Solution code:
def main():
    S = list(map(int, list(input().rstrip())))
    K = int(input())
    if sum(S[:K]) == K and len(set(S)) == 1:
        print(1)
    else:
        for s in S:
            if s != 1:
                print(s)
                exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    S = list(map(int, list(input().rstrip())))
    K = int(input())
    if sum(S[:K]) == K:
        print(1)
    else:
        for s in S:
            if s != 1:
                print(s)
                exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()

def resolve():
    import sys
    input = sys.stdin.readline

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

    i = 0
    for c in s:
        if c != "1":
            break
        if i == k:
            break
        i += 1

    print(c)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
cnt = 0
for i in s:
    if i =='1':
        cnt +=1
    else:
        print(i)
        exit()
if cnt >=k:
    print(1)

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
cnt = 0
for i in s:
    if i =='1':
        cnt +=1
    else:
        print(i)
        exit()
if cnt == len(s):
    print('1')

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
cnt = 0
for i in s:
    if i =='1':
        cnt +=1
    else:
        print(i)
        exit()
if cnt == len(s):
    print(1)

Submission status: Wrong Answer

Solution code:
a=input()
b=int(input())
c=0
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
  if c>b:
    print(1)
  else:
    if c>=len(a)-1:
      print(1)
    else:
      print(a[c+1])

Submission status: Wrong Answer

Solution code:
a=input()
b=int(input())
c=0
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
if c>=b:
  print(1)
else:
  print(a[c-1])

Submission status: Wrong Answer

Solution code:
a=input()
b=int(input())
c=0
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
if c>b:
  print(1)
else:
  print(a[c])

Submission status: Wrong Answer

Solution code:
a=input()
b=int(input())
c=1
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
if c>b:
  print(1)
else:
  print(a[c-1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# 5 * 10^15
cnt = 0

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

Submission status: Wrong Answer

Solution code:
s=str(input())
k=int(input())
ans="1"
for i in range(len(s)):
  if s[i]!="1":
    ans=s[i]
    break

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())
s = list(map(int,s))
k = int(input())
for _ in s:
    if _ != 1:
        print(_)
        exit(0)
print(1)

Submission status: Wrong Answer

Solution code:
# 1123311 = [[1,2],[2,1],[3,2],[1,2]]
S = input()
K = int(input())
Sd = [[int(S[0]), 1]]
n = 0

for i in range(len(S) - 1):
    if Sd[n][0] == S[i+1]:
        Sd[n][1] += 1
    else:
        Sd.append([int(S[i+1]), 1])
        n += 1

Sd = [[N, i] for N, i in Sd]

for n,i in Sd:
    if n==1:
        continue
    else:
        print(n)
        break

Submission status: Wrong Answer

Solution code:
s=input()
i=1
while 1:
    if i==len(s):
        print(1);exit()
    if s[i-1]!="1":
        t=i 
        ans=int(s[i-1])
        break
    i+=1
# print(t)
if int(input())<t:
    print(1);exit()
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
i=1
while 1:
    if s[i-1]!=1:
        t=i 
        ans=s[i-1]
        break
    i+=1
if int(input())<=i:
    print(1);exit()
print(ans)

Submission status: Wrong Answer

Solution code:
a=input()
b=int(input())
c=0
if a[0]!=1:
  print(a[0])
else:
  for i in range(len(a)-1):
    if a[i]==a[i+1]:
      c=c+1
    else:
      break
  if c>=b:
    print(1)
  else:
    print(a[1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
i=0
while S[i]!='1' and K<i+1:
  i+=1
else:
  i=0
print(S[i])

Submission status: Wrong Answer

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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math

S=input()
a=int(input())
List=list(S)
mid = 0
res = 0
for i in range(len(S)):
  mid += math.log10(int(List[i])) * 5000000000000000
  if mid >= math.log10(a):
    res = int(List[i])
    break
print(res)

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
for i in s:
  if i=='1':
    k-=1
  else:
    k-=int(i)*(5*(10**15))
  if k<=0:
    print(i)
    exit()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    S = input()
    K = int(input())

    if S.startswith('1'):
        c = 0
        for i in range(len(S)):
            if S[i] == '1':
                c += 1
            else:
                break
        if K <= c:
            print(1)
        else:
            print(S[1])
    else:
        print(S[0])




if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    S = input()
    K = int(input())

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

    T = S.replace('1', '')
    if T == '':
        print(1)
        exit()

    else:
        print(T[0])


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    S = input()
    K = int(input())

    if S[0] == 1 and K <= 5000000000000:
        print(1)
        exit()

    T = S.replace('1', '')
    if T == '':
        print(1)
        exit()

    else:
        print(T[0])


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    S = input()
    K = int(input())

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if sum(S)==len(S):
    print(1)
elif S[0]!=1:
    print(S[0])
else:
    for i in range(len(S)):
        if S[i]!=1:
            print(S[i])
            break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math
from math import gcd,pi,sqrt
INF = float("inf")

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

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

if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
from math import gcd,pi,sqrt
INF = float("inf")

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

def main():
    s = s_input()
    k = i_input()
    if k == 1:
        print(s[0])
    else:
        if 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())
n = 5000 * 10**12

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

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()
    if i==k:
        print(1)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(s[0])

Submission status: Wrong Answer

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

for s in range(len(S)):
  if S[s]=="1":
    L+=1
  else:
    L+=int(S[s])*5000000000000000
    if L>K:
      print(S[s])
      exit()

Submission status: Wrong Answer

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

for s in range(len(S)):
  if S[s]=="1":
    L+=1
  elif (L+int(S[s])*5000000000000000)>K:
    print(S[s])
    exit()
  else:
    L+=int(S[s])*5000000000000000

Submission status: Wrong Answer

Solution code:
s = str(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:
# ABC-106-C
S = input().rstrip()
K = int(input())

for s in S[:K]:
    if s != '1':
        print(s)
        break
    
if K == 1 and S[0] == '1':
    print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 1
for s in S[:K+1]:
    if s != "1": 
      ans = s
      break
      
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for s in S[:K+1]:
    if s != "1": 
      print(s)
      break

Submission status: Wrong Answer

Solution code:
import sys


def input():
    return sys.stdin.readline().rstrip()


def main():
    S = input()
    K = int(input())

    i = 0

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys

S = sys.stdin.readline().strip()
K = int(sys.stdin.readline())

for s_i in S:
    if s_i == "1":
        K -= 1
    else:
        break
print(s_i)

Submission status: Wrong Answer

Solution code:
import sys

S = sys.stdin.readline().strip()
K = int(sys.stdin.readline())

for s_i in S:
    if s_i == "1":
        K -= 1
    else:
        K -= 5000000000000000 * int(s_i)
    if K <= 0:
        break
print(s_i)

Submission status: Wrong Answer

Solution code:
s = list(map(str, input().rstrip()))
_ = int(input())

ans = 1
for x in s:
    if int(x) != 1:
        ans = int(x)
        break
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
ok = True
for i in range(len(s)):
    if s[i] != '1':
        ok = False

if ok:
    print('1')
    exit()

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

Submission status: Wrong Answer

Solution code:
import sys

s = list(map(str, input().rstrip()))
_ = int(input())

for x in s:
    if int(x) != 1:
        print(x)
        sys.exit()
else:
    print(1)

Submission status: Wrong Answer

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

if len(s) >= k and s[k-1] == '1':
    print(1)

else:
    for si in s:
        sii  = int(si)
        if sii != 1:
            print(sii)
            exit()
    else:
        print(1)

Submission status: Wrong Answer

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

if len(s) >= k and s[k-1] == '1':
    print(1)

else:
    for si in s:
        sii  = int(si)
        if sii != 1:
            print(sii)
            exit()

Submission status: Wrong Answer

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

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:
# coding = SJIS

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

ans = 1

for i in s:
    if int(i) != 1:
        print(i)
        exit()

print(ans)

Submission status: Wrong Answer

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

for j in range(len(S)):
    if S[j]=='1':
        if j==K-1:
            ans=1
    else:
        x=[i for i in S if i!="1"]
        ans=x[0]

print(ans)

Submission status: Wrong Answer

Solution code:
S = list(map(int,input()))
K = int(input())
for i in range(K):
  if S[i] != 1:
    print(S[i])
    break

Submission status: Wrong Answer

Solution code:
S = list(map(int,input()))
for i in range(len(S)):
  if S[i] != 1:
    print(S[i])
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ref = 0
for i in range(len(S)):
    if S[i] == "1":
        ref += 1
    else:
        break

ans = ""
if ref == 0:
    ans = S[0]
else:
    if ref >= K:
        ans = "1"
    else:
        ans = S[ref-1]

print(ans)

Submission status: Wrong Answer

Solution code:
def number_count(string, n):
    count = 0
    for i in range(len(string)):
        if int(string[i]) == n:
            count += 1
    return count


def main():
    s = str(input())
    k = int(input())

    if number_count(s, 1) == len(s):   # sの中身がすべて１の場合
        number = '1'

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

        if k <= first_index + 1:
            number = '1'
        else:
            number = s[first_index]


    print(number)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

x = s.replace('1', '')

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
for i in range(len(s)):
  if s[i]!="1":
    print(s[i])
    break

Submission status: Wrong Answer

Solution code:
s = list(input())
k = int(input())
number = 0
count = 0
for i in range(len(s)):
    if s[i] == "1":
        count += 1
        if count == k - 1:
            number = 1
    elif s[i] != "1" and number == 0:
        number = s[i]
print(number)

Submission status: Wrong Answer

Solution code:
s = list(input())
k = int(input())
number = 0
for i in range(len(s)):
    if s[i] == "1" and i == k - 1:
        print(i + 1)
        exit()
    elif s[i] != "1" and number == 0:
        number = s[i]
print(number)

Submission status: Wrong Answer

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

f = 1

for c in s:
    if int(c) != 1:
        f = int(c)
        break

print(f)

Submission status: Wrong Answer

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

ref = 0
for i in range(len(S)):
    if S[i] == "1":
        ref += 1
    else:
        break

ans = ""
if ref == 0:
    ans = S[0]
else:
    if ref >= K:
        ans = "1"
    else:
        ans = S[1]

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = 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 = input()
if len(S) == 1:
  print(S)
elif S[0] == '1':
  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:
        res = s[0]
    else:
        res = s[1]
else:
    res = s[0]

print(res)

Submission status: Wrong Answer

Solution code:
S=list(input())
K=int(input())
#print(S)
i=0;p=0
while i!=len(S):
  if S[i]!="1":
    print(S[i])
    p=1
    break
  i=i+1
if p==0:
  print("1")

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
cnt=0
if s[0]!="1":
	print(int(s[0]))
if s[0]=="1":
	for i in s:
		cnt+=1
		if i!="1":
			if cnt<=k:
				print(int(i))
				exit()
			if cnt>k:
				print(1)
				exit()

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
cnt=0
if s[0]!="1":
	print(int(s[0]))
if s[0]=="1":
	for i in s:
		cnt+=1
		if i!="1":
			if cnt<=k:
				print(int(i))
				exit()
			else:
				print(1)
				exit()

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
cnt=0
if s[0]!="1":
	print(int(s[0]))
else:
	for i in s:
		cnt+=1
		if i!="1":
			if cnt<=k:
				print(int(i))
			else:
				print(1)

Submission status: Wrong Answer

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

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

if len(S) > K and S[:K] == "1"*K:
    print(1)
else:
    for S in list(S):
        if S != "1":
            print(S)
            break

Submission status: Wrong Answer

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

    idx = 0
    for i, c in enumerate(S):
        if c != '1':
            idx = i
            break

    print(S[idx])

    return


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

# sが1文字目からk番目の文字 or 最後の文字まで全部1なら1
# そうでなければ、最初に登場した1以外の文字
for i in range(len(s)):
    if s[i] != '1':
        # 最初に登場した1以外
        print (s[i])
        exit ()
    if k <= i:
        # 最初からk番目までが1だったので1
        print (1)
        exit ()
else:
    # 最初から最後まで1
    print (1)
    exit ()

Submission status: Wrong Answer

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

# sが1文字目から最後の文字 or k番目の文字までが1なら1
for i in range(len(s)):
    if s[i] != '1':
        print (s[i])
        exit ()
    if k < i:
        print (1)
        exit ()
else:
    print (1)
    exit ()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if k <= len(s):
    for i in range(len(s)):
        if s[i] == '1':
            pass
        else:
            print (s[i])
            exit ()
    print (1)
    exit ()
else:
    for i in range(len(s)):
        if s[i] == '1':
            pass
        else:
            print (s[i])
            exit ()

Submission status: Wrong Answer

Solution code:
s = list(map(int,input()))
k = int(input())
if k == 1:
    print(s[0])
else:
    if s[0] == 1:
        print(s[1])
    else:
        print(s[0])

Submission status: Wrong Answer

Solution code:
s = input().rstrip()
if len(s) == s.count('1'):
    print(1)
else:
    print(s.replace('1', '')[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    S = input()
    K = int(input())
    ans = []
    for i in range(len(S)):
        if S[i] == "1":
            ans.append("1")
        else:
            if len(ans) < K:
                print(S[i])
            else:
                print("1")
resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    S = input()
    for i in range(len(S)):
        if S[i] == "1":
            continue
        else:
            print(S[i])
            exit()
    print("1")
resolve()

Submission status: Wrong Answer

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

for i, s in enumerate(S, 1):
  if s == 1:
    if i == K:
      print(s)
      break
    else:
      continue
  else:
    print(s)
    break

Submission status: Wrong Answer

Solution code:
S=(input())
s=list(S)
K=int(input())
if K==1:
  print(s[0])
  exit()
for i in range(len(s)):
  key=s[i]
  if key!='1':
    print(key)
    exit()

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
r = "1"
for i, s in enumerate(S):
    if s != "1":
        r = s
        break
print(r)

Submission status: Wrong Answer

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

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

    if i == K:
        print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
if s[0]=='1':
  if k==1:
    print(s[0])
  else:
    print(s[1])
else:
  print(s[0])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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