結果

問題 No.2864 String of yuusaan
ユーザー tassei903tassei903
提出日時 2024-08-30 22:19:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 657 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 82,040 KB
実行使用メモリ 53,836 KB
最終ジャッジ日時 2024-08-30 22:19:55
合計ジャッジ時間 2,107 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,812 KB
testcase_01 AC 36 ms
52,620 KB
testcase_02 AC 36 ms
53,356 KB
testcase_03 AC 38 ms
52,856 KB
testcase_04 AC 38 ms
52,408 KB
testcase_05 AC 36 ms
53,616 KB
testcase_06 AC 37 ms
52,612 KB
testcase_07 AC 35 ms
53,356 KB
testcase_08 AC 35 ms
53,344 KB
testcase_09 AC 35 ms
52,336 KB
testcase_10 AC 36 ms
52,340 KB
testcase_11 AC 36 ms
53,836 KB
testcase_12 AC 35 ms
52,396 KB
testcase_13 AC 42 ms
52,440 KB
testcase_14 AC 34 ms
51,996 KB
testcase_15 AC 35 ms
52,000 KB
testcase_16 AC 34 ms
53,572 KB
testcase_17 AC 35 ms
53,624 KB
testcase_18 AC 35 ms
52,620 KB
testcase_19 AC 35 ms
53,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################

def L(n):
    return 6 * 2 ** n - 5

def f(n, k):
    if n == 1:
        return "yuusaan"[k]
    
    if k < L(n - 1):
        return f(n - 1, k)
    elif k - L(n-1) < 5:
        return "uusaa"[k-L(n-1)]
    else:
        return f(n - 1, k - L(n-1) - 5)

n, k = na()
k -= 1
n = min(n, 60)
print(f(n, k))
0