結果

問題 No.555 世界史のレポート
ユーザー 💕💖💞💕💖💞
提出日時 2018-08-19 20:41:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 710 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-05-01 10:12:35
合計ジャッジ時間 1,750 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,880 KB
testcase_01 AC 31 ms
11,008 KB
testcase_02 AC 30 ms
10,880 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
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 -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
c, v = map(int, input().split())
  
s = 'A'
buff = None
cost = 0

from collections import namedtuple

items = []
Item = namedtuple('Item', ('cost', 's', 'buff') )
def copy_paste(s):
  global cost
  # copy 
  cost += c
  buff  = s
  # paste
  cost += v
  s += buff
  item = Item(cost, s, buff)
  items.append(item)
  #print(item)
  return s

for i in range(10):
  prev = s
  s = (copy_paste(s))
  if len(s) > N:
    break
#  print(s)
#print(cost)
##print(prev)
import math
costs  = []
for item in items[:-1]:
  cost = item.cost
  cost += v* math.ceil((N - len(item.s))/ len( item.buff ) )
  #print(item, (N-len(item.s)), len( item.buff ), item.cost, cost)
  costs.append(cost)
print(min(costs))
0