zoj 1076 Gene Assembly

博主分享了在ZOJ上解决1076题目的经历,意识到自己水题数量较多,开始专注于贪心分类的题目。这道题目涉及动态规划,需要找到最长上升子序列并输出序列。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

发现我都做400多道了水题还是这么多。。。以前肿么没发现呢。。。


也是,没做过贪心分类里的题,汗。


现在刷ZOJ论坛里贪心分类里的题。


这个是DP呀,最长上升子序列,输出序列


#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <climits>
#include <cstring>
#include <string>
#include <algorithm>
#define MID(x,y) ( ( x + y ) >> 1 )
#define L(x) ( x << 1 )
#define R(x) ( x << 1 | 1 )
#define FOR(i,s,t) for(int i=(s); i<(t); i++)
#define BUG puts("here!!!")
#define STOP system("pause")
#define file_r(x) freopen(x, "r", stdin)
#define file_w(x) freopen(x, "w", stdout)

using namespace std;

const int MAX = 1010;
struct NODE{
	int x, y, id;
	bool operator<(const NODE& a) const {
		if( a.x == x )
			return y < a.y;
		return x < a.x;
	}
};
NODE a[MAX];
int 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值