結果

問題 No.3299 K-th MMA String
コンテスト
ユーザー timi
提出日時 2025-10-05 17:59:22
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 97 ms / 2,000 ms
+ 71µs
コード長 264 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 242 ms
コンパイル使用メモリ 95,852 KB
実行使用メモリ 89,216 KB
最終ジャッジ日時 2026-07-15 14:12:31
合計ジャッジ時間 4,039 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N,K=map(int, input().split())

nex=0
while K:
  nex+=1 
  s=bin(nex)
  if '110' in bin(nex):
    K-=1 
S=bin(nex)[2:]

ans=[]
for i in range(N-len(S)):
  ans.append('A')
for s in S:
  if s=='0':
    ans.append('A')
  else:
    ans.append('M')
print(''.join(ans))

0