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:
def main():
    S = input()
    k = int(input())

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


if __name__ == '__main__':
    main()

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:
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:
S = list(input())
K = int(input())

for j, i in enumerate(S, start=1):
    if i != '1':
        if K <= j:
            print(1)
            exit()
        print(i)
        exit()
else:
    print(1)

Submission status: Wrong Answer

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

if K == 1:
    ans = S[0]
elif S[0] == '1':
    ans = S[1]
else:
    ans = S[0]

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
import numpy as np

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
import numpy as np

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
import numpy as np

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
import numpy as np

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
import numpy as np

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
import numpy as np

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
import numpy as np

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

N = readline().decode().strip()
K = int(readline())
if len(N) == 1:
    ans = N[0]
else:
    if N[0] == '1':
        ans = N[1] if K < int(N[1]) * 5000 * 10 ** 12 else N[2]
    else:
        ans = N[0] if K < int(N[0]) * 5000 * 10 ** 12 else N[1]
print(ans)

Submission status: Wrong Answer

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

if set(s[:k]) == set([1]):
    print(1)
else:
    for x in s[:k+1]:
        if x != '1':
            print(x)
            break

Submission status: Wrong Answer

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

if set(s[:k+1]) == set([1]):
    print(1)
else:
    for x in s[:k+1]:
        if x != '1':
            print(x)
            break

Submission status: Wrong Answer

Solution code:
s = input()

k = int(input())

tyou = 5000000000000000


ichi = True
for i in s:
    if int(i) != 1:
        ichi = False


if k == 1 or ichi :
    print(s[0])
else:
    for i in range(len(s)):
        if int(s[i]) == 1:
            pass
        else:
            print(s[i])
            exit()

Submission status: Wrong Answer

Solution code:
s = input()

k = int(input())

tyou = 5000000000000000

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

Submission status: Wrong Answer

Solution code:
s = input()

k = int(input())

tyou = 5000000000000000

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

logk=math.log10(k)

ss=[]
for i in range(len(s)):
    if s[i]!="1":
        ss.append(int(s[i]))
    
n=5000*10000**3

if len(ss)==0:
    print(1)
else:
    logketa=n*math.log10(ss[0])
    if logketa>logk:
        print(ss[0])
    else:
        print(ss[1])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

l = list(filter(lambda c: c != '1', list(s)))
print(1 if len(l) == 0 else l[0])

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

if (index == K - 1):
    print(1)
else:
    print(S[index])

Submission status: Wrong Answer

Solution code:
s=[int(i) for i in list(input())]
k=int(input())
n=len(s)
if set(s)=={1}:
  print(1)
else:
  for i in range(n):
    if s[i]!=1:
      print(s[i])
      break

Submission status: Wrong Answer

Solution code:
import math
def main():
    s = input()
    n = int(input())
    for i, ss in enumerate(s):
        num = int(ss)
        if i < n:
            if num == 1:
                continue
            else:
                print(num)
                return
        else:
            print(1)
    print(1)
def powpow(a,n):
    x = 1
    i = 0
    while n > 0:

        if bin(n>>i & 1):
            x=x*a
        a*=a
        i+=1
        n=n>>1
    return x

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
def main():
    s = input()
    n = int(input())
    for i, ss in enumerate(s):
        num = int(ss)
        if i < n:
            if num == 1:
                continue
            else:
                print(num)
                return
        else:
            print(1)
def powpow(a,n):
    x = 1
    i = 0
    while n > 0:

        if bin(n>>i & 1):
            x=x*a
        a*=a
        i+=1
        n=n>>1
    return x

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
def main():
    s = input()
    n = int(input())
    for i, ss in enumerate(s):
        if n-1 == i:
            print(1)
            return
        else:
            num = int(ss)
            if num == 1:
                continue
            else:

                print(num)
                return
    print(1)
def powpow(a,n):
    x = 1
    i = 0
    while n > 0:

        if bin(n>>i & 1):
            x=x*a
        a*=a
        i+=1
        n=n>>1
    return x

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
def main():
    s = input()
    n = int(input())
    for i, ss in enumerate(s):
        if n-1 == i:
            print(1)
            return
        else:
            num = int(ss)
            if num == 1:
                continue
            else:

                print(num)
                return

def powpow(a,n):
    x = 1
    i = 0
    while n > 0:

        if bin(n>>i & 1):
            x=x*a
        a*=a
        i+=1
        n=n>>1
    return x

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
def main():
    s = input()
    n = int(input())
    for i, ss in enumerate(s):
        if n == i:
            print(1)
            return
        else:
            num = int(ss)
            if num == 1:
                continue
            else:

                print(num)
                return

def powpow(a,n):
    x = 1
    i = 0
    while n > 0:

        if bin(n>>i & 1):
            x=x*a
        a*=a
        i+=1
        n=n>>1
    return x

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    n = int(input())
    for i, ss in enumerate(s):
        num = int(ss)
        if num == 1:
            continue
        else:
            print(num)
            return




if __name__=='__main__':
    main()

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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


for i in range(k):

    if int(s[i]) != 1:
        print(i)
        exit()
