摘要:
思路:裸的DLX解数独。关键是建图,感觉还不如写个dfs直接,DLX写这个的代码很烦。#include#include#include#include#include#include#include#include#include#include#include#define pb push_back#define mp make_pair#define Maxn 400010#define Maxm 200010#define LL __int64#define Abs(x) ((x)>0?(x):(-x))#define lson(x) (x<<1)#define rso 阅读全文
摘要:
思路:dp[i]表示到第i个点为结尾能获得的最大值,那么dp[i]=h[i]*h[i]+dp[i-x]-h[i-x];(i-l#include#include#include#include#include#include#include#include#include#define pb push_back#define mp make_pair#define Maxn 100010#define Maxm 80002#define LL __int64#define Abs(x) ((x)>0?(x):(-x))#define lson(x) (x>1; }}tree[Maxn 阅读全文