結果
問題 | No.1869 Doubling? |
ユーザー |
![]() |
提出日時 | 2022-03-11 21:39:19 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 28 ms / 2,000 ms |
コード長 | 310 bytes |
コンパイル時間 | 404 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-09-16 01:48:59 |
合計ジャッジ時間 | 2,777 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
import sysinput = sys.stdin.readlineN,M=map(int,input().split())if N<=100 and M>=2**(N-1):print(2**N-1)exit()ANS=[M]while len(ANS)<N:x=ANS[-1]if x%2==0:ANS.append(x//2)else:ANS.append((x+1)//2)if ANS[-1]==1:breakprint(sum(ANS)+(N-len(ANS)))