print(1)

Submission status: Wrong Answer

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


for i in range(k):

    if str(s[i]) != 1:
        print(i)
        exit()
print(1)

Submission status: Wrong Answer

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

#n_L = s[:k]
for i in s:
    if i != str(1):
        print(i)
        exit()
print(1)

Submission status: Wrong Answer

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

n_L = s[:k]
for i in n_L:
    if i != 1:
        print(i)
        exit()
print(1)

Submission status: Wrong Answer

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

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

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 = input()
K = int(input())
for s in S:
    if s != 1:
        print(s)
        exit()
    else:
        K -= 1
        if not K:
            print(1)
            exit()

Submission status: Wrong Answer

Solution code:
s = input()
input()

if s[0] != '1':
  print(s[0])
else:
  for e in s:
    if e != '1':
      print(e)
      break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

for i in S:
    if i != '1' and K != 1:
        print(i)
        exit()

print(1)

Submission status: Wrong Answer

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

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

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

for i in S:
    if i != '1' and K != 1:
        print(i)
        exit()

Submission status: Wrong Answer

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

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

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

for i in S:
    if i != '1' and K != 1:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
s = input()
input()

found =  s.find('1')
if found == -1:
  print(s[0])
else:
  for e in s[found+1:]:
    if e != '1':
      print(e)
      break

Submission status: Wrong Answer

Solution code:
s = input()
input()

found =  s.find('1')
if found == -1:
  print(s[0])
else:
  for e in s[found+1:]:
    if e != '1':
      print(e)

Submission status: Wrong Answer

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

cnt=0 #1の個数
i=0
while True:
    if s[i]!='1': break
    else:
        cnt+=1
        i+=1
        if i>len(s)-1: break
print(cnt)
        
print(1 if k<=cnt else s[cnt])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import itertools
import math
import sys
from collections import Counter
from fractions import gcd
from functools import reduce

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

Submission status: Wrong Answer

Solution code:
import itertools
import math
import sys
from collections import Counter
from fractions import gcd
from functools import reduce

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
cnt = 0
ans = 1
for i in s:
    if i == 1:
        cnt += 1
    else:
        ans = i
        break

if k <= cnt:
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

ones = 0
for i in S:
    if i == "1":
        ones += 1
    else:
        break

if ones == 0:
    print(S[0])
elif K <= ones:
    print(1)
