結果
| 問題 |
No.2766 Delicious Multiply Spice
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-31 21:33:33 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 520 bytes |
| コンパイル時間 | 182 ms |
| コンパイル使用メモリ | 82,028 KB |
| 実行使用メモリ | 432,776 KB |
| 最終ジャッジ日時 | 2024-12-20 22:37:21 |
| 合計ジャッジ時間 | 45,434 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 8 |
| other | AC * 19 TLE * 12 |
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
#input = sys.stdin.readline
#n = int(input())
#alist = list(map(int,input().split()))
#alist = []
#s = input()
n = int(input())
s = set()
def calc(x,seq):
if x in s:
return
s.add(x)
if x == n:
exit(print(''.join(seq)))
return
elif x > n:
return
calc(2*x + 1,seq + ['A'])
calc(3*x + 1,seq + ['B'])
calc(1,[])