AT_scpc2026_div3_d.Sushisushi Conveyor Belt Sushi Restaurant
入门
通过率:0%
时间限制:2.00s
内存限制:1024MB
AC君温馨提醒
该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
utilForever visited the Sushisushi conveyor belt sushi restaurant. Its conveyor belt has a total of N positions where sushi can be placed. Initially, Ki pieces of sushi are stacked at the i-th position, and eating the j-th sushi from the top at the i-th position gives satisfaction Xi,j. Xi,j may be negative.
Starting with today's lunch, utilForever will eat for T days. At lunch each day, utilForever can eat at most one sushi, namely the top sushi among the sushi at position 1. The conveyor belt moves by 1 position every night. Sushi that was at position i+1 moves to position i, and sushi that was at position 1 moves to position N.
Find the maximum possible total satisfaction utilForever can obtain.
utilForever 来到了寿司寿司(Sushisushi)回转寿司餐厅。其回转传送带共有 N 个可放置寿司的位置。初始时,第 i 个位置上叠放着 Ki 个寿司;在第 i 个位置上,从上往下数第 j 个寿司被吃掉时,带来的满足感为 Xi,j。注意:Xi,j 可能为负数。
从今天的午餐开始,utilForever 将连续进食 T 天。每天午餐时,utilForever 最多只能吃一个寿司,且只能吃位于第 1 号位置的寿司堆中最上面的那个寿司。每晚传送带会向左移动一格:原来在第 i+1 号位置的寿司移动到第 i 号位置,而原来在第 1 号位置的寿司则移动到第 N 号位置。
求 utilForever 能获得的最大总满足感。
输入格式
The input is given from Standard Input in the following format:
N T
K1 X1,1 X1,2 … X1,K1
K2 X2,1 X2,2 … X2,K2
⋮
KN XN,1 XN,2 … XN,KN
输入从标准输入中按以下格式给出:
N T
K1 X1,1 X1,2 … X1,K1
K2 X2,1 X2,2 … X2,K2
⋮
KN XN,1 XN,2 … XN,KN
输出格式
Output the maximum possible total satisfaction utilForever can obtain.
输出 utilForever 能够获得的最大总满意度。
输入输出样例
输入#1
4 10 5 31 4 -15 9 26 3 53 -5 -89 3 -79 -32 -38 0
输出#1
88
说明/提示
表示言語
/ /
Constraints
- 1≤N,T≤106
- 0≤Ki≤106
- ∑i=1NKi≤106
- −100≤Xi,j≤100
- All input values are integers.
表示语言
/ /
约束条件
- 1≤N,T≤106
- 0≤Ki≤106
- ∑i=1NKi≤106
- −100≤Xi,j≤100
- 所有输入值均为整数。
输入解题思路,AI测评打分。不知道怎么写?