結果
| 問題 |
No.3299 K-th MMA String
|
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-10-05 17:13:06 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 148 ms / 2,000 ms |
| コード長 | 438 bytes |
| コンパイル時間 | 291 ms |
| コンパイル使用メモリ | 82,332 KB |
| 実行使用メモリ | 76,996 KB |
| 最終ジャッジ日時 | 2025-10-05 17:13:13 |
| 合計ジャッジ時間 | 3,104 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
N, K = map(int, input().split())
cnt = 0
for i in range(1 << 20):
ok = False
for j in range(20-2):
a = i & (1 << j)
b = i & (1 << (j+1))
c = i & (1 << (j+2))
if not a and b and c:
ok = True
break
if ok:
cnt += 1
if cnt == K:
bs = [('M' if i & (1 << j) else 'A') for j in range(N)]
print(''.join(reversed(bs)))
break
norioc