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:
#!/usr/bin/env python


def main():
    s = input().strip()
    k = int(input().strip())

    if s[0] != '1':
        print(s[0])
        return

    count_c = 0
    for c in s:
        if c == '1':
            count_c += 1
            break

    if k <= count_c:
        print(s[k-1])
    else:
        print(s[count_c])


main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = str(input())
K = int(input())
if S[0] == 1 and K == 1:
    print(1)
#     print('A')
elif len(S) <= K and list(map(int,list(S[:K]))).count(1) == K:
    print(1)
#     print('B')
elif len(S) == 1:
    print(S[0])
#     print('C')
elif S[0] != 1:
    print(S[0])
else :
    print(S[1])

Submission status: Wrong Answer

Solution code:
import math
s = list(map(int,list(input())))
k = int(input())
for item in s:
  if item == 1:
    k -= 1
  else:
    k -= math.log10(item)*5000000000000000
  if k <= 0:
    print(item)
    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:
# coding: utf-8
# Your code here!
N=input()
K=int(input())
num=0
count=0
flag=0
for i in N:
  count+=1
  if int(i)!=1:
    num=int(i)
    flag=1
    break
if count>=K or flag==0:
  print(1)
else:
  print(num)

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
flag = False
for i in S:
    if(int(i) != 1):
        print(i)
        flag = True
        break
if(flag == False):
    print("1")

Submission status: Wrong Answer

Solution code:
import sys
S=input()
li=''.join(S)
S1=len(li)
m=[]

K=int(input())
ans=str(K)
k1=''.join(ans)
k2=len(k1)
print(k2)
for i in range(0,S1):
    if li[i]!='1' and (i+1)<K:
        if li[i]==2 and k2>=1505000000000001+i:
            pass
        else:
            print(li[i])
            sys.exit()

print('1')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


def main():
    s = input()
    k = int(input())
    one_count = 0

    for si in s:
        if si == '1':
            one_count += 1
        else:
            break

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

ans = '1'
for s in S:
    if s == '2' and K > 1e16:
        K = 1e18
        continue
    elif s == '2' or s == '3' or s == '4' or s == '5' or s == '6' or s == '7' or s == '8' or s == '9':
        ans = s
        break
    
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
if k==1:
    print(s[0])
else:
    if s[0]=="1":
        if k <= (10**18):
            print(s[1])
        else:
            print(s[2])
    else:
        if k <= (10**18):
            print(s[0])
        else:
            print(s[1])

Submission status: Wrong Answer

Solution code:
S = list(str(input()))
S = list(map(int,S))

K = int(input())
S_copy = []


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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


def main():
    s = input().strip()
    k = int(input().strip())

    if s[0] != '1':
        print(s[0])
        return

    count_c = 0
    for c in s:
        if c == '1':
            count_c += 1

    if k <= count_c:
        print(s[k-1])
    else:
        print(s[count_c])


main()

Submission status: Wrong Answer

Solution code:
S = list(input())
K = int(input())
ans = 1
for i in S:
    if i != '1':
        print(i)
        exit()
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
num = int(input())
num2 = int(input())
def gen(n):
    if n < 10:
        yield n
    else:
        for m in gen(n/10):
            yield m
        yield n%10

a = [int(i) for i in gen(num)]

for i in a:
    num2 -= 1
    if num2 == 0:
        print(i)
        break
    elif i != 1:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
for i in S:
    if(int(i) != 1):
        print(i)
        break

Submission status: Wrong Answer

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

s = list(set(map(int,S)))
s.sort

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

if (K == 1 and s[0] == 1):
    print(1)
else:
    print(min)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=input()
K=int(input())
num=0
count=0
for i in N:
  count+=1
  if int(i)!=1:
    num=int(i)
    break
if count>K:
  print(1)
else:
  print(num)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = '1'
for s in S:
    if s == '2' and K > 9460730472580800:
        K = 1e18
        continue
    elif s == '2' or s == '3' or s == '4' or s == '5' or s == '6' or s == '7' or s == '8' or s == '9':
        ans = s
        break
    
print(ans)

Submission status: Wrong Answer

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

for i in range(K):
    if (int(S[i]) == 1):
        ans = i
        continue
    if (int(S[i]) >= 2):
        ans = int(S[i])
    break

