Skip to content

Instantly share code, notes, and snippets.

@lithtle
Last active September 23, 2021 03:52
Show Gist options
  • Save lithtle/4a93d3ea2f5a8a6c7d6d6973113fa2dd to your computer and use it in GitHub Desktop.
Save lithtle/4a93d3ea2f5a8a6c7d6d6973113fa2dd to your computer and use it in GitHub Desktop.
目標ろんめんぺいになるまでどれだけCEを周回すればいいのか
# deepcopyに必要なやつ
require 'active_support'
require 'active_support/core_ext'
# 目標ろんめんぺい金額
START = 808888
GOAL = 888888
# 各種CEで取得可能な金額とラベル
PATTERN = {
CE1: 1700,
CE2: 2800,
CE3: 4100,
CE4: 5700,
CE5: 7500
}
# カウンター足す
def create_result_hash(h, ce)
h[:counter][ce] += 1
h
end
# 周回回数を調べる
def calc_money(start=0, goal=GOAL, sum=0, result)
# 目標金額を超えたら結果を表示して終了
puts "--------------" if start + sum == goal
if start + sum >= goal
puts "金額: #{start + sum}, 差額:#{goal - (start + sum)}"
p result[:counter]
puts "--------------" if start + sum == goal
return
end
# 各CEごとに得られるろんめんぺいをどんどん追加していく
PATTERN.each { |k, v|
calc_money(start, goal, sum + v, create_result_hash(result.deep_dup, k))
}
end
calc_money(START, GOAL, 0, {labels: [], counter: {CE1: 0, CE2: 0, CE3: 0, CE4: 0, CE5: 0}})
@lithtle
Copy link
Author

lithtle commented Sep 22, 2021

arknights
ろんめんぺいあと80000稼げばなんかきれいになるじゃん?
こうするには
CE1=>43回, :CE2=>1回, :CE3=>1回 周回すればピッタリ80000ろんめんぺい稼げるらしい
理性が10*43+15+20=465必要ですね…

むりだよ…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment