結果
問題 |
No.47 ポケットを叩くとビスケットが2倍
|
ユーザー |
![]() |
提出日時 | 2016-11-30 00:01:27 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 287 bytes |
コンパイル時間 | 75 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-27 13:51:21 |
合計ジャッジ時間 | 1,446 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 WA * 8 |
ソースコード
def main(): N = int(input()) hit = 0 biscuit = 1 while biscuit * 2 < N: biscuit = biscuit * 2 hit += 1 if (N - biscuit) > 1: hit += ((N - biscuit) & 1) + 1 else: hit += 1 print(hit) if __name__ == '__main__': main()