結果
| 問題 | No.3135 AAABC |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-05-22 01:08:41 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 299 ms / 2,000 ms |
| コード長 | 396 bytes |
| 記録 | |
| コンパイル時間 | 227 ms |
| コンパイル使用メモリ | 95,724 KB |
| 実行使用メモリ | 184,472 KB |
| 最終ジャッジ日時 | 2026-07-10 22:31:52 |
| 合計ジャッジ時間 | 5,230 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 32 |
ソースコード
from itertools import product
def make(n: int):
res = []
for ps in product(range(3), repeat=n):
if not all(x in ps for x in [0, 1, 2]):
continue
res.append(ps[:])
return res
N = int(input())
S = int(input())
cands = make(N)
if S > len(cands):
print(-1)
exit()
d = {0: 'A', 1: 'B', 2: 'C'}
ans = ''.join(d[x] for x in cands[S-1])
print(ans)
norioc