dfs、状压 class Solution:def shoppingOffers(self, prices, specials, needs):n = len(needs)@lru_cache(None)def dfs(pre_need):price = sum(prices[i] * pre_need[i] for i in range(n))for special in specials:n
文章目录 A. Phoenix and BalanceB. Phoenix and BeautyC. Phoenix and Distribution A. Phoenix and Balance 来源:http://codeforces.com/contest/1348/problem/A time limit per test2 seconds memory limit p
题目链接:点我啊╭(╯^╰)╮ 题目大意: n n n 个人标号为 1 1 1 ~ n n n,顺序被打乱后 第 i i i 个人的标号在 [ L i , R i ] [L_i, R_i] [Li,Ri] 之间 保证答案存在,若答案唯一,则输出唯一答案 若不唯一,则输出任意两种答案 解题思路: 考虑先弄出一组答案: 按照 L