結果
問題 | No.1869 Doubling? |
ユーザー |
![]() |
提出日時 | 2022-03-11 22:33:17 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 248 bytes |
コンパイル時間 | 258 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 52,096 KB |
最終ジャッジ日時 | 2024-09-16 02:55:48 |
合計ジャッジ時間 | 3,269 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 39 WA * 4 |
ソースコード
N,M = map(int, input().split()) ans1 = 1 for i in range(M): if pow(2,i+1)<=M: ans1+=pow(2,i+1) else: break ans = M while N>1 and M>=2: M = -(-M//2) ans += M N-=1 if M>=2: print(ans1) else: print(ans+N-1)