else:
    print(S[1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
#5,000,000,000,000,000
count = 5000000000000000

lis = [int(s[i]) for i in range(len(s))]
for l in lis:
    if l == 1:
        if k - 1 > 0:
            k -= 1
            continue
        else:
            print(1)
            exit()
    else:
        if k - l*count > 0:
            k -= l*count
            continue
        else:
            print(l)
            exit()

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
#5,000,000,000,000,000
count = 5000000000000000

lis = [int(s[i]) for i in range(len(s))]
for l in lis:
    if l == 1:
        if k == 1:
            print(1)
            exit()
        else:
            k -= 1
            continue
    else:
        if k - l*count > 0:
            k -= l*count
            continue
        else:
            print(l)
            exit()

Submission status: Wrong Answer

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

for i, v in enumerate(s):
  if i == k-1:
      print(1)
      exit()
  elif v != "1": 
      print(v)
      exit()

Submission status: Wrong Answer

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

for i, v in enumerate(s):
  if i == k-1:
      print(1)
      exit()
  elif v != 1: 
      print(v)
      exit()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
length = 0
t = 5 * 10 ** 15
for c in range(t):
    for s in S:
        if int(s) == 1:
            length += 1
        else:
            length += t * int(s)
        if K <= length:
            print(s)
            exit()

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
length = 0
t = 5 * 10 ** 15
for s in S:
    s = int(s)
    if s == 1: length += 1
    else:
        length += s * t
    if K <= length:
        print(s)
        exit()

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
length = 0
t = 5 * 10 ** 15
for s in S:
    s = int(s)
    if s == 1: length += 1
    else:
        length += s * t
    if K < length:
        print(s)
        exit()

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
length = 0
t = 5 * 10 ** 15
for s in S:
    s = int(s)
    if s == 1: pass
    else:
        length += s * t
    if K < length:
        print(s)
        exit()

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
count = 0
for t in S:
  if t == 1:
    count += 1
  else:
    break
if K <= count:
  print(1)
else:
  print(int(S[count]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
if len(S) >= K and S[K-1] == "1":
    print(1)
else:
    print([c for c in S if c != "1"][0])

Submission status: Wrong Answer

Solution code:
s = list(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:
s = list(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()
K=int(input())
kazu=5*10**5

for i in range(len(S)):
    print(K)
    if K<=int(S[i])**kazu:
        print(int(S[i]))
        break
    else:
        K=K-int(S[i])**kazu

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
kazu=5*10**5

for i in range(len(S)):
    print(K)
    if K<=int(S[i])**kazu:
        print(int(S[i]))
        break
    else:
        K-=int(S[i])**kazu

Submission status: Wrong Answer

Solution code:
S=input()
K=int(input())
kazu=5*10**5

for i in range(len(S)):
    if K<=int(S[i])**kazu:
        print(int(S[i]))
        break
    else:
        K-int(S[i])**kazu

Submission status: Wrong Answer

Solution code:
# AL006 C

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

Submission status: Wrong Answer

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

output = ''

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if len(S) == 1:
    print(S)
else :
    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()
K = int(input())

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

Submission status: Wrong Answer

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

while n > 10: #桁数を数える
    c = c + 1 
    n = n // 10
#print(c)
while c > -1: #上の桁から見ていく
    m = N // (10 ** c)
    d = m % 10
    #print(m)
    #print(d)
    if d == 1: # 1がどこまで連続しているかを調べる
        co = co + 1
    else:      #初めて1以外の数がでてきたらそれを一旦答えとする
        ans = d 
        break
    c = c - 1
if K < co: #1が連続しているところを答える場合は答えは1
        ans = 1

print(ans)

Submission status: Wrong Answer

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

while n > 10: #桁数を数える
    c = c + 1 
    n = n // 10
#print(c)
while c > 0: #上の桁から見ていく
    m = N // (10 ** c)
    d = m % 10
    #print(m)
    #print(d)
    if d == 1: # 1がどこまで連続しているかを調べる
        co = co + 1
    else:      #初めて1以外の数がでてきたらそれを一旦答えとする
        ans = d 
        break
    c = c - 1
if K < co: #1が連続しているところを答える場合は答えは1
        ans = 1

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
K = int(input())
n = N 
ans = 0
c = 0
co = 0
while n > 10: #桁数を数える
    c = c + 1 
    n = n // 10
while c > 0: #上の桁から見ていく
    m = N // (10 * c)
    d = m % 10
    if d == 1: # 1がどこまで連続しているかを調べる
        co = co + 1
    else:
        ans = d #初めて1以外の物がでてきたらそれを一旦答えとする
        break
    c = c - 1
if K < co: #1が連続しているところを答える場合は答えは1
    ans = 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

num = '1'
for s in S:
    if s != '1':
        num = s
        break

print(num)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
if len(S) == S.count("1"):
    print(1)
else:
    for c in S:
        if c != "1":
            print(c)
            break

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
if S[0] == "1":
    if K == 1:
        print(1)
    else:
        S.replace("1", "")
        print(S[0])
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())
front1 = 0
if s == "1":
  print(1)
for i in range(len(s)):
  if s[i] == "1":
    front1 += 1
  else:
    break
print(s[min(k-1, front1)])

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())
count = 0
for i in range(len(S)):
    if S[i] == "1":
        count += 1
if count == len(S):
    print("1")
    exit()

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

Submission status: Wrong Answer

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

ind = 0
for s in S:
    i = int(s)

    if i == 1:
        num = pow(i, 5000000000000000)
    else:
        print(i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools

class cin():
    def int():
        return int(sys.stdin.readline().rstrip())
    def string():
        return sys.stdin.readline().rstrip()
    def mapInt():
        return [int(x) for x in cin.string().split()]
    def stringList(n):
        return [input() for i in range(n)]
    def intListList(n):
        return [cin.mapInt() for i in range(n)]

class Util():
    def roundUp(a,b):
        return -(-a // b)
    def toUpperMultiple(a,x):
        return Util.round_up(a,x) * x
    def toLowerMultiple(a,x):
        return (a // x) * x

S = cin.string()
K = cin.int()

def solve():
    for s in S:
        if s != "1":
            return s
    return "1"
print(solve())

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
import sys
for i,j in enumerate(s):
    if i > k:
        break
    if j != '1':
        print(j)
        sys.exit()
print(1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# わからなかった

Submission status: Wrong Answer

Solution code:
*s, = map(int, list(input()))
k = int(input())

m = 5*10**15
d = {1: 1, 2: 2**2*m, 3: 3**3*m, 4: 4**4*m, 5: 5**5*m, 6: 6**6*m, 7: 7**7*m, 8: 8**8*m, 9: 9**9*m}

c = 0
for i in range(len(s)):
    if c < k <= c+d[s[i]]:
        print(s[i])
        break
    c += s[i]

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())

sys.setrecursionlimit(10 ** 9)


def main():
    S = INT()
    _ = INT()

    for i in str(S):
        if int(i) != 1:
            print(i)
            break
    else:
        print(1)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())

sys.setrecursionlimit(10 ** 9)


def main():
    S = INT()
    _ = INT()

    for i in str(S):
        if int(i) != 1: 
            print(i)
            sys.exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

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

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

Submission status: Wrong Answer

Solution code:
s = input().strip()
k = int(input().strip())
days = 5 * (10 ** 15)
if len(s) == 1:
    print(s)
    exit()
before = 0
for i in range(0, len(s)):
    diff = 0
    if s[i] == "1":
        diff = 1
    else:
        for j in range(1, (days + 1), 1):
            if 10 ** 18 <= int(s[i]) ** j:
                diff = int(s[i]) ** j
                break
    if (k - 1) <= (before + diff):
        print(s[i])
        break
    else:
        before = before + diff