您当前的位置: 首页 > 

*DDL_GzmBlog

暂无认证

  • 4浏览

    0关注

    602博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

[luogu]CF19B Checkout Assistant 01背包变式

*DDL_GzmBlog 发布时间:2022-03-14 12:44:58 ,浏览量:4

前言

传送门 :

思路

一件商品 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 
#include 
#include 
#include 
#include 
#include 
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  Pri_m;
typedef pair pii;
typedef vector VI;
map 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>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;
}
关注
打赏
1657350525
查看更多评论
立即登录/注册

微信扫码登录

0.1477s