結果
問題 |
No.3135 AAABC
|
ユーザー |
|
提出日時 | 2025-05-02 23:46:16 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 510 ms / 2,000 ms |
コード長 | 283 bytes |
コンパイル時間 | 444 ms |
コンパイル使用メモリ | 82,768 KB |
実行使用メモリ | 132,000 KB |
最終ジャッジ日時 | 2025-05-02 23:46:23 |
合計ジャッジ時間 | 5,697 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 32 |
ソースコード
N=int(input()) S=int(input()) import sys sys.setrecursionlimit(10**7) def dfs(s): global A if len(s)==N: if set(s)=={*"ABC"}: A.append(s) return for c in "ABC": dfs(s+c) A=[] dfs("") if S<=len(A): print(A[S-1]) else: print(-1)