結果

問題 No.1176 少ない質問
ユーザー 双六双六
提出日時 2020-08-21 21:45:06
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 96 ms / 1,000 ms
コード長 535 bytes
コンパイル時間 322 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 71,812 KB
最終ジャッジ日時 2023-08-05 07:54:41
合計ジャッジ時間 3,279 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,812 KB
testcase_01 AC 91 ms
71,696 KB
testcase_02 AC 92 ms
71,564 KB
testcase_03 AC 93 ms
71,720 KB
testcase_04 AC 93 ms
71,608 KB
testcase_05 AC 91 ms
71,692 KB
testcase_06 AC 91 ms
71,524 KB
testcase_07 AC 91 ms
71,400 KB
testcase_08 AC 92 ms
71,528 KB
testcase_09 AC 89 ms
71,644 KB
testcase_10 AC 91 ms
71,604 KB
testcase_11 AC 91 ms
71,692 KB
testcase_12 AC 91 ms
71,556 KB
testcase_13 AC 91 ms
71,544 KB
testcase_14 AC 96 ms
71,400 KB
testcase_15 AC 88 ms
71,656 KB
testcase_16 AC 89 ms
71,532 KB
testcase_17 AC 89 ms
71,792 KB
testcase_18 AC 88 ms
71,692 KB
testcase_19 AC 88 ms
71,560 KB
testcase_20 AC 89 ms
71,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	A = int(input())
	if A == 5:
		print(5)
		return
	ans = INF
	n = 1
	cnt = 0
	while True:
		n *= 2
		cnt += 1
		if n >= A:
			break

	ans = min(ans, cnt * 2)

	n = 1
	cnt = 0
	while True:
		n *= 3
		cnt += 1
		if n >= A:
			break

	ans = min(ans, cnt * 3)
	print(ans)

if __name__ == '__main__':
	main()
0