print(ans)

Submission status: Wrong Answer

Solution code:
S=list(input())
K=int(input())
S0=[]
for i in S:
    if i=='1':
        S0.append(i)
    else:
        S0.append(i)
        break
if K>=len(S0):
    print(S0[-1])
else:
    print(S0[K])

Submission status: Wrong Answer

Solution code:
import sys
S=input()
li=''.join(S)
S1=len(li)
m=[]

K=int(input())
for i in range(0,S1):
    if li[i]!='1' and (i+1)<K:
        if li[i]==2 and K>=15050000000000000+1+i:
            pass
        else:
            print(li[i])
            sys.exit()

print('1')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

n = 0

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

for i in range(len(s)):
    n += m[s[i]]
    if n >= k:
        print(s[i])
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

s = input()
r = int(input())

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

Submission status: Wrong Answer

Solution code:
S = input()
K = int(input())
flg = 1
cnt = 0
while flg == 1:
    if len(S) <= cnt:
        flg = 0
    if S[cnt:cnt+1] == 1:
        cnt = cnt+1
    else:
        flg = 0
if cnt >= K:
    ans = 1
else:
    ans = S[cnt:cnt+1]
print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = 5000000000000000
S = input()
K = math.log(int(input()))
for i in S:
  num = int(i)
  kk = N * math.log(num) + 1
  if kk > K:
    print(num)
    break
  else:
    K -= kk

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
if k<105:
    if s[:k]=="1"*k:
        print("1")
else:
    i=0
    while True:
        if s[i]!="1":
            print(s[i])
            break
        i+=1

Submission status: Wrong Answer

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

if int(s[0]) == 1:
  one_count = 0
  i = 0
  while s[i] == 1:
    one_count += 1
    i += 1
  if k <= one_count:
    print(1)
  else:
    print(s[one_count])
else:
  print(s[0])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = list(input())
N, = list(map(int,input().split()))

ans = 1
num_1 = 0

for i in range(len(S)):
    if  not S[i] == '1':
        ans = int(S[i])
        break
    else:
        num_1 += 1

if  len(S) == 1:
    ans = int(S[0])
if  num_1 > N:
    ans = 1
        
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

s = input()
r = int(input())

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

n = 0
while n < len(S):
    if S[n] != '1':
        break
    else:
        n += 1

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

Submission status: Wrong Answer

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


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

first_non1=0
count=0
find=0
for i in range (len(S)):
    if S[i]!='1' and find==0:
        first_non1=S[i]
        count=i
        find+=1
        
if int(K)<count+1:
    print(1)
else:
    print(int(first_non1))

Submission status: Wrong Answer

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

if int(s[0]) == 1:
  one_count = 1
  i = 0
  while s[i] == 1:
    one_count += 1
    i += 1
  if k <= one_count:
    print(1)
  else:
    print(s[one_count])
else:
  print(s[0])

Submission status: Wrong Answer

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

ans = '1'
for s in S:
    if s == '2' or s == '3' or s == '4' or s == '5' or s == '6' or s == '7' or s == '8' or s == '9':
        ans = s
        break
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
S=input()
li=''.join(S)
S1=len(li)
m=[]

K=int(input())
for i in range(0,S1):
    if li[i]!='1' and (i+1)<K:
        print(li[i])
        sys.exit()

print('1')

Submission status: Wrong Answer

Solution code:
S = list(input())
N, = list(map(int,input().split()))

ans = 1

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

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

Submission status: Wrong Answer

Solution code:
line = input()
flag = False
for i in range(int(input())):
  if not(line[i]== '1'):
    print(line[i])
    flag = True
    break

if flag:
  print('1')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

S = input()
K = input()
K_len = len(K)
K = int(K)

Cn = []
GOSENCHO = 5000000000000000


for str in S:
    si = int(str)
    if si == 1:
        Cn.append(1)
        tmp = 1
    else:
        Cn.append(10000000000000000000)

for i,Ci in enumerate(Cn):
    if K <= Ci:
        print(S[i])
        break

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:
import math
time = 5 * 10**15

num = input()
k = int(input())

chk = 0
count = 0
while chk == 1:
    if num[0] == '1':
        a.pop(0)
        count += 1
    else:
        chk = 1

if k <= count:
    print(1)
