結果
| 問題 | No.3135 AAABC |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-07-02 11:42:32 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 238 ms / 2,000 ms |
| + 984µs | |
| コード長 | 258 bytes |
| 記録 | |
| コンパイル時間 | 234 ms |
| コンパイル使用メモリ | 95,852 KB |
| 実行使用メモリ | 141,204 KB |
| 最終ジャッジ日時 | 2026-07-13 00:08:51 |
| 合計ジャッジ時間 | 5,170 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 32 |
ソースコード
from itertools import product
N = int(input())
S = int(input())
A = []
for a in product(["A","B","C"],repeat=N):
if "A" in a and "B" in a and "C" in a:
A.append("".join(a))
A = sorted(A)
if S>len(A):
print(-1)
else:
print("".join(A[S-1]))