前言
传送门 :
思路
一件商品 i i i 扫描需要 t i t_i ti时间
扫描物品,我们可以偷 t i t_i ti个物品
扫描物品 i i i,一共可获得 t i 1 t_i 1 ti 1个物品
因此,问题转换 :
一共 n n n个物品,第 i i i物品的体积为 t i 1 t_i 1 ti+1,价值为 c c c
好魔幻
Mycode
// Problem: CF19B Checkout Assistant
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/CF19B
// Memory Limit: 250 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
//��һ�δ��Ϻ�վ֮�� ��Ϊʹ��#define int long long TLE���¿��˺ܾõ�ʱ�� ���˼���ģ��
//����ʹ�ø��ӵ�ģ��
#include <iostream>
#include <vector>
#include <map>
#include <cstring>
#include <queue>
#include <algorithm>
using namespace std;
#define IOS ios::sync_with_stdio(false);
#define CIT cin.tie(0);
#define COT cout.tie(0);
#define ll long long
#define x first
#define y second
#define pb push_back
#define endl '\n'
#define all(x) (x).begin(),x.end()
typedef priority_queue<int,vector<int>,greater<int>> Pri_m;
typedef pair<int,int> pii;
typedef vector<int> VI;
map<int,int> mp;
const int N = 4010;
ll n,v,t[N],c[N],f[N];
ll ans = 2e12;
void solve()
{
memset(f,0x7f,sizeof f);
f[0] = 0 ;
cin>>n;
for(int i=1;i<=n;i++){
cin>>t[i]>>c[i];
t[i]++;
v = max(v,t[i]);
}
v+=n;
}
/**mYHeart is my algorithm**/
int main()
{
//int t;cin>>t;while(t -- )
solve();
return 0;
}