else:
    print(num[0])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


def main():
    s = input()
    k = int(input())
    set_s = set(s)

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

Submission status: Wrong Answer

Solution code:
import sys
S=input()
li=''.join(S)
S1=len(li)
m=[]

K=int(input())
for i in range(0,S1):
    if li[i]!='1':
        print(li[i])
        sys.exit()
print('1')

Submission status: Wrong Answer

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

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

n = 0
while n < len(S):
    if S[n] != '1':
        break
    else:
        n += 1

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


def main():
    s = input()
    k = int(input())
    set_s = set(s)

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
num = int(input())

def gen(n):
    if n < 10:
        yield n
    else:
        for m in gen(n/10):
            yield m
        yield n%10

a = [int(i) for i in gen(num)]

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

Submission status: Wrong Answer

Solution code:
S = list(input())
N, = list(map(int,input().split()))

ans = 1

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

Submission status: Wrong Answer

Solution code:
import sys
S=input()
li=''.join(S)
S1=len(li)
m=[]

K=int(input())
for i in range(0,S1):
    if li[i]!='1':
        print(li[i])
        sys.exit()

Submission status: Wrong Answer

Solution code:
import math
N = 5000000000000000
S = input()
K = math.log(int(input()))
for i in S:
  num = int(i)
  kk = N * math.log(num)
  if kk >= K:
    print(num)
    break
  else:
    K -= kk

Submission status: Wrong Answer

Solution code:
import math

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

ps = []

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

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

Submission status: Wrong Answer

Solution code:
import math

S = input()
K = float(input())
klog = math.log(K)

poslog = 0
for s in S:
    poslog += 5e11*math.log(float(s))
    if klog <= poslog:
        print(s)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
time = 5 * 10**15

num = input()
k = int(input())

chk = 0
while chk == 1:
    if num[0] == '1':
        a.pop(0)
    else:
        chk = 1

print(num[0])

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
if k==1:
    print(s[0])
else:
    if s[0]=="1":
        if k < (10**19):
            print(s[1])
        else:
            print(s[2])
    else:
        if k < (10**19):
            print(s[0])
        else:
            print(s[1])

Submission status: Wrong Answer

Solution code:
import math
N = 5000000000000000
print(N)
S = input()
K = math.log(int(input()))
for i in S:
  num = int(i)
  kk = N * math.log(num)
  if kk >= K:
    print(num)
    break
  else:
    K -= kk

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 18 20:38:47 2018
ABC106C
@author: maezawa
"""

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

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

Submission status: Wrong Answer

Solution code:
import math, string, fractions, heapq, re, array, bisect, sys, random, time, copy
import itertools as it
import operator as op
import collections as cl
import functools as ft

def LI(): return list(map(int, input().split()))
def LI_(): return list(map(lambda x: int(x) - 1, input().split()))
def LF(): return list(map(float, input().split()))
def LS(): return input().split()
def I(): return int(input())
def F(): return float(input())
def S(): return input()


def count_first_1(s):
    count = 0
    first_letter = ''

    for letter in s:
        if letter == '1':
            count += 1
        else:
            first_letter = letter
            break

    return count, first_letter


if __name__ == "__main__":
    s = S()
    k = I()

    count, first_letter = count_first_1(s)

    if not first_letter:
        result = '1'

    elif count > k:
        result = '1'

    else:
        result = first_letter

    print(result)

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
t = '1'

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

print(t)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

s = input()

for i in s:
    if(i!="1"):
        print(i)
        break

Submission status: Wrong Answer

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

for c in s:
    if c!=1:
        res=c
        break

print(res)

Submission status: Wrong Answer

Solution code:
import math

S = input()
K = float(input())
klog = math.log(K)

poslog = 0
for s in S:
    poslog += 5e11*math.log(float(s))
    if klog < poslog:
        print(s)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
if k==1:
    print(s[0])
else:
    if s[0]=="1":
        if k < (10**18):
            print(s[1])
        else:
            print(s[2])
    else:
        if k < (10**18):
            print(s[0])
        else:
            print(s[1])

Submission status: Wrong Answer

Solution code:
S = str(input())
K = int(input())
if S[0] == 1 & K == 1:
    print(1)
elif len(S) != 1:
    print(S[0])
else:
    print(S[0])

Submission status: Wrong Answer

Solution code:
import sys

str_s = input()
k = input()

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

gosentyo = 5000000000000000
count = 0
for s in str_s:
    now_count = 1

    if int(s) == 1:
        count += 1
    else:
        for i in range(gosentyo):

            if now_count * int(s) + count >= k:
                print(s)
                sys.exit()
            else:
                now_count *= int(s)
        else:
            count += now_count

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
l=list(input())
k=int(input())
m=[0]*len(l)
for i in range(len(l)):
    var=pow(int(l[i]),50)
    if(i==0):
        m[i]+=var
    if(i>=1):
        m[i]+=(m[i-1]+var)
    if(k<=m[i]):
        print(l[i])
        exit()

Submission status: Wrong Answer

Solution code:
import math
N = 5000000000000000
print(N)
S = input()
K = math.log(int(input()))
for i in S:
  num = int(i)
  kk = N * math.log(num)
  if kk > K:
    print(num)
    break
  else:
    K -= kk

Submission status: Wrong Answer

Solution code:
data = input()
num = int(input())

cnt = 0
for lop in range(len(data)):
    cnt = cnt + (int(data[lop])*1000000000000000000)**5
    if cnt > num:
        print(data[lop])
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(0, len(S)):
    if int(S[i])*5000000000000000 > K:
        print(S[i])
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    k = int(input())
    # あたまに '1' が並んでいるケース
    ss = ''
    for w in s:
        if w == '1':
            ss += w
        else:
            break
    if len(ss) == k:
        print(1)
        return
    for w in s:
        if w != '1':
            print(w)
            break



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

if flg == False:
    print("1")

Submission status: Wrong Answer

Solution code:
s = input()
k = int(input())
if len(s) == 1:
    print(s)
else:
    i = 0
    while i <= len(s)-1:
        if s[i] != '1':
            print(s[i])
            exit()
        else:
            i += 1
    print(1)

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
if k==1:
    print(s[0])
else:
    if s[0]=="1":
        if k < (10**17):
            print(s[1])
        else:
            print(s[2])
    else:
        if k < (10**17):
            print(s[0])
        else:
            print(s[1])

Submission status: Wrong Answer

Solution code:
a = int(input())
 
if a<105:
    print(0)
elif 105<= a < 135:
    print(1)
elif 135<= a < 165:
    print(2)
else:
    print(3)

Submission status: Wrong Answer

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

if k == '1':
    print(s[0])
else:
    n = min(int(k), len(s))
    f = True
    for i in range(n):
        if s[i] != '1':
            print(s[i])
            f = False
    if f:
        print(1)

Submission status: Wrong Answer

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

## 5000兆日
#a = 5000 * 10000 * 10000 * 10000
#
## 10の18乗
#k = 10 ** 18 = 10 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000


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

ans="1"
for c in S:
	if (c=="1"): continue
	ans = c
	break

print(ans)

Submission status: Wrong Answer

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

c = 0
for i in S:
    if int(i) != 1:
        c = int(i)
        break

print(c)

Submission status: Wrong Answer

Solution code:
l=list(input())
k=int(input())
m=[0]*len(l)
for i in range(len(l)):
    var=pow(int(l[i]),int(l[i])+7)
    if(i==0):
        m[i]+=var
    if(i>=1):
        m[i]+=(m[i-1]+var)
    if(k<=m[i]):
        print(l[i])
        exit()

Submission status: Wrong Answer

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

if S[0] != "1":
    print(S[0])
    
else:
    for n, s in enumerate(S):
        if n == K:
            print(1)
            break
        
        if s == "1":
            continue
        
                
        print(s)
        break

Submission status: Wrong Answer

Solution code:
s=input()
ss=input()
l=len(s)
if s=="1"*l:
    print("1")
else:
    i=0
    while True:
        if s[i]!="1":
            print(s[i])
            break
        i+=1

Submission status: Wrong Answer

Solution code:
l=list(input())
k=int(input())
m=[0]*len(l)
for i in range(len(l)):
    var=pow(int(l[i]),int(l[i])+4)
    if(i==0):
        m[i]+=var
    if(i>=1):
        m[i]+=(m[i-1]+var)
    if(k<=m[i]):
        print(l[i])
        exit()

Submission status: Wrong Answer

Solution code:
import sys

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

if k == 1:
  print(s[0])
  sys.exit()
else:
  if int(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])
else:
  if s[0]=="1":
    print(s[1])
  else:
    print(s[0])

Submission status: Wrong Answer

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

ans = 1

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

Submission status: Wrong Answer

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

s = ''
for i in S:
    s += i
    if i != '1':
        break

if K < len(s):
    print(s[K])
else:
    print(s[-1])

Submission status: Wrong Answer

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

total = 0

ans = 1

for i, c in enumerate(s, 1):
    if str(i) == k:
        break

    if int(c) == 1:
        total += 1
    else:
        ans = c
        break

print(ans)

Submission status: Wrong Answer

Solution code:
l=list(input())
k=int(input())
m=[0]*len(l)
for i in range(len(l)):
    var=pow(int(l[i]),int(l[i])+2)
    if(i==0):
        m[i]+=var
    if(i>=1):
        m[i]+=(m[i-1]+var)
    if(k<=m[i]):
        print(l[i])
        exit()

Submission status: Wrong Answer

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

ans = '1'
for s in S:
    if s == '1':
        continue

    ans = s
    break

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
s=input()
k=int(input())
if(len(s)==1):
    print(s[0])
    sys.exit()
if(k==1):
    print(s[0])
    sys.exit()
c=0
for i in range(k):
    if(s[i]=='1'):c+=1
    else:break
if(c==k):
    print(1)
else:
    if(c==0):print(s[0])
    else:print(s[c+1])

Submission status: Wrong Answer

Solution code:
import math, string, fractions, heapq, re, array, bisect, sys, random, time, copy
import itertools as it
import operator as op
import collections as cl
import functools as ft

def LI(): return list(map(int, input().split()))
def LI_(): return list(map(lambda x: int(x) - 1, input().split()))
def LF(): return list(map(float, input().split()))
def LS(): return input().split()
def I(): return int(input())
def F(): return float(input())
def S(): return input()


wait_time = 5 * 10**15

if __name__ == "__main__":
    s = S()
    k = input()

    result = ''
    for letter in s:
        if letter != '1':
            result = letter
            break

    if not result:
        result = '1'

    print(result)

Submission status: Wrong Answer

Solution code:
N = input()
K = input()

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


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

Submission status: Wrong Answer

Solution code:
from sys import stdin

S = stdin.readline().rstrip()
K = int(stdin.readline().rstrip())

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

Submission status: Wrong Answer

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


for s in S:
    if s == '1':
        continue

    print(s)
    break

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 18 20:38:47 2018
ABC106C
@author: maezawa
"""

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

