結果
問題 | No.47 ポケットを叩くとビスケットが2倍 |
ユーザー | dashi_dragons |
提出日時 | 2017-02-10 18:11:39 |
言語 | Python3 (3.11.6 + numpy 1.26.0 + scipy 1.11.3) |
結果 |
WA
|
実行時間 | - |
コード長 | 341 bytes |
コンパイル時間 | 90 ms |
コンパイル使用メモリ | 10,736 KB |
実行使用メモリ | 7,980 KB |
最終ジャッジ日時 | 2023-08-27 06:55:36 |
合計ジャッジ時間 | 1,556 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 16 ms
7,772 KB |
testcase_01 | AC | 16 ms
7,772 KB |
testcase_02 | AC | 16 ms
7,744 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | AC | 16 ms
7,780 KB |
testcase_06 | AC | 16 ms
7,792 KB |
testcase_07 | AC | 16 ms
7,776 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
ソースコード
import sys def check_range(a,b,x): if a > x or b < x: sys.exit() def check_eq(a,b): if a != b: sys.exit() def cal(x): if x == 1: return 0 elif x == 2: return 1 elif x % 2 == 1: buf = cal(x // 2) + 2 return buf else: buf = cal(x // 2) + 1 return buf N = int(input()) check_range(1,100000000,N) print(cal(N))