結果
問題 |
No.3135 AAABC
|
ユーザー |
|
提出日時 | 2025-07-02 11:42:32 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 413 ms / 2,000 ms |
コード長 | 258 bytes |
コンパイル時間 | 405 ms |
コンパイル使用メモリ | 82,364 KB |
実行使用メモリ | 134,668 KB |
最終ジャッジ日時 | 2025-07-02 11:42:38 |
合計ジャッジ時間 | 5,936 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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]))