Submission status: Wrong Answer

Solution code:
import math, string, fractions, heapq, re, array, bisect, sys, random, time, copy
import itertools as it
import operator as op
import collections as cl
import functools as ft

def LI(): return list(map(int, input().split()))
def LI_(): return list(map(lambda x: int(x) - 1, input().split()))
def LF(): return list(map(float, input().split()))
def LS(): return input().split()
def I(): return int(input())
def F(): return float(input())
def S(): return input()


wait_time = 5 * 10**15

if __name__ == "__main__":
    s = S()
    k = input()

    result = ''
    for letter in s:
        if letter != '1':
            result = letter
            break

    if not result:
        result = '1'

Submission status: Wrong Answer

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

if K == 1:
    print(S[0])
    
else:
    for n, s in enumerate(S):
        if n == K - 1:
            print(1)
            break
        
        if s == "1":
            continue
        
        print(s)
        break

Submission status: Wrong Answer

Solution code:
s=input()
k=int(input())
if k==1:
    print(s[0])
else:
    if s[0]=="1":
        if k < (5 *(10**16)):
            print(s[1])
        else:
            print(s[2])
    else:
        if k < (5*(10**16)):
            print(s[0])
        else:
            print(s[1])

Submission status: Wrong Answer

Solution code:
data = input()
num = int(input())

cnt = 0
for lop in range(len(data)):
    if int(data[lop]) == 1:
        if num == cnt:
            print(data[lop])
            break
        else :
            cnt = cnt + 1
    else :
        cnt += (int(data[lop])*1000000000000000)**5
        if cnt > num:
            print(data[lop])
            break