結果
問題 |
No.642 Two Operations No.1
|
ユーザー |
![]() |
提出日時 | 2022-05-06 18:49:40 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 296 bytes |
コンパイル時間 | 109 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 278,912 KB |
最終ジャッジ日時 | 2024-07-05 19:54:28 |
合計ジャッジ時間 | 7,300 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 WA * 6 RE * 5 |
ソースコード
from sys import setrecursionlimit setrecursionlimit(10**6) def dfs(x): if x in dic: return dic[x] if N % 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))