LoginSignup
1
0

More than 3 years have passed since last update.

Pythonで毎日AtCoder #10

Last updated at Posted at 2020-03-19

はじめに

前回
10日目です。

#10

問題
2WA
考えたこと
まず、文字列がどのように増えていくかを考えると、文字nの長さは
$n^0,n^1,n^2,...........n^{5*10^{15}}$になります。すると末項はkの最大値よりも大きくなるので、kの範囲でindexが一番小さい1以外の文字が答えになります。ですので、forで1以外の要素を探しています。

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

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

print('1')

まとめ

次のAGCもがんばるぞい。では、また

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0