結果
問題 |
No.47 ポケットを叩くとビスケットが2倍
|
ユーザー |
|
提出日時 | 2018-07-05 11:30:47 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 819 bytes |
コンパイル時間 | 116 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-07-01 02:23:44 |
合計ジャッジ時間 | 1,621 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 4 WA * 17 |
ソースコード
import sys import math def main(): text = sys.stdin.readline() bisckets_n = int(text) bisckets_ini = 1 bisckets_total = 0 tap_count = 0 tap_total = 0 while bisckets_n > bisckets_total: tap_count = math.floor((math.log10(bisckets_n - bisckets_total) - math.log10(bisckets_ini)) / math.log10(2)) bisckets_total += pow(bisckets_ini * 2,tap_count) if (bisckets_n - bisckets_total) == 1 : bisckets_ini = 1.0 else: bisckets_ini = math.floor((bisckets_n - bisckets_total) / 2) tap_total += tap_count #print("tap:" + str(tap_count),"total biskets:" + str(bisckets_total),"next biskets:" + str(bisckets_ini)) bisckets_total -= bisckets_ini print(tap_total) if __name__ == "__main__": main()