結果
| 問題 | No.3135 AAABC |
| コンテスト | |
| ユーザー |
Cecil
|
| 提出日時 | 2025-05-02 23:05:36 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 285 ms / 2,000 ms |
| コード長 | 356 bytes |
| 記録 | |
| コンパイル時間 | 237 ms |
| コンパイル使用メモリ | 96,492 KB |
| 実行使用メモリ | 179,176 KB |
| 最終ジャッジ日時 | 2026-07-10 11:23:13 |
| 合計ジャッジ時間 | 5,017 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 32 |
ソースコード
from itertools import product
N = int(input())
S = int(input())
L = list()
for bit in product([0,1,2],repeat=N):
if 0 in bit and 1 in bit and 2 in bit:
L.append(bit)
L.sort()
if len(L)<S:
print(-1)
exit()
ans = ""
for i in L[S-1]:
if i==0:
ans += "A"
elif i==1:
ans += "B"
else:
ans += "C"
print(ans)
Cecil