```python # 读取输入 n = int(input()) num = list(map(int, input().split())) cost = list(map(int, input().split())) # 将num和cost按照num的大小排序 pairs = sorted(zip(num, cost)) num_sorted, cost_sorted = zip(*pairs) # 计算最小代价 total_cost = 0 for i in range(n): total_cost += num_sorted[i] * i - cost_sorted[i] # 对结果取模 result = total_cost % (264) print(result) ``` [2024-11-10 19:20:48 | AI写代码神器 | 257点数解答]