結果
問題 |
No.3299 K-th MMA String
|
ユーザー |
|
提出日時 | 2025-10-05 15:35:45 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 480 bytes |
コンパイル時間 | 230 ms |
コンパイル使用メモリ | 82,112 KB |
実行使用メモリ | 76,516 KB |
最終ジャッジ日時 | 2025-10-05 15:35:57 |
合計ジャッジ時間 | 3,329 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 i in range(c): print(S[i],end = "") print()