結果
問題 |
No.642 Two Operations No.1
|
ユーザー |
![]() |
提出日時 | 2022-05-06 18:50:32 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 309 bytes |
コンパイル時間 | 75 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-05 19:55:01 |
合計ジャッジ時間 | 1,081 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 15 |
ソースコード
from sys import setrecursionlimit setrecursionlimit(10**6) def dfs(x): print(x) if x in dic: return dic[x] if x % 2 == 0: dic[x] = dfs(x//2) + 1 return dic[x] else: dic[x] = dfs(x+1) + 1 return dic[x] N = int(input()) dic = {} dic[1] = 0 print(dfs(N))