結果
| 問題 |
No.3299 K-th MMA String
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-10-05 15:38:15 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 480 bytes |
| コンパイル時間 | 462 ms |
| コンパイル使用メモリ | 82,596 KB |
| 実行使用メモリ | 76,644 KB |
| 最終ジャッジ日時 | 2025-10-05 15:38:41 |
| 合計ジャッジ時間 | 3,425 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 2 WA * 18 |
ソースコード
N,K = map(int,input().split())
i = 6
count = 0
while True:
c = 1
pos = 1
while pos < i:
pos *= 2
if pos <= i:
c += 1
S = []
for j in range(c-1,-1,-1):
if i // (2**j) % 2 == 0:
S.append("A")
else:
S.append("M")
MMA = False
for j in range(c-2):
if S[j] == "M" and S[j+1] == "M" and S[j+2] == "A":
MMA = True
if MMA:
count += 1
if count == K:
break
i += 1
for x in range(c):
print(S[x],end = "")
print()