結果

問題 No.378 名声値を稼ごう
ユーザー bellangeldindonbellangeldindon
提出日時 2019-05-17 14:07:50
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 381 ms
コンパイル使用メモリ 6,676 KB
実行使用メモリ 6,120 KB
最終ジャッジ日時 2023-09-14 18:29:14
合計ジャッジ時間 1,114 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,000 KB
testcase_01 AC 11 ms
5,884 KB
testcase_02 AC 11 ms
5,852 KB
testcase_03 AC 11 ms
5,984 KB
testcase_04 AC 11 ms
6,120 KB
testcase_05 AC 12 ms
5,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
meisei = [N]
while N != 0:
	N /= 2
	meisei.append(N)
normalsum = 0
for i in range(0, len(meisei)):
	normalsum += meisei[i]
max = 0
sum = 0
for i in range(0, len(meisei)):
	if sum + meisei[i]*2 - normalsum > max: max = sum + meisei[i]*2 - normalsum
	sum += meisei[i]
print max
0