結果

問題 No.3299 K-th MMA String
ユーザー sepa38
提出日時 2024-08-08 00:31:30
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 260 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 106,368 KB
最終ジャッジ日時 2024-08-08 00:34:42
合計ジャッジ時間 4,553 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other AC * 10 TLE * 1 -- * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
cnt = 0
for i in range(1<<min(n, 20)):
    s = ""
    for j in range(n):
        s = "AM"[i%2] + s
        i //= 2
    if "MMA" in s:
        cnt += 1
        if cnt == k:
            print("A" * (n - 20) + s)
            break
0